/* Age Calculator Main Styles */
.age-calculator-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.age-calculator-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.age-calculator-header {
    padding: 40px 40px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
}

.age-calculator-header h2 {
    margin: 0;
    font-size: 2.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    letter-spacing: -0.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.age-calculator-header .description {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-top: 15px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.age-calculator-body {
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.input-container {
    margin-bottom: 40px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 5px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.input-icon {
    padding: 0 20px;
    color: #667eea;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

.birth-datetime-input {
    flex: 1;
    padding: 22px 15px;
    font-size: 1.2rem;
    border: none;
    background: transparent;
    color: #333;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    min-height: 60px;
}

.birth-datetime-input::placeholder {
    color: #666;
    opacity: 0.7;
}

.calendar-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 18px 25px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.calendar-toggle-btn.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(0.95);
}

.calculate-btn {
    width: 100%;
    padding: 25px;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(245, 87, 108, 0.4);
}

.calculate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.age-result {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    margin-top: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.6s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-header h3 {
    color: #333;
    font-size: 2rem;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.last-updated {
    color: #666;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.result-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.age-unit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.age-unit:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
}

.age-unit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
}

.age-value-container {
    text-align: center;
}

.age-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
}

.age-label {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    display: block;
}

.total-days-info {
    text-align: center;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    margin-top: 20px;
}

.total-days-info p {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.total-days-info i {
    color: #667eea;
    margin-right: 10px;
}

#total_days {
    color: #667eea;
    font-weight: 800;
    font-size: 1.4rem;
}

.error-message {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    margin-top: 30px;
    font-weight: 600;
    font-size: 1.1rem;
    animation: shake 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.current-time {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
}

.current-time p {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.current-time i {
    color: #f093fb;
}

#current_time_display {
    font-weight: 600;
    color: #f093fb;
    font-family: 'Courier New', monospace;
}

.age-calculator-footer {
    padding: 25px 40px;
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.age-calculator-footer i {
    color: #f093fb;
    font-size: 1.2rem;
}

/* Flatpickr Custom Styling */
.flatpickr-calendar {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.flatpickr-day.selected {
    background: #667eea;
    border-color: #667eea;
}

.flatpickr-day.today {
    border-color: #667eea;
}

.flatpickr-day:hover {
    background: rgba(102, 126, 234, 0.1);
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
    background: rgba(102, 126, 234, 0.1);
}

/* Responsive Design */
@media (max-width: 992px) {
    .age-calculator-container {
        max-width: 95%;
        margin: 30px auto;
        padding: 15px;
    }
    
    .age-calculator-header h2 {
        font-size: 2.2rem;
    }
    
    .result-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .age-calculator-body {
        padding: 30px 20px;
    }
    
    .age-calculator-header {
        padding: 30px 20px 15px;
    }
    
    .age-calculator-header h2 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .input-group {
        flex-direction: column;
        padding: 0;
        background: transparent;
    }
    
    .input-icon {
        display: none;
    }
    
    .birth-datetime-input {
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 12px;
        margin-bottom: 10px;
        padding: 18px;
    }
    
    .calendar-toggle-btn {
        width: 100%;
        margin-left: 0;
        padding: 15px;
    }
    
    .calculate-btn {
        padding: 20px;
        font-size: 1.2rem;
    }
    
    .age-result {
        padding: 25px;
    }
    
    .result-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .age-unit {
        padding: 20px;
    }
    
    .age-value {
        font-size: 2.2rem;
    }
    
    .age-label {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .result-content {
        grid-template-columns: 1fr;
    }
    
    .age-calculator-header h2 {
        font-size: 1.6rem;
    }
    
    .calculate-btn {
        padding: 18px;
        font-size: 1.1rem;
    }
    
    .age-value {
        font-size: 2rem;
    }
    
    .current-time p {
        flex-direction: column;
        gap: 5px;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Accessibility Improvements */
.birth-datetime-input:focus,
.calendar-toggle-btn:focus,
.calculate-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .age-calculator-container {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }
    
    .calculate-btn,
    .calendar-toggle-btn,
    .flatpickr-calendar {
        display: none !important;
    }
    
    .age-result {
        box-shadow: none;
        border: 2px solid #000;
    }
}