/*
 * responsive.css — FDCC Mobile Responsive Pass
 * Created: Batch 14 — Mobile + Polish
 *
 * Breakpoints:
 *   ≤ 1100px — right panel collapses, toggle button appears
 *   ≤  768px — both side panels hidden, bottom tab bar active
 *   ≤  480px — compact layouts, full-width inputs
 *
 * Depends on: all other CSS files (must load last).
 * Zero hardcoded colors — CSS vars only.
 */

/* ============================================================
   ≤ 1100px — RIGHT PANEL COLLAPSES
   ============================================================ */
@media (max-width: 1100px) {

    /* Right panel: hidden by default, slides in from right */
    #lf-panel-right {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 350;
        width: 300px;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: rgba(2, 11, 18, 0.97);
        border-left: 1px solid var(--cyan-alpha-20);
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.50);
        overflow-y: auto;
        padding-bottom: 80px; /* space for bottom bar on mobile */
    }

    #lf-panel-right.lf-panel-open {
        transform: translateX(0);
    }

    /* Toggle button — top-right of workspace */
    #lf-right-panel-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 72px;
        right: 16px;
        z-index: 300;
        width: 36px;
        height: 36px;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-full);
        color: var(--text-secondary);
        cursor: pointer;
        font-size: var(--text-sm);
        transition: all 0.18s ease;
        box-shadow: var(--glass-shadow);
    }

    #lf-right-panel-toggle:hover {
        background: var(--glass-bg-hover);
        border-color: var(--cyan-alpha-30);
        color: var(--cyan-500);
        box-shadow: var(--glow-cyan-sm);
    }

    /* Center panel expands to fill */
    #lf-panel-center {
        flex: 1;
    }

    /* Snapshot strip: allow wrapping at this breakpoint */
    .lf-snapshot__tiles {
        flex-wrap: wrap;
    }

    .lf-kpi-tile {
        min-width: 120px;
        flex: 1 1 120px;
    }
}

/* ============================================================
   ≤ 768px — FULL MOBILE LAYOUT
   Side panels hidden, bottom tab bar active
   ============================================================ */
@media (max-width: 768px) {

    /* Sidebar: off-canvas left */
    #lf-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 400;
        width: 280px !important;
        transform: translateX(-100%);
        background: rgba(2, 11, 18, 0.98);
        border-right: 1px solid var(--cyan-alpha-20);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.60);
        padding-bottom: 80px;
    }

    body.lf-state-intel  #lf-sidebar,
    body.lf-state-workspace #lf-sidebar {
        transform: translateX(-100%); /* still hidden until toggled */
        opacity: 1;
    }

    #lf-sidebar.lf-sidebar-open {
        transform: translateX(0) !important;
    }

    /* Left panel: off-canvas */
    #lf-panel-left {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 300;
        width: 280px;
        transform: translateX(-100%);
        background: rgba(2, 11, 18, 0.98);
        border-right: 1px solid var(--cyan-alpha-20);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.60);
        padding-bottom: 80px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #lf-panel-left.lf-panel-open {
        transform: translateX(0);
    }

    /* Right panel: off-canvas right */
    #lf-panel-right {
        padding-bottom: 80px;
    }

    /* Center panel: full width */
    #lf-panel-center {
        width: 100%;
        min-width: 0;
        flex: 1;
    }

    /* Top bar: hide tool tabs, keep logo + actions */
    .lf-topbar-tabs {
        display: none;
    }

    /* Top bar: tighter layout */
    #lf-topbar {
        padding: 0 14px;
        gap: 10px;
    }

    /* Address chip: shorter */
    .lf-address-chip {
        max-width: 180px;
    }

    .lf-topbar__wordmark {
        display: none;
    }

    /* Strategy switcher: horizontal scroll */
    #lf-strategy {
        overflow-x: auto;
        scrollbar-width: none;
        padding: 0 12px;
        -webkit-overflow-scrolling: touch;
    }

    #lf-strategy::-webkit-scrollbar {
        display: none;
    }

    .lf-strategy-tab {
        flex-shrink: 0;
        padding: 0 14px;
    }

    /* Snapshot strip: single row, horizontal scroll, larger tiles */
    #lf-snapshot {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .lf-snapshot__tiles {
        flex-wrap: nowrap;
    }

    .lf-kpi-tile {
        min-width: 160px;
        flex-shrink: 0;
        flex-wrap: nowrap;
    }

    .lf-snapshot__confidence {
        flex-shrink: 0;
    }

    /* App frame: stack vertically on mobile */
    #lf-app-frame {
        flex-direction: column;
    }

    /* Shell content takes all space */
    #lf-shell-content {
        flex: 1;
        width: 100%;
        overflow: hidden;
        padding-bottom: 60px; /* bottom tab bar height */
    }

    /* ============================================================
       BOTTOM TAB BAR
       Fixed glassmorphism bar: Properties · Analysis · Outputs · Notes
       ============================================================ */
    #lf-bottom-tabs {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 500;
        height: 58px;
        background: var(--surface-dark);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--glass-border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.50);
    }

    .lf-bottom-tab {
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        color: var(--text-dim);
        cursor: pointer;
        transition: color 0.18s ease;
        padding: 8px 4px;
        font-family: var(--font-heading);
        font-size: 9px;
        font-weight: var(--weight-semibold);
        letter-spacing: var(--tracking-wide);
        text-transform: uppercase;
        border-top: 2px solid transparent;
    }

    .lf-bottom-tab i {
        font-size: var(--text-md);
        margin-bottom: 1px;
    }

    .lf-bottom-tab:hover {
        color: var(--text-muted);
    }

    .lf-bottom-tab.lf-bottom-tab--active {
        color: var(--cyan-500);
        border-top-color: var(--cyan-500);
    }

    /* Hide bottom tabs in landing state */
    body.lf-state-landing #lf-bottom-tabs {
        display: none;
    }

    /* Overlay backdrop for open panels on mobile */
    #lf-mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 299;
        background: rgba(2, 11, 18, 0.70);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    #lf-mobile-overlay.lf-overlay-visible {
        display: block;
    }
}

