/* ==========================================================================
   LAYOUT — App Shell, Navigation, Header, Breakpoints
   Practice Hub · Academic Command Center
========================================================================== */

/* ── App Layout (Mobile First) ── */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }

/* Sidebar hidden on mobile, replaced by bottom nav */
.sidebar { display: none; }

.main-content { 
    flex: 1; display: flex; flex-direction: column; min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-ht) + 20px); /* Leave room for bottom nav */
}

/* ── Sticky Top Header ── */
.top-header {
    height: var(--header-height); padding: 0 1.25rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    background: rgba(5,5,8,0.75); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border);
}
.hub-title { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.hub-title i { color: var(--indigo-light); }

.global-search-container { flex: 1; max-width: 400px; position: relative; }
.global-search-container i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-secondary); }
.global-search-input { padding-left: 2.5rem; border-radius: 99px; background: var(--bg-card); height: 44px; min-height: 44px; border: 1px solid var(--border); transition: border-color 0.2s;}
.global-search-input:focus { border-color: var(--indigo-light); box-shadow: 0 0 10px var(--indigo-glow); }
.global-search-results {
    position: absolute; top: calc(100% + 0.5rem); left: 0; right: 0;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
    max-height: 300px; overflow-y: auto; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,0.5); display: none;
}
.global-search-results.active { display: block; }
.search-res-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle); cursor: pointer; min-height: 48px; }
.search-res-item:last-child { border-bottom: none; }
.search-res-item:hover { background: var(--bg-card-2); }

/* ── Bottom Tab Bar (Mobile) ── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-ht);
    background: rgba(10, 10, 16, 0.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border); display: flex; justify-content: space-around; align-items: center; z-index: 90;
    padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1; height: 100%; color: var(--text-secondary); font-size: 0.65rem; font-weight: 600; gap: 0.25rem;
}
.bnav-item i { font-size: 1.25rem; transition: transform 0.2s; }
.bnav-item.active { color: var(--indigo-light); }
.bnav-item.active i { transform: translateY(-3px); text-shadow: 0 0 10px var(--indigo-glow); }

/* ── Page Sections ── */
.page-section { display: none; padding: 1.5rem 1rem; animation: fadeIn 0.3s ease; }
.page-section.active { display: block; }

/* ── Section Header ── */
.section-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-bottom: 1.25rem;
}

/* ── Shared Nav Menu (Sidebar & Mobile More) ── */
.nav-menu { flex: 1; padding: 0 1rem; display: flex; flex-direction: column; gap: 0.5rem; overflow-y: auto; list-style: none; margin: 0;}
.nav-item { display: flex; align-items: center; gap: 1rem; padding: 0.875rem 1.25rem; border-radius: var(--radius-md); font-size: 0.95rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; border: 1px solid transparent; transition: all 0.2s ease; }
.nav-item i { font-size: 1.2rem; width: 24px; text-align: center; transition: 0.2s;}
.nav-item:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-item:hover i { transform: scale(1.1); color: var(--indigo-light); }
.nav-item.active { background: var(--bg-card-2); border-color: var(--border); color: var(--indigo-light); box-shadow: 0 4px 20px rgba(0,0,0,0.2); }

/* ==========================================================================
   RESPONSIVE — Layout Breakpoints
========================================================================== */

/* ── Tablet (768px+) ── */
@media (min-width: 768px) {
    .amo-body { padding: 3rem; }
    .amo-question { font-size: 2rem; }
}

/* ── Desktop (1024px+) ── */
@media (min-width: 1024px) {
    .bottom-nav { display: none; }
    .sidebar { 
        display: flex; width: var(--sidebar-width); background: rgba(10, 10, 16, 0.75); backdrop-filter: blur(24px);
        border-right: 1px solid var(--border); position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; flex-direction: column;
    }
    .sidebar-header { padding: 2rem 1.5rem; }
    .logo { display: flex; align-items: center; gap: 0.75rem; }
    .logo-icon { width: 36px; height: 36px; background: var(--grad-indigo); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; color: white; box-shadow: 0 4px 12px var(--indigo-glow); }
    .logo-name { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
    .logo-suffix { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--indigo-light); }
    
    .main-content { margin-left: var(--sidebar-width); padding-bottom: 0; }
    .top-header { padding: 0 2rem; }
    .page-section { padding: 2rem; max-width: 1200px; margin: 0 auto; width: 100%;}
}
