/**
 * Age Calculator Widget Styles
 * Modern and responsive design for age calculation
 */

.age-calculator-widget {
    position: relative;
    width: 100%;
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 30px;
    transition: all 0.3s ease;
}

.age-calculator-widget:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Title Styles */
.age-calculator-title {
    font-size: 24px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 24px 0;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Form Styles */
.age-calculator-form {
    margin-bottom: 24px;
}

.age-calculator-label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #555555;
    margin-bottom: 12px;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.age-calculator-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: #f8f9fa;
    color: #333333;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.age-calculator-input:focus {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.age-calculator-input:hover {
    border-color: #c1c7cd;
    background: #ffffff;
}

/* Button Styles */
.age-calculator-button {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    outline: none;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.age-calculator-button:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.age-calculator-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Result Container */
.age-result {
    background: linear-gradient(145deg, #f0f8ff, #e6f3ff);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    margin-top: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.age-result.show {
    opacity: 1;
    transform: translateY(0);
}

.age-result.animate {
    animation: resultSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes resultSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Age Display */
.age-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.age-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 80px;
}

.age-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.age-number {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.age-label {
    font-size: 14px;
    font-weight: 500;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Additional Info */
.next-birthday,
.birth-day {
    background: linear-gradient(145deg, #fff5f5, #fef2f2);
    border: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    font-size: 15px;
    color: #374151;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.next-birthday::before,
.birth-day::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.next-birthday:hover::before,
.birth-day:hover::before {
    left: 100%;
}

.next-birthday strong,
.birth-day strong {
    color: #dc2626;
    font-weight: 600;
}

/* Error Styles */
.age-error {
    background: linear-gradient(145deg, #fef2f2, #fee2e2);
    color: #dc2626;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .age-calculator-widget {
        padding: 24px;
    }
    
    .age-calculator-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 16px;
    }
    
    .age-calculator-input,
    .age-calculator-button {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }
    
    .age-container {
        gap: 16px;
    }
    
    .age-item {
        min-width: 70px;
        padding: 16px;
    }
    
    .age-number {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .age-calculator-widget {
        padding: 20px;
    }
    
    .age-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .age-item {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
    }
    
    .age-number {
        font-size: 24px;
        margin-bottom: 0;
    }
    
    .age-label {
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .age-calculator-widget {
        background: linear-gradient(145deg, #1a1a1a, #2d2d2d);
        border-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    .age-calculator-title {
        color: #ffffff;
    }
    
    .age-calculator-label {
        color: #cccccc;
    }
    
    .age-calculator-input {
        background: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
    
    .age-calculator-input:focus {
        background: #3a3a3a;
        border-color: #667eea;
    }
    
    .age-result {
        background: linear-gradient(145deg, #1e293b, #334155);
        border-color: rgba(102, 126, 234, 0.2);
    }
    
    .age-item {
        background: linear-gradient(145deg, #2d2d2d, #3a3a3a);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .next-birthday,
    .birth-day {
        background: linear-gradient(145deg, #2d1b1e, #3a2529);
        border-color: rgba(239, 68, 68, 0.2);
        color: #e5e7eb;
    }
    
    .age-error {
        background: linear-gradient(145deg, #2d1b1e, #3a2529);
        color: #fca5a5;
        border-color: rgba(239, 68, 68, 0.3);
    }
}

/* Animation Effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.age-item {
    animation: fadeInUp 0.6s ease forwards;
}

.age-item:nth-child(1) {
    animation-delay: 0.1s;
}

.age-item:nth-child(2) {
    animation-delay: 0.2s;
}

.age-item:nth-child(3) {
    animation-delay: 0.3s;
}

.next-birthday,
.birth-day {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.4s;
}

/* Loading State */
.age-calculator-widget.loading .age-calculator-button {
    position: relative;
    color: transparent;
}

.age-calculator-widget.loading .age-calculator-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus Styles for Accessibility */
.age-calculator-input:focus,
.age-calculator-button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .age-calculator-widget {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .age-calculator-button {
        display: none;
    }
}
