/* Smart DatePicker Styles */
.smart-datepicker-wrapper {
    position: relative;
}

.datepicker-language-selector {
    background: #ebebeb;
    border-radius: 10px 10px 0 0;
    padding: 8px 12px;
    margin-bottom: 0;
    transition: all 0.3s ease;
    overflow: hidden;
    opacity: 1;
    max-height: 50px;
}

.datepicker-language-selector.hidden {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    pointer-events: none;
}

.language-options {
    display: flex;
    gap: 20px;
    align-items: center;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.language-option input[type="radio"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #006775;
}

.language-option span {
    color: #495057;
    transition: color 0.2s ease;
}

.language-option:hover span {
    color: #006775;
}


/* Date picker popup enhancements */
.he-datepicker {
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
}

.he-datepicker .header {
    background: linear-gradient(135deg, #006775 0%, #004d5a 100%);
    color: white;
    padding: 12px;
    font-weight: 600;
}

.he-datepicker .calendar-grid {
    background: white;
}

.he-datepicker .calendar-cell {
    transition: all 0.2s ease;
}

.he-datepicker .calendar-cell:hover {
    background-color: #f0f8f9;
    color: #006775;
}

.he-datepicker .calendar-cell.selected {
    background-color: #006775;
    color: white;
}

.he-datepicker .calendar-cell.today {
    background-color: #e8f5f6;
    color: #006775;
    font-weight: 600;
}

/* Format-specific styling */
.date-type-parshas {
    font-style: italic;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
}

.date-type-night-event {
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
}

.date-type-full-date {
    background: linear-gradient(135deg, #f8fff8 0%, #f0fff0 100%);
}

.date-type-short-date {
    background: linear-gradient(135deg, #fff8f0 0%, #fff0e6 100%);
}

/* RTL support for Hebrew */
.smart-datepicker-wrapper[dir="rtl"] .language-options {
    flex-direction: row-reverse;
}

.smart-datepicker-wrapper[dir="rtl"] .language-option {
    flex-direction: row-reverse;
}

/* Responsive design */
@media (max-width: 768px) {
    .language-options {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .language-option {
        justify-content: center;
        padding: 8px;
        border-radius: 4px;
        background: white;
        border: 1px solid #e1e5e9;
    }
}

/* Animation for calendar switching */
.he-datepicker.switching {
    opacity: 0.7;
    transform: scale(0.98);
    transition: all 0.3s ease;
}

.he-datepicker.switching-complete {
    opacity: 1;
    transform: scale(1);
}

/* Loading state */
.datepicker-loading {
    position: relative;
}

.datepicker-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #006775;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smart detection indicator */
.format-detection-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background: #28a745;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.format-detection-indicator.detected-parshas {
    background: #ffc107;
}

.format-detection-indicator.detected-night {
    background: #6f42c1;
}

.format-detection-indicator.detected-hebrew {
    background: #007bff;
}

@media (prefers-reduced-motion: reduce) {
    .he-datepicker,
    .language-option span,
    .calendar-cell {
        transition: none;
    }
}