/* Professional Booking Calendar Styles with Cinema Seat Theme */

/* ==================== FLATSOME THEME CONFLICT RESET ==================== */
/* Override Flatsome's aggressive global select styles */
.dat-lich-booking-container select,
.dat-lich-booking-container select:hover,
.dat-lich-booking-container select:focus {
    border-radius: 8px !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    padding: 10px 14px !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    opacity: 1 !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    height: auto !important;
    margin-bottom: 0 !important;
    width: 100% !important;
}

.dat-lich-booking-container select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    outline: none !important;
}

.dat-lich-booking-container select option {
    color: #374151 !important;
    background-color: #ffffff !important;
}

/* ==================== TIME SLOTS CONTAINER ==================== */
.time-slots-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.time-slots-header {
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.time-slots-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Grid */
@media (max-width: 768px) {
    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

@media (max-width: 480px) {
    .time-slots-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
}

/* ==================== CALENDAR DAY STATES ==================== */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
    background: #ffffff;
}

/* Empty day (padding days from other months) */
.calendar-day.empty {
    cursor: default;
    opacity: 0;
    pointer-events: none;
}

/* Past days - Cannot be selected */
.calendar-day.past {
    color: #9ca3af;
    cursor: not-allowed;
    background: #f9fafb;
    opacity: 0.5;
}

.calendar-day.past:hover {
    transform: none;
}

/* Available days - Can be selected */
.calendar-day.available {
    background: #ffffff;
    color: #1f2937;
    border-color: #e5e7eb;
    position: relative;
}

.calendar-day.available::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #10b981;
    border-radius: 50%;
}

.calendar-day.available:hover {
    background: #f0fdf4;
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

/* Holiday - Cannot be selected */
.calendar-day.holiday {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    cursor: not-allowed !important;
    border-color: #fecaca !important;
    position: relative !important;
}

.calendar-day.holiday:not([data-tooltip])::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #dc2626;
    border-radius: 50%;
}

/* Fully Booked - No slots available */
.calendar-day.fully-booked {
    background: #fff7ed;
    color: #ea580c;
    cursor: not-allowed;
    border-color: #fed7aa;
    position: relative;
}

.calendar-day.fully-booked::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #ea580c;
    border-radius: 50%;
}

/* Partially Available - Some slots booked */
.calendar-day.partially-available {
    background: #fffbeb;
    color: #1f2937;
    border-color: #fef3c7;
    position: relative;
}

.calendar-day.partially-available::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #f59e0b;
    border-radius: 50%;
}

.calendar-day.partially-available:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

/* Selected day */
.calendar-day.selected {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: #3b82f6;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
    font-weight: 700;
}

.calendar-day.selected:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: #3b82f6;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.calendar-day.selected::before {
    display: none;
}

/* Today indicator (only for available dates) */
.calendar-day.today.available {
    border-color: #3b82f6;
    font-weight: 700;
    box-shadow: 0 0 0 1px #3b82f6 inset;
}

.calendar-day.today.available:not(.selected)::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
}

/* ==================== TIME SLOT STATES (Cinema Seat Style) ==================== */
.time-slot {
    padding: 8px 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none !important;
    background: none !important;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    outline: none;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1),
                0 3px 10px rgba(0, 0, 0, 0.08);
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Override theme button styles for time slots - Important to prevent theme interference */
.time-slot[type="button"] {
    background-color: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    color: inherit !important;
    display: flex !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    padding: 8px 10px !important;
    text-align: center !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
    white-space: nowrap !important;
}

/* Remove button default styles */
.time-slot:focus {
    outline: none;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15), 
                0 6px 25px rgba(0, 0, 0, 0.15),
                0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Slot icon - Cinema style indicator */
