* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.calculator {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header h1 i {
    color: #667eea;
    font-size: 2.2rem;
}

.header p {
    color: #718096;
    font-size: 1.1rem;
    font-weight: 400;
}

.input-section {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group label i {
    color: #667eea;
    font-size: 1.1rem;
}

.input-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    background: #ffffff;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.input-group input:hover {
    border-color: #cbd5e0;
}

.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 24px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

.calculate-btn i {
    font-size: 1.3rem;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #fc8181;
    display: none;
    font-weight: 500;
}

.result-container {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    display: none;
}

.result-container.show {
    display: block;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.age-display {
    text-align: center;
}

.age-main {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
    line-height: 1.3;
}

.age-main .highlight {
    color: #667eea;
    font-size: 2.5rem;
}

.age-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.age-item {
    background: white;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.age-item .number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    display: block;
    margin-bottom: 4px;
}

.age-item .label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.feature-card {
    text-align: center;
    padding: 24px 16px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-card i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 12px;
    display: block;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.9rem;
    color: #718096;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .calculator {
        padding: 24px;
        border-radius: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .header h1 i {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .age-main {
        font-size: 1.8rem;
    }
    
    .age-main .highlight {
        font-size: 2rem;
    }
    
    .age-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .calculator {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .age-details {
        grid-template-columns: 1fr;
    }
    
    .age-item .number {
        font-size: 1.5rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth transitions */
* {
    transition: all 0.3s ease;
}

/* Focus states for accessibility */
.calculate-btn:focus,
.input-group input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .calculator {
        background: rgba(26, 32, 44, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .header h1 {
        color: #f7fafc;
    }
    
    .header p {
        color: #a0aec0;
    }
    
    .input-group label {
        color: #f7fafc;
    }
    
    .input-group input {
        background: #2d3748;
        border-color: #4a5568;
        color: #f7fafc;
    }
    
    .input-group input:focus {
        border-color: #667eea;
    }
    
    .result-container {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        border-color: #4a5568;
    }
    
    .age-main {
        color: #f7fafc;
    }
    
    .age-item {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .age-item .label {
        color: #a0aec0;
    }
    
    .feature-card {
        background: rgba(45, 55, 72, 0.7);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .feature-card:hover {
        background: rgba(45, 55, 72, 0.9);
    }
    
    .feature-card h3 {
        color: #f7fafc;
    }
    
    .feature-card p {
        color: #a0aec0;
    }
}