/* CSS Custom Properties for consistent theming */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --input-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --border-radius: 16px;
    --transition-speed: 0.3s;
}

/* Global reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background pattern */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main container with glassmorphism effect */
.container {
    max-width: 500px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 40px;
    position: relative;
    z-index: 1;
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header section */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.header h1 {
    color: var(--text-dark);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.header p {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.5;
}

/* Form styling */
.number-form {
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: color var(--transition-speed);
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    color: var(--text-dark);
    transition: all var(--transition-speed);
    font-family: inherit;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--input-shadow);
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    color: var(--primary-color);
}

/* Button styling with interactive states */
.submit-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Result display area */
.result {
    margin-top: 24px;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s ease-out;
}

.result.show {
    opacity: 1;
    transform: scale(1);
}

.result.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid var(--success-color);
}

.result.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid var(--error-color);
}

.result-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.result h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.result .number {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 8px 0;
}

.result p {
    color: var(--text-light);
    font-size: 14px;
}

/* Footer section */
.footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.footer p {
    color: var(--text-light);
    font-size: 13px;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed);
}

.footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Responsive design for mobile devices */
@media (max-width: 640px) {
    .container {
        padding: 28px 24px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header p {
        font-size: 14px;
    }
    
    .result .number {
        font-size: 28px;
    }
}

/* Loading state for button */
.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}