.time-slot .slot-icon {
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    position: absolute;
    top: 4px;
    right: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Time text */
.time-slot .time-text {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Available time slot - Green Cinema Seat */
.time-slot.available {
    background: linear-gradient(180deg, var(--dat-lich-available-slot-start, #10b981) 0%, var(--dat-lich-available-slot-end, #059669) 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 0 var(--dat-lich-available-slot-end, #047857),
                0 6px 20px rgba(16, 185, 129, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.time-slot.available .slot-icon {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.time-slot.available:hover {
    background: linear-gradient(180deg, var(--dat-lich-available-slot-end, #059669) 0%, var(--dat-lich-available-slot-start, #047857) 100%);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 6px 0 var(--dat-lich-available-slot-end, #047857),
                0 10px 30px rgba(16, 185, 129, 0.5),
                inset 0 2px 0 rgba(255, 255, 255, 0.4),
                inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.time-slot.available:active {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 2px 0 var(--dat-lich-available-slot-end, #047857),
                0 4px 15px rgba(16, 185, 129, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Booked time slot - Red Cinema Seat (Occupied) */
.time-slot.booked {
    background: var(--dat-lich-unavailable-time, #FEE2E2) !important;
    color: var(--dat-lich-text, #374151) !important;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.time-slot.booked .slot-icon {
    background: rgba(0, 0, 0, 0.1);
    color: #dc2626;
    border: 2px solid rgba(220, 38, 38, 0.3);
}

.time-slot.booked .time-text {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    opacity: 0.7;
}

.time-slot.booked:hover {
    transform: none;
}

/* Limited slots - Orange Cinema Seat (Few Remaining) */
.time-slot.limited {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 0 #b45309,
                0 6px 20px rgba(245, 158, 11, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 4px 0 #b45309,
                    0 6px 20px rgba(245, 158, 11, 0.4),
                    inset 0 1px 0 rgba(255, 255, 255, 0.3),
                    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 0 #b45309,
                    0 6px 25px rgba(245, 158, 11, 0.6),
                    inset 0 1px 0 rgba(255, 255, 255, 0.4),
                    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    }
}

.time-slot.limited .slot-icon {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    animation: blink-warning 1.5s ease-in-out infinite;
}

@keyframes blink-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.time-slot.limited:hover {
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 6px 0 #b45309,
                0 10px 30px rgba(245, 158, 11, 0.5),
                inset 0 2px 0 rgba(255, 255, 255, 0.4),
                inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

/* Selected time slot - Blue Cinema Seat (Your Selection) */
.time-slot.selected {
    background: linear-gradient(180deg, var(--dat-lich-selected-slot-start, #3b82f6) 0%, var(--dat-lich-selected-slot-end, #2563eb) 100%) !important;
    color: #ffffff !important;
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 6px 0 var(--dat-lich-selected-slot-end, #1d4ed8),
                0 12px 35px rgba(59, 130, 246, 0.6),
                inset 0 2px 0 rgba(255, 255, 255, 0.4),
                inset 0 -1px 0 rgba(0, 0, 0, 0.2),
                0 0 0 4px rgba(59, 130, 246, 0.3);
    animation: selected-glow 2s ease-in-out infinite;
}

@keyframes selected-glow {
    0%, 100% {
        box-shadow: 0 6px 0 #1d4ed8,
                    0 12px 35px rgba(59, 130, 246, 0.6),
                    inset 0 2px 0 rgba(255, 255, 255, 0.4),
                    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
                    0 0 0 4px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 6px 0 #1d4ed8,
                    0 14px 40px rgba(59, 130, 246, 0.8),
                    inset 0 2px 0 rgba(255, 255, 255, 0.5),
                    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
                    0 0 0 5px rgba(59, 130, 246, 0.4);
    }
}

.time-slot.selected .slot-icon {
    background: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    animation: checkmark-bounce 0.5s ease-out;
}

@keyframes checkmark-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.time-slot.selected:hover {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-8px) scale(1.06);
    box-shadow: 0 8px 0 #1d4ed8,
                0 14px 40px rgba(59, 130, 246, 0.7),
                inset 0 2px 0 rgba(255, 255, 255, 0.5),
                inset 0 -1px 0 rgba(0, 0, 0, 0.3),
                0 0 0 5px rgba(59, 130, 246, 0.4);
}

/* Slot count badge (if needed) */
.time-slot .slot-count {
    font-size: 0.7rem;
    margin-top: 2px;
    opacity: 0.9;
    font-weight: 600;
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

/* ==================== LEGEND STYLES (Cinema Theme) ==================== */
.time-slots-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
}

.legend-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15),
                0 4px 12px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.75rem;
}

.legend-box.available {
    background: var(--dat-lich-available-slot-start, #10b981);
}

.legend-box.available::after {
    content: '✓';
    position: absolute;
}

.legend-box.limited {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.legend-box.limited::after {
    content: '!';
    position: absolute;
}

.legend-box.booked {
    background: var(--dat-lich-unavailable-time, #FEE2E2);
}

.legend-box.booked::after {
    content: '✕';
    position: absolute;
}

.legend-box.selected {
    background: var(--dat-lich-selected-time, #63B710);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15),
                0 6px 16px rgba(59, 130, 246, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.4),
                0 0 0 2px rgba(59, 130, 246, 0.3);
}

.legend-box.selected::after {
    content: '✓';
    position: absolute;
}

/* ==================== TOOLTIPS ==================== */
/* Tooltip only for HOLIDAY days and time slots */
.calendar-day.holiday[data-tooltip]::after,
.time-slot[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: #ffffff !important;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 400;
    white-space: pre-line;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: auto;
    max-width: 300px;
    min-width: 140px;
    text-align: left;
    line-height: 1.7;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tooltip arrow */
.calendar-day.holiday[data-tooltip]::before,
.time-slot[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.calendar-day.holiday[data-tooltip]:hover::after,
.time-slot[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.calendar-day.holiday[data-tooltip]:hover::before,
.time-slot[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

/* Loading States */
.booking-submit-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.booking-submit-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.booking-submit-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.booking-message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 500;
}

.booking-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.booking-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Price Toggle Switch */
.price-toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.price-toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: #4facfe;
}

.price-toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.price-toggle-label:hover .toggle-slider {
    box-shadow: 0 0 0 2px rgba(79, 172, 254, 0.2);
}

/* ==================== CALENDAR NAVIGATION OVERRIDE ==================== */
/* Override theme button styles for calendar navigation buttons */
.calendar-prev[type="button"],
.calendar-next[type="button"] {
    background-color: #e5e7eb !important;
    border: none !important;
    border-radius: 9999px !important;
    color: #374151 !important;
    width: 1.75rem !important;
    height: 1.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    transition: all 0.3s !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
    cursor: pointer !important;
}

.calendar-prev[type="button"]:hover,
.calendar-next[type="button"]:hover {
    background-color: #d1d5db !important; /* hover:bg-gray-300 */
    transform: scale(1.05) !important;
}

.calendar-prev[type="button"]:active,
.calendar-next[type="button"]:active {
    transform: scale(0.95) !important;
}

/* ==================== APPOINTMENT CALENDAR STYLES ==================== */

#appointment-calendar {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#appointment-calendar .calendar-header {
    margin-bottom: 1rem;
}

#appointment-calendar .calendar-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}

#appointment-calendar .calendar-weekdays {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

#appointment-calendar .calendar-weekday {
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

#appointment-calendar .calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

#appointment-calendar .calendar-day.empty {
    background: transparent;
    cursor: default;
}

#appointment-calendar .calendar-day.past {
    color: #9ca3af;
    background-color: #f3f4f6;
    cursor: not-allowed;
}

#appointment-calendar .calendar-day.available {
    color: #374151;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
}

#appointment-calendar .calendar-day.available:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    transform: scale(1.05);
}

#appointment-calendar .calendar-day.today.available {
    background-color: #eff6ff;
    border: 2px solid #3b82f6;
    color: #1d4ed8;
    font-weight: 700;
}

#appointment-calendar .calendar-day.selected {
    background-color: #3b82f6 !important;
    color: white !important;
    border: 2px solid #2563eb !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    transform: scale(1.05);
}

#appointment-calendar .calendar-day.holiday {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

#appointment-calendar .calendar-day.holiday:hover {
    background-color: #fee2e2;
    border-color: #f87171;
}

/* Responsive adjustments for appointment calendar */
@media (max-width: 640px) {
    #appointment-calendar .calendar-day {
        font-size: 0.8rem;
        min-height: 36px;
    }

    #appointment-calendar .calendar-weekday {
        font-size: 0.7rem;
    }
}

/* ==================== CARD WRAPPER SIZE REDUCTION ==================== */

/* Outer container padding */
.dat-lich-booking-container.p-6 { padding: 0.75rem !important; }

/* Booking header title area */
.dat-lich-booking-container .booking-header { margin-bottom: 0.625rem !important; }

/* Card header (gradient banner) */
.dat-lich-booking-container .calendar-header,
.dat-lich-booking-container .form-header {
    padding: 0.625rem 0.875rem !important;
}
.dat-lich-booking-container .calendar-header h3,
.dat-lich-booking-container .form-header h3 {
    font-size: 0.875rem !important;
    line-height: 1.3 !important;
}

/* Card content area */
.dat-lich-booking-container .calendar-content {
    padding: 0.75rem !important;
}
.dat-lich-booking-container #booking-form,
.dat-lich-booking-container .form-card > form {
    padding: 0.75rem !important;
}

/* Calendar grid spacing */
.dat-lich-booking-container .calendar-grid {
    margin-bottom: 0.5rem !important;
}
.dat-lich-booking-container .calendar-nav {
    margin-bottom: 0.5rem !important;
}
.dat-lich-booking-container .calendar-weekdays {
    margin-bottom: 0.25rem !important;
}

/* ==================== CALENDAR & TIME SLOT SIZE REDUCTION ==================== */

/* Calendar day cells – fixed px height, override aspect-ratio */
.dat-lich-booking-container .calendar-day {
    aspect-ratio: unset !important;
    height: 34px !important;
    min-height: unset !important;
    max-height: 34px !important;
    font-size: 12px !important;
    border-radius: 5px !important;
    border-width: 1px !important;
    line-height: 34px !important;
    padding: 0 !important;
}

/* Weekday labels */
.dat-lich-booking-container .weekday {
    font-size: 11px !important;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}

/* Calendar nav month label */
.dat-lich-booking-container .calendar-month {
    font-size: 0.875rem !important;
}

/* Calendar grid gaps tighter */
.dat-lich-booking-container .calendar-weekdays,
.dat-lich-booking-container .calendar-days {
    gap: 2px !important;
}

/* Time slots section container */
.dat-lich-booking-container .time-slots-section {
    padding: 14px !important;
    margin-bottom: 14px !important;
    border-radius: 10px !important;
}

/* Time slots header */
.dat-lich-booking-container .time-slots-header {
    padding-bottom: 10px !important;
    margin-bottom: 12px !important;
}
.dat-lich-booking-container .time-slots-header h4 {
    font-size: 0.875rem !important;
}
.dat-lich-booking-container .selected-date-display {
    font-size: 0.75rem !important;
}

/* Time slot buttons – px values, higher specificity, theme-independent */
html body .dat-lich-booking-container .time-slot,
html body .dat-lich-booking-container .time-slot[type="button"] {
    padding: 3px 5px !important;
    font-size: 11px !important;
    min-height: 28px !important;
    height: auto !important;
    border-radius: 5px !important;
    gap: 1px !important;
}
html body .dat-lich-booking-container .time-slot .time-text {
    font-size: 11px !important;
    letter-spacing: 0 !important;
}
.dat-lich-booking-container .time-slot .slot-count {
    font-size: 0.62rem !important;
    padding: 1px 5px !important;
}
.dat-lich-booking-container .time-slot .slot-icon {
    width: 14px !important;
    height: 14px !important;
    font-size: 9px !important;
}

/* Time slots grid – smaller min cell width */
.dat-lich-booking-container .time-slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)) !important;
    gap: 5px !important;
}

/* Legend */
.dat-lich-booking-container .time-slots-legend {
    padding: 10px 12px !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
    border-radius: 8px !important;
}
.dat-lich-booking-container .legend-item {
    font-size: 0.75rem !important;
    gap: 6px !important;
}
.dat-lich-booking-container .legend-box {
    width: 22px !important;
    height: 22px !important;
    border-radius: 5px !important;
    font-size: 0.6rem !important;
}

/* Selected info summary box */
.dat-lich-booking-container .selected-info {
    padding: 0.625rem !important;
    margin-top: 0.75rem !important;
    border-radius: 8px !important;
}

/* ==================== FONT SIZE NORMALIZATION (theme-agnostic) ==================== */
/* Override Tailwind rem-based sizes inside booking container so UI stays compact
   regardless of what the active theme sets as html/body font-size */

.dat-lich-booking-container {
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

/* Tailwind text-scale overrides */
.dat-lich-booking-container .text-4xl  { font-size: 1.375rem !important; line-height: 1.3 !important; }
.dat-lich-booking-container .text-3xl  { font-size: 1.25rem  !important; line-height: 1.3 !important; }
.dat-lich-booking-container .text-2xl  { font-size: 1.125rem !important; line-height: 1.35 !important; }
.dat-lich-booking-container .text-xl   { font-size: 1rem     !important; line-height: 1.4 !important; }
.dat-lich-booking-container .text-lg   { font-size: 0.9rem   !important; line-height: 1.4 !important; }
.dat-lich-booking-container .text-base { font-size: 0.85rem  !important; }
.dat-lich-booking-container .text-sm   { font-size: 0.8rem   !important; }
.dat-lich-booking-container .text-xs   { font-size: 0.72rem  !important; }

/* Padding / spacing overrides */
.dat-lich-booking-container .p-6   { padding: 1rem !important; }
.dat-lich-booking-container .p-4   { padding: 0.75rem !important; }
.dat-lich-booking-container .px-6  { padding-left: 1rem !important; padding-right: 1rem !important; }
.dat-lich-booking-container .px-4  { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.dat-lich-booking-container .py-4  { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }
.dat-lich-booking-container .py-3  { padding-top: 0.5rem   !important; padding-bottom: 0.5rem !important; }
.dat-lich-booking-container .py-2  { padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }

/* Margin overrides */
.dat-lich-booking-container .mb-8  { margin-bottom: 1rem   !important; }
.dat-lich-booking-container .mb-6  { margin-bottom: 0.75rem !important; }
.dat-lich-booking-container .mb-4  { margin-bottom: 0.5rem !important; }
.dat-lich-booking-container .mb-2  { margin-bottom: 0.375rem !important; }
.dat-lich-booking-container .mt-6  { margin-top: 0.75rem  !important; }

/* Gap overrides */
.dat-lich-booking-container .gap-8  { gap: 1rem   !important; }
.dat-lich-booking-container .gap-6  { gap: 0.75rem !important; }
.dat-lich-booking-container .gap-4  { gap: 0.5rem  !important; }
.dat-lich-booking-container .gap-2  { gap: 0.375rem !important; }
.dat-lich-booking-container .gap-1  { gap: 0.25rem  !important; }

/* Remove full-viewport height from container */
.dat-lich-booking-container.min-h-screen { min-height: unset !important; }

/* Input fields: prevent oversized inputs */
.dat-lich-booking-container input[type="text"],
.dat-lich-booking-container input[type="email"],
.dat-lich-booking-container input[type="tel"],
.dat-lich-booking-container input[type="number"],
.dat-lich-booking-container textarea,
.dat-lich-booking-container select {
    font-size: 0.85rem !important;
    padding: 0.5rem 0.75rem !important;
    line-height: 1.4 !important;
    height: auto !important;
}

/* Calendar navigation buttons */
.dat-lich-booking-container .w-10 { width: 1.75rem !important; }
.dat-lich-booking-container .h-10 { height: 1.75rem !important; }

/* Submit / action buttons */
.dat-lich-booking-container button:not(.time-slot):not(.calendar-day) {
    font-size: 0.85rem !important;
}

/* Headings reset */
.dat-lich-booking-container h1,
.dat-lich-booking-container h2,
.dat-lich-booking-container h3,
.dat-lich-booking-container h4 {
    line-height: 1.3;
}

/* ==================== FORM SECTION LAYOUT REDESIGN ==================== */

/* Form card padding */
.dat-lich-booking-container .form-card #booking-form,
.dat-lich-booking-container #booking-form {
    padding: 12px 14px !important;
}

/* Form groups: tighter spacing */
.dat-lich-booking-container .form-group {
    margin-bottom: 10px !important;
}

/* Labels: compact */
.dat-lich-booking-container label,
.dat-lich-booking-container .form-group label {
    font-size: 11px !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    color: #374151 !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
}

/* Label emoji icon */
.dat-lich-booking-container .label-icon {
    font-size: 13px !important;
    margin-right: 0 !important;
}

/* Required star */
.dat-lich-booking-container .required-star {
    font-size: 12px !important;
    margin-left: 0 !important;
}

/* Input/select/textarea: compact */
html body .dat-lich-booking-container input[type="text"],
html body .dat-lich-booking-container input[type="email"],
html body .dat-lich-booking-container input[type="tel"],
html body .dat-lich-booking-container textarea,
html body .dat-lich-booking-container select {
    font-size: 12px !important;
    padding: 7px 10px !important;
    height: auto !important;
    border-radius: 6px !important;
    line-height: 1.4 !important;
    transform: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

/* Hover: chỉ đổi border, không scale */
html body .dat-lich-booking-container input[type="text"]:hover,
html body .dat-lich-booking-container input[type="email"]:hover,
html body .dat-lich-booking-container input[type="tel"]:hover,
html body .dat-lich-booking-container textarea:hover,
html body .dat-lich-booking-container select:hover {
    border-color: #93c5fd !important;
    box-shadow: none !important;
    transform: none !important;
    outline: none !important;
}

/* Focus: border xanh + shadow nhẹ, không scale */
html body .dat-lich-booking-container input[type="text"]:focus,
html body .dat-lich-booking-container input[type="email"]:focus,
html body .dat-lich-booking-container input[type="tel"]:focus,
html body .dat-lich-booking-container textarea:focus,
html body .dat-lich-booking-container select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    outline: none !important;
    transform: none !important;
}

/* Textarea: shorter */
.dat-lich-booking-container textarea#notes {
    rows: 2;
    min-height: 54px !important;
    max-height: 80px !important;
    resize: none !important;
}

/* Select wrapper arrow icon */
.dat-lich-booking-container .select-wrapper .w-5 {
    width: 14px !important;
    height: 14px !important;
}

/* 3 dropdowns — arrange in 1 column but tighter */
.dat-lich-booking-container .form-section .form-group:nth-child(-n+3) {
    margin-bottom: 8px !important;
}

/* Customer info section */
.dat-lich-booking-container .customer-info-section {
    margin-bottom: 10px !important;
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px 10px 6px !important;
    border: 1px solid #e5e7eb;
}

/* Section heading "Thông Tin Cá Nhân" */
.dat-lich-booking-container .customer-info-section h4 {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: #6b7280 !important;
    margin-bottom: 8px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* Name + Phone row: 2 columns always, no stacking */
.dat-lich-booking-container .form-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
}

/* Email field */
.dat-lich-booking-container .email-field {
    margin-bottom: 8px !important;
}

/* Notes field */
.dat-lich-booking-container .notes-field {
    margin-bottom: 6px !important;
}

/* Submit button */
html body .dat-lich-booking-container .booking-submit-btn {
    padding: 9px 16px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    letter-spacing: 0.03em !important;
    gap: 6px !important;
}
.dat-lich-booking-container .btn-icon {
    font-size: 14px !important;
}

/* ==================== RESET TAILWIND RING & FOCUS EFFECTS ==================== */
/* Remove Tailwind ring box-shadow on all form elements */
html body .dat-lich-booking-container input,
html body .dat-lich-booking-container select,
html body .dat-lich-booking-container textarea {
    --tw-ring-shadow: none !important;
    --tw-ring-offset-shadow: none !important;
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
    transition: border-color 0.15s ease !important;
}

html body .dat-lich-booking-container input:hover,
html body .dat-lich-booking-container select:hover,
html body .dat-lich-booking-container textarea:hover {
    --tw-ring-shadow: none !important;
    --tw-ring-offset-shadow: none !important;
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
    border-color: #93c5fd !important;
}

html body .dat-lich-booking-container input:focus,
html body .dat-lich-booking-container select:focus,
html body .dat-lich-booking-container textarea:focus {
    --tw-ring-shadow: none !important;
    --tw-ring-offset-shadow: none !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
    outline: none !important;
    transform: none !important;
    border-color: #3b82f6 !important;
}
.calendar-day.holiday.disabled,
.calendar-day.off-day,
.calendar-day.off-day.disabled {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    cursor: not-allowed !important;
    border-color: #fecaca !important;
    pointer-events: auto;
}

.calendar-day.holiday.disabled:hover,
.calendar-day.off-day:hover {
    transform: none !important;
    background: #fee2e2 !important;
}
