/* ===============================================
   SERVICES & BOOKING — Premium Glass Design v3
   =============================================== */

/* --- Page Background --- */
.services-page, .booking-page {
    min-height: calc(100vh - 72px);
    background: linear-gradient(135deg, #F4F4F2 0%, #EDEDED 100%);
    position: relative;
}

/* Ambient light fields behind glass */
.booking-page::before,
.booking-page::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.booking-page::before {
    width: 600px; height: 600px;
    top: -100px; right: -150px;
    background: radial-gradient(circle, rgba(255,255,255,0.5) 0%, transparent 70%);
    filter: blur(40px);
}
.booking-page::after {
    width: 500px; height: 500px;
    bottom: -50px; left: -100px;
    background: radial-gradient(circle, rgba(180,180,180,0.15) 0%, transparent 70%);
    filter: blur(30px);
}

/* ===============================================
   SERVICE CARDS
   =============================================== */
.services-list { display: flex; flex-direction: column; gap: 1.25rem; }

.service-card {
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(20px) saturate(110%);
    -webkit-backdrop-filter: blur(20px) saturate(110%);
    border: 1px solid rgba(255,255,255,0.5);
    border-top: 1px solid rgba(255,255,255,0.7);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.32);
}

.service-image-wrapper { height: 180px; overflow: hidden; }
.service-image { width: 100%; height: 100%; object-fit: cover; }
.service-image-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.05), rgba(0,0,0,0.02));
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--color-text-muted); opacity: 0.5;
}
.service-info { padding: 1.5rem !important; }
.price-display { font-size: 1.5rem; font-weight: 700; color: var(--color-text); }

/* ===============================================
   BOOKING CALENDAR — Premium Glass v3
   =============================================== */
.booking-calendar-card {
    position: relative; z-index: 1;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(28px) saturate(125%);
    -webkit-backdrop-filter: blur(28px) saturate(125%);
    border: 1px solid rgba(255,255,255,0.55);
    border-top: 1px solid rgba(255,255,255,0.8);
    border-radius: 28px;
    /* Added comfortable internal padding */
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04),
                inset 0 1px 0 rgba(255,255,255,0.7);
    overflow: hidden;
}

/* Header strip inside card — accounts for parent padding */
.card-header-glass {
    background: rgba(255,255,255,0.12);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    margin: -2rem -2rem 1.5rem -2rem;
    padding: 1.25rem 2rem !important;
}
.card-header-glass h2 { color: var(--color-text); font-size: 1.125rem; }
.card-header-glass p { color: var(--color-text-muted); font-size: 0.8125rem; margin-top: 0.25rem; }

/* Selected date chip in header */
.selected-date-chip {
    background: rgba(var(--primary-rgb, 44,62,80), 0.1);
    border: 1px solid rgba(var(--primary-rgb, 44,62,80), 0.2);
    border-radius: 20px;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
}

/* Calendar navigation */
.calendar-nav {
    display: flex; align-items: center; justify-content: center; gap: 1.5rem;
    margin-bottom: 1.25rem;
}
.nav-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.15);
    color: var(--color-text);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    backdrop-filter: blur(8px);
}
.nav-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
    transform: scale(1.05);
}
#currentMonth {
    font-size: 1.1rem;
    min-width: 160px;
    text-align: center;
}

