/* ============================================================
   Jolly Oasis – Responsive Stylesheet
   ============================================================ */

/* ── Tablet (≤ 1024px) ──────────────────────────────────────── */
@media (max-width: 1024px) {
    .joa-browse-layout {
        grid-template-columns: 190px 1fr;
    }
    .joa-talent-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .joa-sidebar { width: 190px; min-width: 190px; }
    .joa-dash-content { margin-left: 190px; }
    .joa-stats-row { grid-template-columns: repeat(3, 1fr); }
}

/* ── Mobile Landscape / Tablet Portrait (≤ 768px) ───────────── */
@media (max-width: 768px) {
    /* Auth / Registration */
    .joa-auth-body { padding: 24px 16px 40px; }
    .joa-role-grid { grid-template-columns: 1fr; gap: 12px; }
    .joa-role-card { padding: 20px 16px; display: flex; align-items: center; gap: 14px; text-align: left; }
    .joa-role-card .joa-role-icon { margin: 0; flex-shrink: 0; width: 44px; height: 44px; }
    .joa-stepper { gap: 0; }
    .joa-step { padding: 6px 12px 10px; font-size: 11px; }

    /* Browse — bottom-sheet filter on mobile */
    .joa-browse-layout { grid-template-columns: 1fr; }

    /* Filter panel becomes a bottom sheet */
    .joa-browse-filters {
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto !important;
        width: 100% !important;
        max-height: 82vh;
        border-radius: 20px 20px 0 0 !important;
        border: none !important;
        border-top: 1px solid var(--jd-border) !important;
        padding: 0 20px 28px !important;
        z-index: 200;
        overflow-y: auto;
        transform: translateY(110%);
        transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    }
    .joa-browse-filters.open {
        transform: translateY(0);
    }

    /* Show handle bar inside the sheet */
    .joa-sheet-handle-wrap { display: flex; }

    /* Backdrop */
    .joa-filter-mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.6);
        z-index: 199;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s;
    }
    .joa-filter-mobile-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Show filter trigger button */
    .joa-filter-mobile-btn { display: inline-flex !important; }

    /* Stack filter actions vertically for mobile sheet */
    .joa-filter-actions { position: sticky; bottom: 0; background: var(--jd-card); padding-top: 12px; margin: 0 -20px; padding-left: 20px; padding-right: 20px; padding-bottom: 4px; }
    .joa-browse-content { padding: 16px; }
    .joa-talent-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .joa-browse-hero { padding: 36px 16px; }
    .joa-browse-hero h1 { font-size: 20px; }

    /* Dashboard sidebar → slide-out drawer */
    .joa-sidebar {
        transform: translateX(-100%);
        z-index: 150;
        width: 260px;
        min-width: 260px;
    }
    .joa-sidebar.mobile-open { transform: translateX(0); }
    .joa-dash-content { margin-left: 0 !important; }
    .joa-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.6);
        z-index: 149;
    }
    .joa-sidebar-backdrop.open { display: block; }
    .joa-topbar { padding: 0 16px; }
    .joa-mobile-menu-btn {
        display: flex !important;
        align-items: center;
        background: none;
        border: none;
        color: var(--jd-muted);
        font-size: 22px;
        cursor: pointer;
        margin-right: 12px;
        padding: 4px;
    }
    .joa-dash-inner { padding: 16px; }
    .joa-stats-row { grid-template-columns: repeat(2, 1fr); }
    .joa-welcome-banner { flex-direction: column; text-align: center; }
    .joa-profile-header { flex-direction: column; align-items: flex-start; }
    .joa-profile-header-left { flex-direction: column; align-items: flex-start; }
    .joa-portfolio-grid { grid-template-columns: repeat(2, 1fr); }
    .joa-similar-grid { grid-template-columns: repeat(2, 1fr); }
    .joa-profile-actions { width: 100%; flex-direction: column; }
    .joa-profile-actions .joa-btn { width: 100%; }

    /* Inbox mobile layout (full rules, incl. the list↔chat toggle) live in
       joa-main.css's ≤767px block — duplicating conflicting height/max-height
       values here fought that layout and stranded the message input mid-screen
       with dead space below it. */

    /* Profile tabs scroll */
    .joa-tabs { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .joa-tab { padding: 10px 16px; font-size: 13px; }

    /* Modal full-screen on mobile */
    .joa-overlay { padding: 0; align-items: flex-end; }
    .joa-modal {
        max-width: 100%;
        width: 100%;
        max-height: 92vh;
        border-radius: var(--joa-radius) var(--joa-radius) 0 0;
    }
}

/* ── Small Mobile (≤ 480px) ──────────────────────────────────── */
@media (max-width: 480px) {
    .joa-talent-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .joa-talent-card-body { padding: 12px; }
    .joa-talent-card-name { font-size: 13px; }
    .joa-stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
    .joa-stat-card { padding: 14px; }
    .joa-stat-val { font-size: 20px; }
    .joa-browse-hero h1 { font-size: 17px; }
    .joa-auth-title { font-size: 21px; }
    .joa-step { font-size: 10px; padding: 4px 8px 8px; }
    .joa-d-table { font-size: 13px; }
    .joa-d-table td, .joa-d-table th { padding: 10px 8px; }
    .joa-d-btn { padding: 8px 14px; font-size: 12px; }
    .joa-portfolio-grid { grid-template-columns: repeat(2, 1fr); }
    .joa-similar-grid { grid-template-columns: repeat(2, 1fr); }
    .joa-notif-panel { width: calc(100vw - 20px); right: -60px; }
    .joa-role-grid { grid-template-columns: 1fr; }
    .joa-featured-item { min-width: 180px; }
    .joa-pw-rules { gap: 6px; }
    .joa-pw-rule { font-size: 11px; padding: 5px 10px; }
    .joa-booking-form-wrap { padding: 20px 16px; }
}

/* ── Show/hide helpers ──────────────────────────────────────── */
.joa-mobile-only { display: none !important; }
.joa-desktop-only { display: flex; }
.joa-mobile-menu-btn { display: none !important; }
.joa-filter-mobile-btn { display: none !important; }

@media (max-width: 768px) {
    .joa-mobile-only { display: flex !important; }
    .joa-desktop-only { display: none !important; }
    /* Show filter button on mobile — must be after the global display:none above */
    .joa-filter-mobile-btn { display: inline-flex !important; }
    /* Show clear-filters link on mobile */
    .joa-mobile-clear-filters { display: inline !important; }
}

/* ── Print ──────────────────────────────────────────────────── */
@media print {
    .joa-sidebar, .joa-topbar, .joa-notif-panel,
    .joa-chat-input-row, .joa-d-btn { display: none !important; }
    .joa-dash-content { margin-left: 0 !important; }
}
