/* Date/Time Picker Modal Z-Index Fix
   Keep picker overlays above any active management modal (e.g. booking modal). */
#datePickerModal,
#timePickerModal {
    z-index: 20000 !important;
}

#datePickerModal .modal-content,
#timePickerModal .modal-content {
    z-index: 20001 !important;
}

/* Loading Indicator Styles */
.page-loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.3);
}

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

    100% {
        transform: rotate(360deg);
    }
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 0;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    border-left: 4px solid;
    overflow: hidden;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left-color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #374151;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: #6b7280;
}

/* ==========================================
   TIME INPUT STYLES - UTILITIES
   ========================================== */

.schedule-time-inputs {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-top: 8px;
}

.time-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.time-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.time-input-wrapper .time-icon {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    font-size: 14px;
    z-index: 2;
    pointer-events: none;
}

.time-input-wrapper input[type="time"] {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
    color: var(--text-dark);
}

/* Hide default time input appearance and icons */
.time-input-wrapper input[type="time"]::-webkit-calendar-picker-indicator,
.time-input-wrapper input[type="time"]::-webkit-inner-spin-button,
.time-input-wrapper input[type="time"]::-webkit-outer-spin-button {
    display: none;
    -webkit-appearance: none;
    appearance: none;
}

.time-input-wrapper input[type="time"]::-webkit-datetime-edit-fields-wrapper,
.time-input-wrapper input[type="time"]::-webkit-datetime-edit-text,
.time-input-wrapper input[type="time"]::-webkit-datetime-edit-minute-field,
.time-input-wrapper input[type="time"]::-webkit-datetime-edit-hour-field,
.time-input-wrapper input[type="time"]::-webkit-datetime-edit-ampm-field {
    -webkit-appearance: none;
    appearance: none;
}

.time-input-wrapper input[type="time"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(112, 123, 229, 0.1);
}

.time-input-wrapper input[type="time"]:hover {
    border-color: var(--primary-color);
}

.time-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    padding: 0 8px;
    margin-bottom: 12px;
    position: relative;
}

.time-separator::before,
.time-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
    margin: 0 8px;
}

/* Responsive adjustments for time inputs */
@media (max-width: 768px) {
    .time-separator {
        display: none;
    }

    .time-input-group {
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .time-input-wrapper input[type="time"] {
        padding: 14px 16px 14px 42px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
}

/* ==========================================
   DATE INPUT STYLES
   ========================================== */

/* Hide default browser calendar icon and style date inputs */
.date-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px 12px 42px;
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(112, 123, 229, 0.1);
}

.date-input:hover {
    border-color: var(--primary-color);
}

/* Hide calendar icon in Firefox */
.date-input::-webkit-calendar-picker-indicator {
    display: none;
}

/* Hide calendar icon in Edge */
.date-input::-ms-clear,
.date-input::-ms-reveal {
    display: none;
}

/* Additional browser compatibility */
.date-input::-webkit-inner-spin-button,
.date-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox specific styling */
@-moz-document url-prefix() {
    .date-input {
        padding: 12px 16px 12px 42px;
    }
}

/* Ensure date input works in modal context */
.input-with-icon .date-input {
    padding-left: 42px;
}

.input-with-icon .date-input:focus+.input-icon,
.input-with-icon .date-input:hover+.input-icon {
    color: var(--primary-color);
}

/* Responsive adjustments for date inputs */
@media (max-width: 768px) {
    .date-input {
        padding: 14px 16px 14px 42px;
        font-size: 14px;
        /* Prevents zoom on iOS */
    }
}

#timePickerModal .modal-content {
    max-width: 320px !important;
    width: 90% !important;
}

#timePickerModal .time-picker-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#timePickerModal .time-display {
    text-align: center;
    padding: 12px !important;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    border-radius: 12px !important;
    color: white !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 15px rgba(112, 123, 229, 0.3) !important;
}

#timePickerModal .time-period {
    font-size: 1.2rem;
    opacity: 0.9;
}

#timePickerModal .time-selector {
    display: flex !important;
    justify-content: space-between !important;
    gap: 10px !important;
}

#timePickerModal .time-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#timePickerModal .time-column label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#timePickerModal .time-scroll {
    height: 150px !important;
    overflow-y: auto !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    background: white !important;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

#timePickerModal .time-scroll::-webkit-scrollbar {
    width: 6px;
}

#timePickerModal .time-scroll::-webkit-scrollbar-track {
    background: transparent;
}

#timePickerModal .time-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

#timePickerModal .time-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color-dark);
}

#timePickerModal .time-option {
    padding: 8px 12px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    border-bottom: 1px solid var(--border-color) !important;
}

#timePickerModal .time-option:last-child {
    border-bottom: none;
}

#timePickerModal .time-option:hover {
    background: var(--primary-color-light);
    color: var(--primary-color);
}

#timePickerModal .time-option.selected {
    background: var(--primary-color) !important;
    color: white !important;
    font-weight: 600 !important;
}

#timePickerModal .time-picker-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    padding-top: 15px !important;
    border-top: 1px solid var(--border-color) !important;
}