/* Weekday headers */
.calendar-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem; margin-bottom: 0.75rem;
}
.calendar-weekdays .weekday {
    text-align: center; font-size: 0.7rem; font-weight: 600;
    color: var(--color-text-muted); padding: 0.5rem 0;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.weekday-jomeh { color: #dc2626 !important; }

/* Calendar grid wrapper */
.calendar-grid-wrapper {
    padding: 0.5rem 0;
}

/* Calendar grid — 7 columns, square cells */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.375rem;
    position: relative; z-index: 1;
    min-height: 320px;
}

/* Day buttons */
.calendar-day {
    aspect-ratio: 1 / 1;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: var(--color-text);
    font-size: 0.9rem; font-weight: 500;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
    position: relative; overflow: hidden;
}
.calendar-day::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.15), transparent);
    border-radius: 12px 12px 0 0; pointer-events: none;
}
.calendar-day:hover:not(:disabled):not(.booked) {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.calendar-day:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.calendar-day.empty { background: transparent; border: none; cursor: default; pointer-events: none; }
.calendar-day.today {
    background: rgba(234,179,8,0.12); border-color: rgba(234,179,8,0.4);
    color: #a16207; font-weight: 700;
}
.calendar-day.selected {
    background: var(--color-text); border-color: var(--color-text);
    color: white; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.calendar-day.selected::before { background: linear-gradient(180deg,rgba(255,255,255,0.2),transparent); }
.calendar-day.available {
    background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.3); color: #16a34a;
}
.calendar-day.booked {
    background: rgba(0,0,0,0.04); color: var(--color-text-muted);
    opacity: 0.5; cursor: not-allowed;
}
.calendar-day.booked:hover { transform: none; box-shadow: none; }
.calendar-day:disabled { opacity: 0.4; cursor: not-allowed; }

/* Legend */
.calendar-legend {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 1rem !important;
    margin-top: 0.5rem;
}
.legend-items {
    display: flex; flex-wrap: wrap; gap: 1.25rem;
}
.legend-item {
    display: flex; align-items: center; gap: 0.375rem;
    font-size: 0.75rem; color: var(--color-text-muted);
}
.dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.dot.available-dot { background: rgba(34,197,94,0.7); }
.dot.selected-dot { background: var(--color-text); }
.dot.booked-dot { background: rgba(0,0,0,0.2); }
.dot.today-dot { background: rgba(234,179,8,0.8); }

/* ===============================================
   TIME SLOTS CARD
   =============================================== */
.time-slots-card {
    position: relative; z-index: 1;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(28px) saturate(125%);
    -webkit-backdrop-filter: blur(28px) saturate(125%);
    border: 1px solid rgba(255,255,255,0.55);
    border-top: 1px solid rgba(255,255,255,0.8);
    border-radius: 28px;
    /* Added comfortable internal padding */
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04),
                inset 0 1px 0 rgba(255,255,255,0.7);
    overflow: hidden;
}

/* Loading spinner */
.spinner-glow {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--color-text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Alert states */
.alert-empty {
    text-align: center; padding: 2rem 1rem;
    color: var(--color-text-muted);
    background: rgba(255,255,255,0.08);
    border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.3);
}
.alert-error {
    text-align: center; padding: 2rem 1rem;
    color: #dc2626;
    background: rgba(220,38,38,0.05);
    border-radius: 16px;
    border: 1px solid rgba(220,38,38,0.2);
}

/* Time slots grid */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.875rem;
}

/* Time slot button */
.time-slot {
    padding: 1rem 0.75rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 14px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    position: relative; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.time-slot::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.6), transparent);
}
.time-slot:hover:not(:disabled) {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.7);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.time-slot:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.time-slot.selected {
    background: var(--color-text);
    border-color: var(--color-text);
    color: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.time-slot.selected::before { background: linear-gradient(90deg,rgba(255,255,255,0.3),transparent); }
.time-slot:disabled { opacity: 0.5; cursor: not-allowed; }
.slot-time {
    font-weight: 600; font-size: 0.95rem; display: block;
    letter-spacing: 0.02em;
}

/* Finalize button area */
.finalize-area { text-align: center; padding-top: 1rem; }
.finalize-btn {
    background: linear-gradient(135deg, var(--color-text) 0%, #3d5163 100%);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    position: relative; overflow: hidden;
}
.finalize-btn::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg,rgba(255,255,255,0.15),transparent);
    border-radius: inherit; pointer-events: none;
}
.finalize-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.finalize-btn:disabled {
    background: rgba(0,0,0,0.15);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* ===============================================
   RESPONSIVE
   =============================================== */
@media (max-width: 768px) {
    .booking-calendar-card,
    .time-slots-card {
        padding: 1.25rem;
        border-radius: 20px;
    }
    .card-header-glass {
        margin: -1.25rem -1.25rem 1rem -1.25rem;
        padding: 1rem 1.25rem !important;
    }
    
    .calendar-grid {
        min-height: 240px;
        gap: 0.25rem;
    }
    .calendar-weekdays .weekday {
        font-size: 0.6rem;
        padding: 0.375rem 0;
    }
    .calendar-day {
        font-size: 0.8rem;
        border-radius: 8px;
    }
    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.625rem;
    }
    .time-slot { padding: 0.75rem 0.5rem; }
    .slot-time { font-size: 0.8rem; }
    
    .selected-date-chip {
        margin-top: 0.75rem;
        width: 100%;
        text-align: center;
    }
}

/* ===============================================
   REDUCED MOTION
   =============================================== */
@media (prefers-reduced-motion: reduce) {
    .calendar-day, .time-slot, .nav-btn {
        transition: none;
    }
    .calendar-day:hover, .time-slot:hover, .nav-btn:hover {
        transform: none;
    }
    .spinner-glow { animation: none; border-color: transparent; border-top-color: var(--color-text); }
}
