/**
 * DARQO Real Estate OS — Master Mobile Responsive & Shell Stylesheet
 * Ultra-Luxury Modern Dark Architecture (#0B0B0B) with Matte Gold (#DEC087 / #C5A059).
 * Fluid Responsive Rules for 320px–768px Viewports.
 */

/* ── 1. Scrollbars & Swipe Tracks ── */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ── 2. Responsive Table Wrapper ── */
.darqo-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 1rem;
}
.darqo-table-responsive > table {
    min-width: 680px;
}

/* ── 3. Global Mobile Responsive Directives (< 1024px) ── */
@media (max-width: 1023px) {
    /* Fluid Mobile Clearance so bottom docks & floating buttons never obscure content */
    body:not(.search-cockpit-page) {
        padding-bottom: 7rem !important; /* pb-28 equivalent */
        overflow-x: hidden !important;
    }

    main, .main-content-scroll, #tab-overview {
        padding-bottom: 4rem !important;
    }

    /* Standardized Floating AI Button on Mobile */
    #darqoAIFloatingBtn,
    .darqo-floating-ai-btn,
    button[onclick="toggleAIDrawer()"] {
        position: fixed !important;
        bottom: 5.25rem !important; /* bottom-20 (above 4rem bottom dock) */
        left: 1rem !important;      /* left-4 */
        right: auto !important;
        z-index: 40 !important;
        padding: 0.5rem 0.875rem !important;
        font-size: 0.75rem !important;
        line-height: 1rem !important;
        border-radius: 9999px !important;
        background: rgba(7, 43, 38, 0.96) !important;
        border: 1px solid rgba(248, 226, 164, 0.4) !important;
        color: #DEC087 !important;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 0 15px rgba(197, 160, 89, 0.35) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }

    /* Mobile Header Standards */
    header.darqo-mobile-unified-header,
    header {
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
    }

    /* Slide-down Mobile Search Bar */
    #darqoMobileSearchOverlay {
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    }
    #darqoMobileSearchOverlay.hidden {
        display: none !important;
        opacity: 0;
        transform: translateY(-8px);
    }

    /* Hide desktop inline search bars in header on mobile */
    .darqo-desktop-search-wrap,
    #globalJourneySearchWrap,
    #globalDashSearchWrap,
    .topbar-desktop-search {
        display: none !important;
    }

    /* Prevent words breaking mid-word */
    .voice-listen-btn,
    .voice-listen-txt,
    .journey-step-badge,
    #topbarPill,
    .nowrap-mobile {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* Search.html mobile unlock & pb-28 clearance */
    body.search-cockpit-page,
    .search-cockpit-page html,
    .search-cockpit-page .app-shell,
    .search-cockpit-page .chat-workspace,
    .search-cockpit-page .conversation {
        height: auto !important;
        min-height: 100vh !important;
        max-height: none !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
    }
    .search-cockpit-page .chat-workspace,
    .search-cockpit-page .conversation {
        padding-bottom: 7rem !important; /* pb-28: 112px clearance for bottom chat input dock */
    }

    /* Toast Box safe positioning on mobile */
    #toastBox, .toast {
        top: 5rem !important;
        bottom: auto !important;
        left: 50% !important;
        transform: translate(-50%, 0) !important;
        z-index: 80 !important;
        white-space: nowrap !important;
    }

    /* Module Tabs in search.html */
    .cycle-tabs-container {
        display: flex !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
        gap: 0.625rem !important;
        padding: 0.5rem 1rem !important;
        scroll-snap-type: x mandatory !important;
    }
    .cycle-tab-btn {
        flex-shrink: 0 !important;
        min-width: 165px !important;
        scroll-snap-align: start !important;
    }

    /* Hide desktop-only controls in search.html */
    .stepper-mode-group,
    #btnFullscreen {
        display: none !important;
    }

    /* Journey Stepper Horizontal Row */
    #journeyStepperWrap .journey-info {
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        white-space: nowrap !important;
    }

    /* BOQ / BOM responsive tables */
    table.boq-table,
    table.bom-table,
    table.data-table {
        min-width: 680px !important;
    }
}