/* ============================================================
   ≤ 480px — COMPACT LAYOUT
   ============================================================ */
@media (max-width: 480px) {

    /* Landing search: full width */
    .lf-landing__search-wrap {
        max-width: 100%;
    }

    .lf-landing__search-input {
        font-size: var(--text-base);
    }

    .lf-landing__search-btn span {
        display: none; /* icon only */
    }

    .lf-landing__headline {
        font-size: var(--text-2xl);
    }

    .lf-landing__subheadline {
        font-size: var(--text-xs);
    }

    /* Property intel: single column at this width */
    .pi-report-grid {
        grid-template-columns: 1fr;
    }

    .pi-risk-cols {
        grid-template-columns: 1fr;
    }

    /* Calculator surfaces: reduce padding */
    .lf-calc-card,
    .glass-card,
    .glass-dark {
        padding: 14px 14px;
    }

    .lf-calc-row {
        grid-template-columns: 1fr;
    }

    .lf-calc-row--3 {
        grid-template-columns: 1fr 1fr;
    }

    .lf-calc-outputs-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Snapshot tiles: tighter */
    .lf-kpi-tile {
        min-width: 120px;
        padding: 8px 12px;
    }

    .lf-kpi-tile__value {
        font-size: var(--text-base);
    }

    /* Top bar compact */
    #lf-topbar {
        padding: 0 10px;
    }

    .lf-topbar__actions {
        gap: 6px;
    }

    /* Avatar: icon only */
    .lf-avatar-name {
        display: none;
    }

    /* Address chip: minimal */
    .lf-address-chip__text {
        display: none;
    }

    /* Surface zones: stack */
    .lf-surface-zones {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   TOUCH IMPROVEMENTS — all breakpoints
   ============================================================ */
@media (hover: none) {
    /* Remove hover effects that feel sticky on touch */
    .lf-kpi-tile:hover,
    .lf-panel-card:hover,
    .glass-card:hover,
    .glass-dark:hover {
        background: initial;
        border-color: initial;
        box-shadow: initial;
        transform: none;
    }

    /* Larger tap targets for buttons */
    .lf-strategy-tab,
    .lf-bottom-tab,
    .lf-topbar-tab {
        min-height: 44px;
    }
}
