/* TechCafe Booking - Main CSS */

* {
    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;
}

.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;
    max-width: calc((100vh - 40px) * 16 / 9);
    margin: 0 auto;
}

.date-selector {
    padding: 10px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.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;
    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;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

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

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

.content-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.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;
    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;
}

.assistant-launch img {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    user-select: none;
    pointer-events: none;
    background: transparent;
    image-rendering: auto;
}

.assistant-launch.is-disabled,
.assistant-launch:disabled {
    cursor: not-allowed;
}

.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;
}

.admin-btn,
.kiosk-btn {
    position: absolute;
    top: 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 {
    right: 20px;
}

.kiosk-btn {
    left: 20px;
}

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

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

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

@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;
    }

    .date-tab {
        padding: 6px 12px;
        font-size: 0.85rem;
        height: 30px;
    }

    .time-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .time-slot {
        padding: 8px;
    }

    .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;
    }
}

@media (orientation: landscape) {
    .time-slots-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.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;
    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 {
    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;
    max-width: 300px;
    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;
}

.device-pad .debug-screen {
    max-width: 280px;
    right: 15px;
}

.device-phone .debug-screen {
    max-width: 250px;
    right: 10px;
    font-size: 11px;
    padding: 8px;
}

.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;
}

.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;
}

.device-phone .time-slot {
    height: 64.1px;
}

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

.device-phone .time-slot.booked > div:last-child {
    margin-top: 0 !important;
}

.device-pad h1 {
    font-size: 1.8rem;
}

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

.device-phone h1 {
    font-size: 1.3rem;
}

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

.device-desktop .legend-box {
    width: 28px !important;
    height: 28px !important;
    border-width: 2px;
}

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

.device-desktop .time-slot > div:only-child,
.device-desktop .time-slot > div:first-child:not(:only-child) {
    font-size: 1.3rem !important;
}

.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-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;
}

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

.legend-text {
    display: inline-block;
}

.legend-short {
    display: none;
}

.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: #18abec;
    border-color: #0284c7;
}

.legend-box.booked {
    background: #f15151;
    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: #f15151;
    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;
}

.booking-grid {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding: 5px 20px;
    margin: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.booking-grid::-webkit-scrollbar {
    display: none;
}

.time-section {
    margin-bottom: 0;
    padding: 5px 0;
}

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

.section-header {
    text-align: center;
    margin-bottom: 3px;
    position: relative;
    flex-shrink: 0;
}

.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 {
    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;
}

.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 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 0 0 10px;
    margin: 0;
}

.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;
    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;
    touch-action: manipulation;
}

.time-slot .completed-indicator {
    position: absolute !important;
    top: 6px !important;
    left: 6px !important;
    width: 8px;
    height: 8px;
    background-color: #dc2626;
    border-radius: 50%;
    z-index: 10 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    margin: 0 !important;
    flex: none !important;
}

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

.time-slot.booked {
    background: #f15151;
    border-color: #b91c1c;
    cursor: pointer;
}

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

.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%, 100% { background: #f15151; }
}

.time-slot.booked.my-device {
    border: 3px solid #00ff00 !important;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
}

.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);
}

.time-slot.available {
    background: #18abec;
    border-color: #0284c7;
}

.time-slot.time-past {
    border-color: #94a3b8 !important;
    color: #1f2937 !important;
    opacity: 1 !important;
}

.time-slot.time-current {
    cursor: pointer !important;
}

.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 {
    border-color: #ef4444 !important;
    color: #1f2937 !important;
    opacity: 1 !important;
}
