* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 48px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #4fc3f7;
}

.logo h1 {
    font-size: 2.7rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.35);
    margin-bottom: 10px;
    color: #fff;
    animation: fadeInUp 0.8s ease-out;
}

.subtitle {
    font-size: 1.35rem;
    color: #fff;
    opacity: 1;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
    margin-bottom: 18px;
    margin-top: 0.5rem;
    letter-spacing: 0.01em;
    display: block;
    text-align: center;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.age-calculator {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.calculator-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 32px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.age-form, .results-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    min-width: 320px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    gap: 25px;
    transition: all 0.3s ease;
}

.age-form:hover, .results-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.results-card {
    text-align: center;
    align-items: center;
    justify-content: flex-start;
}

.results-card.hidden {
    display: none;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group input[type="date"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: 'Inter', sans-serif;
}

.form-group input[type="date"]:focus {
    outline: none;
    border-color: #4fc3f7;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
    transform: translateY(-2px);
}

.form-group input[type="date"]:invalid {
    border-color: #ff6b6b;
    background: #fff5f5;
}

.form-group small {
    color: #666;
    font-size: 0.85rem;
    margin-top: 4px;
    display: block;
}

.calculate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.calculate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.calculate-btn:hover::before {
    left: 100%;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 195, 247, 0.3);
}

.calculate-btn:active {
    transform: translateY(0);
}

.result {
    width: 100%;
    max-width: 400px;
    transition: all 0.5s ease;
}

.result.hidden {
    display: none;
}

.result-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.result-header i {
    font-size: 2rem;
    color: #4fc3f7;
}

.result-header h2 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
}

.age-info {
    font-size: 1.4rem;
    color: #1976d2;
    font-weight: 600;
    margin: 20px 0;
}

.age-number {
    font-size: 2.2rem;
    color: #764ba2;
    font-weight: 700;
    transition: all 0.3s ease;
}

.age-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
    margin-left: 8px;
}

.age-main, .age-secondary {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 10px;
}

.age-main {
    margin-bottom: 20px;
}

.age-main .age-number {
    font-size: 3.5rem;
    color: #667eea;
}

.additional-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: left;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    font-weight: 500;
    color: #333;
}

.info-item .value {
    font-weight: 600;
    color: #667eea;
}

.fun-facts {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.fun-facts h3 {
    color: #764ba2;
    margin-bottom: 15px;
    text-align: center;
}

.facts-list {
    text-align: left;
}

.facts-list div {
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.facts-list div:last-child {
    border-bottom: none;
}

.facts-list div:hover {
    background: rgba(102, 126, 234, 0.1);
    padding-left: 10px;
    border-radius: 8px;
}

.recalculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    font-family: 'Inter', sans-serif;
}

.recalculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(118, 75, 162, 0.3);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for better accessibility */
button:focus,
input:focus {
    outline: 2px solid #4fc3f7;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .age-form, .results-card {
        border: 2px solid #333;
    }
    
    .calculate-btn, .recalculate-btn {
        border: 2px solid #fff;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .age-form {
        padding: 25px;
    }

    .result-card {
        padding: 25px;
    }

    .age-info {
        font-size: 1.2rem;
    }

    .age-number {
        font-size: 1.8rem;
    }

    .age-main .age-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 900px) {
    .calculator-container {
        flex-direction: column;
        align-items: center;
    }

    .age-form, .results-card {
        max-width: 100%;
        min-width: auto;
    }
} 