/* Responsive adjustments for time picker */
@media (max-width: 480px) {
    #timePickerModal .modal-content {
        width: 95%;
        margin: 20px;
    }

    #timePickerModal .time-display {
        font-size: 1.3rem;
        padding: 10px;
    }

    #timePickerModal .time-selector {
        gap: 8px;
    }

    #timePickerModal .time-scroll {
        height: 120px;
    }

    #timePickerModal .time-option {
        padding: 6px 8px;
        font-size: 14px;
    }
}

/* ==========================================
   DATE PICKER MODAL STYLES
   ========================================== */

#datePickerModal .modal-content {
    max-width: 320px !important;
    width: 90% !important;
}

#datePickerModal .date-picker-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#datePickerModal .date-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

#datePickerModal .date-nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-light);
    border-radius: 6px;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#datePickerModal .date-nav-btn:hover {
    background: var(--primary-color);
    color: white;
}

#datePickerModal .date-picker-month-year {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

#datePickerModal .date-picker-calendar {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

#datePickerModal .calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

#datePickerModal .calendar-weekdays div {
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
}

#datePickerModal .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

#datePickerModal .calendar-day {
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}

#datePickerModal .calendar-day:hover {
    background: var(--primary-color-light);
    color: var(--primary-color);
}

#datePickerModal .calendar-day.selected {
    background: var(--primary-color) !important;
    color: white !important;
    font-weight: 600 !important;
}

#datePickerModal .calendar-day.today {
    background: var(--secondary-color);
    color: white;
    font-weight: 600;
}

#datePickerModal .calendar-day.disabled {
    cursor: not-allowed;
    color: var(--text-light);
    opacity: 0.45;
    background: transparent !important;
    pointer-events: none;
}

#datePickerModal .calendar-day.disabled:hover {
    background: transparent;
    color: var(--text-light);
}

#datePickerModal .calendar-day.empty {
    cursor: default;
    background: transparent;
}

#datePickerModal .calendar-day.empty:hover {
    background: transparent;
    color: var(--text-light);
}

#datePickerModal .date-picker-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    padding-top: 15px !important;
    border-top: 1px solid var(--border-color) !important;
    margin-bottom: 20px;
}

/* Responsive adjustments for date picker */
@media (max-width: 480px) {
    #datePickerModal .modal-content {
        width: 95%;
        margin: 20px;
    }

    #datePickerModal .calendar-day {
        padding: 6px 2px;
        font-size: 13px;
        min-height: 32px;
    }

    #datePickerModal .calendar-weekdays div {
        padding: 6px 2px;
        font-size: 11px;
    }
}

/* Date picker wheel styles */
.date-picker-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
}

.date-picker-sidebar {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    padding: 10px 0;
}

.date-picker-main {
    flex: 1;
}

/* Scrollable wheel containers */
.month-list,
.year-list {
    width: 120px;
    height: 50px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #cbd5e1;
    border-radius: 30px;
    padding: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    scrollbar-width: none;
    position: relative;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Hide default scrollbar */
.month-list::-webkit-scrollbar,
.year-list::-webkit-scrollbar {
    display: none;
}

/* Center highlight indicator */
.month-list::before,
.year-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(37, 99, 235, 0.06);
    border-top: 2px solid #2563eb;
    border-bottom: 2px solid #2563eb;
    border-radius: 28px;
    pointer-events: none;
    z-index: 10;
}

.sidebar-item {
    min-height: 50px;
    height: 50px;
    width: 100%;
    padding: 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
    opacity: 0.4;
}

.sidebar-item:hover {
    color: #64748b;
    opacity: 0.6;
}

.sidebar-item.selected {
    color: #2563eb;
    font-weight: 700;
    font-size: 16px;
    opacity: 1;
}

/* Hide the old header completely */
.date-picker-header {
    display: none;
}

/* Make sure calendar stays usable on small screens */
@media (max-width: 700px) {
    .date-picker-sidebar {
        gap: 20px;
    }

    .month-list,
    .year-list {
        width: 100px;
        height: 45px;
    }

    .sidebar-item {
        min-height: 45px;
        height: 45px;
        font-size: 14px;
    }

    .sidebar-item.selected {
        font-size: 15px;
    }
}

/* Tier and Membership Badges */
.tier-badge {
    font-size: 0.72rem;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.tier-silver { 
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); 
    color: #4b5563; 
    border: 1px solid #d1d5db; 
}
.tier-gold { 
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%); 
    color: #92400e; 
    border: 1px solid #fbbf24; 
}
.tier-platinum { 
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%); 
    color: #334155; 
    border: 1px solid #94a3b8; 
}
.tier-diamond { 
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%); 
    color: #0369a1; 
    border: 1px solid #7dd3fc; 
    box-shadow: 0 2px 8px rgba(3, 105, 161, 0.2);
}
.tier-none { 
    background: #f9fafb; 
    color: #9ca3af; 
    border: 1px solid #e5e7eb; 
    box-shadow: none;
    opacity: 0.8;
}
