/* TechCafe Booking - New Version - Main CSS */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    min-height: 100vh;
    font-family: Arial, sans-serif;
}

/* Master Container */
.container {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    
    /* 16:9 aspect ratio constraint */
    max-width: calc((100vh - 40px) * 16 / 9);
    margin: 0 auto;
}

/* Date Selector */
.date-selector {
    padding: 10px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0; /* Prevent shrinking */
}

.date-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
}

.date-tab {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-weight: 500;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    font-size: 0.95rem;
    text-align: left;
    letter-spacing: 0.02em;
    color: #374151;
}

.date-tab:hover {
    border-color: #dc2626;
    transform: translateY(-2px);
}

.date-tab.active {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* Smart touch support for date tabs */
.date-tab {
    touch-action: manipulation; /* Optimize for touch interactions */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); /* Subtle tap feedback */
}

/* Booking Grid Container */
.booking-grid {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding: 0;
    margin: 0;
    position: relative; /* Required for absolute positioning of child elements */
    /* Height will be calculated by JavaScript */
}

/* Hide scrollbar completely when no overflow */
.booking-grid {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.booking-grid::-webkit-scrollbar {
    display: none; /* WebKit browsers (Chrome, Safari, Edge) */
}

/* Time Section Styles */
.time-section {
    margin-bottom: 0;
    padding: 5px 0px;
}

.section-header {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

.section-title {
    background: white;
    padding: 5px 20px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #dc2626;
    display: inline-block;
    position: relative;
    z-index: 2;
}

.section-divider {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    z-index: 1;
}

/* Lunch Break Styles */
.lunch-break {
    text-align: center;
    margin: 5px 0;
    padding: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    border: 2px dashed #cbd5e1;
    width: 100%;
    box-sizing: border-box;
}

.lunch-break-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lunch-break i {
    font-size: 1.2rem;
    color: #64748b;
}

.lunch-break-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    margin: 0;
}

/* Time Slots Grid */
.time-slots-grid {
    display: grid;
    gap: 8px;
    padding: 0 0px 10px 0px;
    margin: 0;
}

.time-slot {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 10x;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #374151;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-slot:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.time-slot.booked {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
    cursor: not-allowed;
}

.time-slot.available {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

/* Smart touch support - prevent accidental scrolling on interactive elements */
.time-slot {
    touch-action: manipulation; /* Optimize for touch interactions */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); /* Subtle tap feedback */
}

/* Portrait Mode - 3 columns for morning (3 rows), 3 columns for afternoon (4 rows) */
@media (orientation: portrait) {
    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Landscape Mode - 5 columns for morning (2 rows), 5 columns for afternoon (3 rows) */
@media (orientation: landscape) {
    .time-slots-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Content area - fixed layout */
.content-area {
    display: flex;
    flex-direction: column;
    flex: 1; /* Take remaining space after header */
    overflow: hidden; /* No scrolling on content area */
    min-height: 0; /* Important for flex child */
}

/* Header */
.header {
    position: relative;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 20px 150px 18px;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.header h1 {
    font-size: 2.4rem; /* Updated to match base h1 */
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

.assistant-launch {
    display: block;
    width: auto;
    min-width: 12.5rem;
    max-width: 15.25rem;
    margin: 12px auto 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    border-radius: 999px;
    outline-offset: 5px;
    transform: translateY(0);
    filter: drop-shadow(0 12px 0 rgba(104, 8, 15, 0.42))
            drop-shadow(0 18px 24px rgba(80, 0, 8, 0.36));
    animation: assistantPulseArt 2.8s ease-in-out infinite;
    transition: transform 160ms ease, filter 160ms ease;
}

.assistant-launch:hover,
.assistant-launch:focus-visible {
    transform: translateY(-3px) scale(1.015);
    filter: drop-shadow(0 14px 0 rgba(104, 8, 15, 0.42))
            drop-shadow(0 24px 30px rgba(80, 0, 8, 0.42));
}

.assistant-launch:active {
    transform: translateY(5px) scale(0.99);
    filter: drop-shadow(0 5px 0 rgba(104, 8, 15, 0.48))
            drop-shadow(0 10px 16px rgba(80, 0, 8, 0.34));
}

.assistant-launch img {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    user-select: none;
    pointer-events: none;
    background: transparent;
    image-rendering: auto;
    filter: saturate(1.06) contrast(1.04)
            drop-shadow(0 -2px 2px rgba(255, 255, 255, 0.3))
            drop-shadow(0 2px 1px rgba(60, 0, 5, 0.2));
    transition: filter 160ms ease, opacity 160ms ease;
}

/* Locked: real grey PNG is swapped in via JS; stop motion only */
.assistant-launch.is-disabled,
.assistant-launch:disabled {
    cursor: not-allowed;
    animation: none !important;
    transform: none !important;
}

.assistant-launch.is-disabled:hover,
.assistant-launch.is-disabled:focus-visible,
.assistant-launch:disabled:hover,
.assistant-launch:disabled:focus-visible,
.assistant-launch.is-disabled:active,
.assistant-launch:disabled:active {
    transform: none !important;
}

@keyframes assistantPulseArt {
    0%, 100% {
        filter: drop-shadow(0 12px 0 rgba(104, 8, 15, 0.42))
                drop-shadow(0 18px 24px rgba(80, 0, 8, 0.36));
    }
    50% {
        filter: drop-shadow(0 13px 0 rgba(104, 8, 15, 0.46))
                drop-shadow(0 24px 32px rgba(80, 0, 8, 0.46));
    }
}

.assistant-panel {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
}

.assistant-panel.open {
    display: block;
}

.assistant-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.44);
    backdrop-filter: blur(3px);
}

.assistant-panel-card {
    position: absolute;
    top: 28px;
    right: 28px;
    bottom: 28px;
    width: min(430px, calc(100vw - 56px));
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(17, 24, 39, 0.34);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.assistant-panel-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
}

.assistant-panel-eyebrow {
    margin: 0 0 2px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: none;
    opacity: 0.82;
}

.assistant-panel-header h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.15;
}

.assistant-panel-close {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 160ms ease, transform 160ms ease;
}

.assistant-panel-close:hover {
    background: rgba(255, 255, 255, 0.26);
    transform: translateY(-1px);
}

.assistant-frame-shell {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #ffffff;
}

.assistant-panel iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.assistant-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 18%, rgba(225, 29, 46, 0.10), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #fff7f7 100%);
}

.assistant-fallback[hidden] {
    display: none;
}

.assistant-fallback-card {
    width: min(100%, 320px);
    text-align: center;
    padding: 24px 20px;
    border: 1px solid #fee2e2;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 42px rgba(145, 16, 28, 0.14);
}

.assistant-fallback-kicker {
    margin: 0 0 8px;
    color: #b91c1c;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.assistant-fallback-card h3 {
    margin: 0;
    color: #8f111d;
    font-size: 1.32rem;
    line-height: 1.15;
}

.assistant-fallback-card p:not(.assistant-fallback-kicker) {
    margin: 12px 0 18px;
    color: #6b1f28;
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 600;
}

.assistant-fallback-button,
.assistant-fallback-retry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.assistant-fallback-button {
    min-height: 46px;
    padding: 12px 18px;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 48%, #b91c1c 100%);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(220, 38, 38, 0.28);
}

.assistant-fallback-retry {
    margin-top: 10px;
    min-height: 40px;
    border: 0;
    background: transparent;
    color: #991b1b;
    font-family: inherit;
    font-size: 0.92rem;
}

/* Button Styles */
.admin-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.admin-btn.admin-active {
    background: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.admin-btn.admin-active:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

.kiosk-btn.kiosk-active {
    background: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.kiosk-btn.kiosk-active:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

/* Kiosk Mode Button Styles */
.kiosk-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.kiosk-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.kiosk-btn.kiosk-active {
    background: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.kiosk-btn.kiosk-active:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

/* Portrait Mode Button Effects */
@media (orientation: portrait) {
    .header {
        padding: 18px 84px 16px;
    }

    .assistant-launch {
        max-width: 15rem;
        margin-top: 10px;
    }

    .assistant-panel-card {
        top: 18px;
        right: 18px;
        bottom: 18px;
        left: 18px;
        width: auto;
        border-radius: 16px;
    }

    .kiosk-btn, .admin-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
    
    .kiosk-btn span, .admin-btn span {
        display: none;
    }
    
    .kiosk-btn i, .admin-btn i {
        font-size: 1.2rem;
        margin: 0;
    }
}

/* Portrait Mode + Phone Device - Smaller Buttons */
@media (orientation: portrait) {
    .device-phone .header {
        padding: 14px 56px 12px;
    }

    .device-phone .assistant-launch {
        min-width: 10.75rem;
        max-width: 12.25rem;
        margin-top: 8px;
    }

    .device-phone .assistant-panel-card {
        inset: 10px;
        border-radius: 14px;
    }

    .device-phone .assistant-panel-header {
        padding: 12px 14px;
    }

    .device-phone .assistant-panel-header h2 {
        font-size: 1.1rem;
    }

    .device-phone .assistant-panel-close {
        width: 36px;
        height: 36px;
    }

    .device-phone .kiosk-btn, 
    .device-phone .admin-btn {
        width: 35px;
        height: 35px;
        top: 12px;
    }
    
    .device-phone .kiosk-btn {
        left: 12px;
    }
    
    .device-phone .admin-btn {
        right: 12px;
    }
    
    .device-phone .kiosk-btn i, 
    .device-phone .admin-btn i {
        font-size: 0.9rem;
    }
}

/* Footer */
.footer-section {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: calc(100vw - 40px);
    max-width: calc((100vh - 40px) * 16 / 9);
    margin: 0 auto;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 0 0 20px 20px;
    overflow: hidden;
}

.footer-content {
    padding: 12px 20px;
    text-align: center;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.footer-scroll-text {
    display: inline-block;
    padding-right: 100%;
    animation: scroll-simple 45s linear infinite;
    animation-timing-function: linear;
    will-change: transform;
}

@keyframes scroll-simple {
    0% {
        transform: translateX(100%);
    }
    50% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.footer-content small {
    color: white;
    font-size: 0.9rem;
}

/* Debug Screen */
.debug-screen {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    z-index: 9999;
    min-width: 200px;
    display: none;
    border: 1px solid #333;
}

.debug-screen.show {
    display: block;
}

.debug-screen h4 {
    margin: 0 0 8px 0;
    color: #ffff00;
    font-size: 14px;
}

.debug-screen .debug-item {
    margin: 2px 0;
}

.debug-screen .debug-label {
    color: #00ffff;
    font-weight: bold;
}

.debug-screen .debug-value {
    color: #ffffff;
}

/* Debug Screen Responsive Width */
.debug-screen {
    max-width: 300px; /* Desktop max width */
}

/* Pad Device Debug Width */
.device-pad .debug-screen {
    max-width: 280px;
    right: 15px;
}

/* Phone Device Debug Width */
.device-phone .debug-screen {
    max-width: 250px;
    right: 10px;
    font-size: 11px;
    padding: 8px;
}

/* Debug Toggle Button */
.debug-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    z-index: 10000;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.debug-toggle:hover {
    opacity: 1;
}

/* Phone Device Styles */
.device-phone .date-tabs {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
}

.device-phone .date-tab {
    flex: 1;
    min-width: 0;
    padding: 6px 12px;
    font-size: 0.85rem;
    height: 30px;
}

.device-phone .time-slots-grid {
    grid-template-columns: repeat(3, 1fr) !important; /* Force 3 columns on phone */
}

.device-phone .time-slot {
    height: 64.1px; /* 449px ÷ 7 slots = 64.1px per slot */
}

.device-phone .time-text {
    font-size: 0.9rem;
}

.device-phone .section-title {
    font-size: 1rem;
}

@media (orientation: portrait) {
    .time-slots {
        grid-template-columns: repeat(3, 1fr) !important; /* Force 3 columns in portrait */
        gap: 1px !important; /* Ultra-minimal gap for portrait */
    }
    
    .time-slot {
        padding: 8px;
        height: 64.1px; /* 449px ÷ 7 slots = 64.1px per slot */
    }
    
    .date-tab {
        padding: 6px 12px;
        font-size: 0.85rem;
        height: 30px;
    }
}

@media (orientation: landscape) {
    .time-slots {
        grid-template-columns: repeat(5, 1fr) !important; /* Force 5 columns in landscape */
    }
    
    .time-slot {
        padding: 12px;
        height: 64.1px; /* 449px ÷ 7 slots = 64.1px per slot */
    }
}

/* Device-Specific Font Overrides */

/* Pad Device Font Sizes */
.device-pad h1 {
    font-size: 1.8rem;
}

.device-pad p {
    font-size: 1.1rem;
}

/* Phone Device Font Sizes */
.device-phone h1 {
    font-size: 1.3rem;
}

.device-phone p {
    font-size: 0.8rem;
}

/* Phone Portrait Mode - Smaller font for section title */
.device-phone .section-title {
    font-size: 1rem;
}

/* Phone Mode - Reduce spacing between time and "Booked" text */
.device-phone .time-slot.booked > div:last-child {
    margin-top: 0px !important;
}

/* Desktop Device - Larger legend icon and text */
.device-desktop .legend-box {
    width: 28px !important;
    height: 28px !important;
    border-width: 2px;
}

.device-desktop .legend-item {
    font-size: 1.1rem !important;
    gap: 10px;
}

/* Desktop Device Font Sizes - Larger font for timeslots */
/* Free slots (only one div) - use larger font */
.device-desktop .time-slot > div:only-child {
    font-size: 1.3rem !important; /* Slot time for free slots */
}

/* Booked slots - time (first div) */
.device-desktop .time-slot > div:first-child:not(:only-child) {
    font-size: 1.3rem !important; /* Slot time (e.g., 10:45) */
}

/* Booked slots - status/name (last div, but not only child) */
/* Ensure identical font size for "Booked" text in Desktop mode for both admin and non-admin */
/* Target all possible combinations to ensure consistency */
.device-desktop .time-slot.booked > div:last-child,
.device-desktop .time-slot.booked > div:nth-child(2),
.device-desktop .time-slot > div:last-child:not(:only-child) {
    font-size: 1.1rem !important; /* Slot status (e.g., "Booked") or display name - Desktop only */
}

/* Slot Legend Styles - Fixed position */
.slot-legend {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 20px;
    background: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0; /* Prevent shrinking */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #374151;
}

/* Legend text handling */
.legend-text {
    display: inline-block;
}

.legend-short {
    display: none;
}

/* Show short text in portrait mode on phone */
.device-phone .legend-full {
    display: none;
}
.device-phone .legend-short {
    display: inline;
}

.legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #e5e7eb;
}

.legend-box.available {
    background: linear-gradient(135deg, #18abec 0%, #18abec 100%);
    border-color: #0284c7;
}

.legend-box.booked {
    background: linear-gradient(135deg, #f15151 0%, #f15151 100%);
    border-color: #b91c1c;
}

.legend-box.time-past {
    background: linear-gradient(to right, #8cd5f6 0%, #8cd5f6 50%, #f8a9a9 50%, #f8a9a9 100%);
    border-color: #64748b;
    opacity: 1;
    position: relative;
}

.legend-box.my-booking {
    background: linear-gradient(135deg, #f15151 0%, #f15151 100%);
    border: 3px solid #00ff00;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
    position: relative;
}

.legend-box.my-booking::before {
    content: '★';
    position: absolute;
    top: -6px;
    right: -6px;
    background: #00ff00;
    color: black;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    z-index: 1;
}

/* Date Selector Styles - Fixed position */

.date-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
}

.date-tab {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-weight: 500;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    font-size: 0.95rem;
    text-align: left;
    letter-spacing: 0.02em;
}

.date-tab:hover {
    border-color: #dc2626;
    transform: translateY(-2px);
}

.date-tab.active {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* Booking Grid Styles - Scrollable time slots only */
.booking-grid {
    padding: 5px 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Only time slots area scrolls */
    min-height: 0; /* Important for flex child to be scrollable */
    flex: 1; /* Take up remaining space */
}

.time-section:last-child {
    margin-bottom: 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3px;
    position: relative;
    flex-shrink: 0; /* Prevent section headers from shrinking */
}

.section-title {
    background: white;
    padding: 5px 20px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #dc2626;
    display: inline-block;
    position: relative;
    z-index: 2;
}

.section-divider {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
    z-index: 1;
}

/* Lunch Break Styles - Fixed position */
.lunch-break {
    text-align: center;
    margin: 0;
    padding: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    border: 2px dashed #cbd5e1;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0; /* Prevent shrinking */
}

.lunch-break-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lunch-break i {
    font-size: 1.2rem;
    color: #64748b;
}

.lunch-break-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    margin: 0;
}

/* Time Slots Grid - Default Landscape (5 columns) */
.time-slots {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px; /* Ultra-minimal gap for tight layout */
    width: 100%;
    margin: 0;
}

/* Individual Time Slot */
.time-slot {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    height: 64.1px; /* 449px ÷ 7 slots = 64.1px per slot */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Completed indicator circle in top left corner */
.time-slot .completed-indicator {
    position: absolute !important;
    top: 6px !important;
    left: 6px !important;
    width: 8px;
    height: 8px;
    background-color: #dc2626; /* Red color for completed without closure */
    border-radius: 50%;
    z-index: 10 !important; /* Higher than text divs (z-index: 2) to ensure it's on top */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    pointer-events: none; /* Don't interfere with slot clicks */
    margin: 0 !important; /* Remove any flexbox margins */
    flex: none !important; /* Don't participate in flexbox layout */
}

.time-slot:hover {
    border-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.15);
}

/* Booked slot styles - matching old version gradient red */
.time-slot.booked {
    background: linear-gradient(135deg, #f15151 0%, #f15151 100%);
    border-color: #b91c1c;
    cursor: not-allowed;
    position: relative;
}

.time-slot.booked:hover {
    border-color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    transform: none;
    box-shadow: none;
}

/* New booking highlight: fade from darker red to normal over 5s */
.time-slot.booked.just-booked {
    animation: bookedFadeIn 5s ease-out forwards;
}

@keyframes bookedFadeIn {
    0% {
        background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    }
    20% {
        background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
    }
    40% {
        background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    }
    60% {
        background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    }
    80% {
        background: linear-gradient(135deg, #f15151 0%, #f15151 100%);
    }
    100% {
        background: linear-gradient(135deg, #f15151 0%, #f15151 100%);
    }
}

/* User's own booking - fluorescent green border with star icon */
.time-slot.booked.my-device {
    border: 3px solid #00ff00 !important;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
    position: relative;
}

.time-slot.booked.my-device::before {
    content: '★';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #00ff00;
    color: black;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.time-slot.booked.my-device:hover {
    border-color: #00ff00 !important;
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.8);
}

/* Booked slots - simple gradient red, no animation */

.time-slot.available {
    background: linear-gradient(135deg, #18abec 0%, #18abec 100%);
    border-color: #0284c7;
}

.time-slot.booked {
    background: linear-gradient(135deg, #f15151 0%, #f15151 100%);
    border-color: #b91c1c;
    cursor: pointer;
}

.time-slot.time-past {
    /* Background color is set by JavaScript */
    border-color: #94a3b8 !important; /* Medium border for past slots */
    color: #1f2937 !important; /* Dark text for contrast on lighter medium background */
    opacity: 1 !important; /* Full opacity to show colors clearly */
    position: relative;
}

/* Current slot */
.time-slot.time-current {
    position: relative;
    cursor: pointer !important; /* Allow booking - pointer cursor */
}

/* Current slots can still be hovered and clicked */
.time-slot.time-current:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.15) !important;
    border-color: #dc2626 !important;
}

.time-slot.time-past.booked {
    /* Background color is set by JavaScript */
    border-color: #ef4444 !important; /* Medium red border */
    color: #1f2937 !important; /* Dark text for readability on medium red */
    opacity: 1 !important; /* Full opacity */
    position: relative;
}

.time-text {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.booked-text {
    font-size: 0.85rem;
    color: #991b1b;
    font-weight: 500;
}

/* Date Selector */
.date-selector {
    padding: 10px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0; /* Prevent shrinking */
}

.date-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
}

.date-tab {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-weight: 500;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    font-size: 0.95rem;
    text-align: left;
    letter-spacing: 0.02em;
    color: #374151;
}

.date-tab:hover {
    border-color: #dc2626;
    transform: translateY(-2px);
}

.date-tab.active {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}
