/* Prevent flash of unauthenticated content on mobile/PWA */
@media (max-width: 1100px) {
    body:not(.no-sidebar) .app:not(.ready) { opacity: 0; }
    body:not(.no-sidebar) .app.ready { opacity: 1; transition: opacity 0.15s; }
}
/* ================================================
   responsive.css - Tablet & Mobile adaptations
   Strategy: Force landscape orientation on tablets/phones
   Desktop layout works as-is in landscape (1024px+ wide)
   Created: 2026-03-14
   ================================================ */

/* ------------------------------------------------
   PORTRAIT ORIENTATION OVERLAY
   "Please rotate your device"
   Shown on screens <= 980px when in portrait mode
   ------------------------------------------------ */
.rotate-device-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--panel, #1a1a1e);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    flex-direction: column;
    gap: 20px;
}
.rotate-device-overlay .rotate-icon {
    width: 80px;
    height: 80px;
    animation: rotateHint 2s ease-in-out infinite;
}
@keyframes rotateHint {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-30deg); }
    75% { transform: rotate(90deg); }
}
.rotate-device-overlay h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold, #d4b24e);
    margin: 0;
}
.rotate-device-overlay p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted, #999);
    margin: 0;
    max-width: 320px;
}

/* Show overlay: portrait + narrow screen (tablet/phone) */
@media (max-width: 1100px) and (orientation: portrait) {
    .rotate-device-overlay { display: flex !important; }
    /* Hide everything else */
    body:not(.no-sidebar) .app,
    body:not(.no-sidebar) .main,
    #sidebarHost,
    .burger-btn { visibility: hidden; }
}

/* ------------------------------------------------
   LOGO AS MENU TOGGLE (tablet/phone <= 980px)
   The RESTO ONE logo becomes the menu open/close button
   The fullscreen button is hidden
   No separate burger button needed
   ------------------------------------------------ */
.burger-btn {
    display: none;
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 310;
    width: 38px;
    height: 38px;
    border: 1px solid var(--gold-border, rgba(180,150,80,0.3));
    border-radius: 8px;
    background: var(--panel);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    padding: 0;
}
.burger-btn:hover { background: var(--line); }
/* Hide when sidebar is open */
#sidebarHost.open ~ .burger-btn,
body:has(#sidebarHost.open) .burger-btn { display: none !important; }

/* Sidebar overlay backdrop */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 299;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ------------------------------------------------
   LANDSCAPE TABLET/PHONE: <= 980px + landscape
   Sidebar becomes slide-out drawer, rest stays desktop
   ------------------------------------------------ */
@media (max-width: 1100px) and (orientation: landscape) {
    .app { grid-template-columns: 1fr !important; }

    /* Show logo menu button */
    .burger-btn { display: flex; }

    /* Hide fullscreen button on tablet/mobile */
    .svc-fullscreen-btn { display: none !important; }

    /* Logo becomes menu toggle */
    .svc-brand { cursor: pointer; }
    .svc-brand-logo { transition: transform 0.2s; }
    .svc-brand:hover .svc-brand-logo { transform: scale(1.1); }

    #sidebarHost {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 300;
        transition: left 0.3s ease;
        overflow-y: auto;
        scrollbar-width: none;
    }
    #sidebarHost::-webkit-scrollbar { display: none; }
    #sidebarHost.open { left: 0; }

    .main { padding: 52px 16px 16px 16px; }

    /* Modals: remove min-width constraints */
    .ro-modal { min-width: 0 !important; }
    .ro-modal.schedule { min-width: 0 !important; }
}

/* ------------------------------------------------
   ROOM PLAN: Desktop-only warning (tablet landscape too)
   ------------------------------------------------ */
.roomplan-mobile-warning {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    color: var(--text);
}
.roomplan-mobile-warning .warning-content { max-width: 400px; }
.roomplan-mobile-warning .warning-icon { font-size: 48px; margin-bottom: 16px; }
.roomplan-mobile-warning h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--gold);
}
.roomplan-mobile-warning p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
    margin-bottom: 20px;
}
.roomplan-mobile-warning .warning-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--gold);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}
@media (max-width: 1100px) {
    /* Edit mode only: block tablet/mobile for the 2D editor */
    body.is-edit-mode .roomplan-mobile-warning { display: flex; }
}
/* ------------------------------------------------
   LANDSCAPE TABLET/PHONE: what the width actually affords
   Loaded last, so these win over the same selectors elsewhere.
   ------------------------------------------------ */
@media (max-width: 1100px) and (min-width: 701px) and (orientation: landscape) {
    /* Three columns of 260px, each holding a label and a value side by side,
       is not a layout. Two is what 844px affords. Below 701px modal.css already
       drops to one, and this range stops short of it rather than fighting it. */
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) and (orientation: landscape) {
    /* The header carries a logo, a name and four capsules. Without wrapping
       they crush each other instead of taking a second line. */
    .rst-header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 16px;
    }
    .rst-header-info { min-width: 0; }
    .rst-header-sub { justify-content: flex-start; }
}

/* ------------------------------------------------
   SHORT VIEWPORTS
   A phone in landscape is 390px tall. Also a short desktop window, which wants
   the same thing.
   ------------------------------------------------ */
@media (max-height: 560px) {
    /* 85vh of 390px is 331px, and the chrome ate 130 of it in padding before
       any content appeared. The frame was sized as a fraction of a screen
       assumed to be tall. */
    .ro-modal {
        height: 94vh;
        max-height: 94vh;
    }
    .ro-modal-head { padding: 9px 16px; }
    .ro-modal-body { padding: 10px 16px; }
    .ro-modal-foot { padding: 9px 16px; }

    /* The banner sits over a top bar that is now a large share of the screen.
       Same sentence, less of it. */
    .sub-banner {
        padding: 5px 12px;
        gap: 8px;
        font-size: 12px;
    }
}
