/* =========================================================
   layout.css  -  shared site chrome:
   header, directory dropdown, mobile drawer, pill tabs, footers
   ========================================================= */

html, body {
    overflow-x: hidden;
    width: 100%;
}

/* ---- Announcement bar ---- */
.top-notice-bar {
    background: #1e3a8a;
    color: #dbeafe;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    text-align: center;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
}
.top-notice-bar span {
    background: #f59e0b;
    color: #000000;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 800;
    margin-right: 0.4rem;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
    width: 100%;
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: -0.5px;
    white-space: nowrap;
}
.brand span {
    color: var(--text-primary);
}
.nav-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.header-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-pill-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}
.nav-pill-link:hover, .nav-pill-link.active {
    color: var(--primary);
    background: var(--primary-light);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.mobile-toggle-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-primary);
    cursor: pointer;
}
.menu-dropdown-wrapper {
    position: relative;
}
.category-dropdown-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 320px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1050;
}
.category-dropdown-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-grid {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 340px;
    overflow-y: auto;
}
.dropdown-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
}
.dropdown-cat-item-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.dropdown-cat-item-info i {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 6px;
    font-size: 0.85rem;
}
.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1998;
}
.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    background: #ffffff;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.mobile-drawer.active {
    transform: translateX(0);
}
.drawer-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.drawer-close-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.drawer-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}
.drawer-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}
.drawer-link i {
    width: 22px;
    color: var(--primary);
    font-size: 1rem;
}
.drawer-link:hover, .drawer-link.active {
    background: var(--primary-light);
    color: var(--primary);
}
.member-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.6rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}
.member-nav::-webkit-scrollbar {
    display: none;
}
.member-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.88rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}
.member-nav a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---- Small shared helpers used by the header/drawer ---- */
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}
.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
}
.btn-logout {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid #fecaca;
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
}
.btn-logout:hover {
    background: #fee2e2;
}
.badge-admin {
    background: var(--warning);
    color: #fff;
    border: none;
    font-size: 0.65rem;
    padding: 0.2rem 0.45rem;
}
.menu-caption {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    padding-left: 0.5rem;
}
.drawer-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.dropdown-cat-item:hover {
    background: var(--bg-main);
}

/* ---- Simple footer (member & admin pages, inner public pages) ---- */
.footer-simple {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    background: #ffffff;
}

/* ---- Full footer (public pages) ---- */
.footer-multi-col {
    background: #0f172a;
    color: #94a3b8;
    padding: 4rem 1.5rem 2rem;
    margin-top: 5rem;
    border-top: 1px solid #1e293b;
    box-sizing: border-box;
    width: 100%;
}
.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    text-align: left;
}
.footer-grid h4 {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.footer-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.footer-grid a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.88rem;
}
.footer-grid a:hover {
    color: #38bdf8;
}
.footer-bottom-line {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding-top: 1.25rem;
    border-top: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.footer-multi-col .brand span {
    color: #ffffff;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .header-links, .desktop-only {
        display: none !important;
    }
    .mobile-toggle-btn {
        display: inline-flex;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .dashboard-container {
        padding: 0 0.85rem !important;
        margin: 1.25rem auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .header-inner {
        padding: 0.5rem 0.75rem;
    }
    .brand {
        font-size: 1.15rem;
    }
    .nav-menu-btn span {
        display: none;
    }
    .nav-menu-btn {
        padding: 0.45rem 0.6rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
    .footer-bottom-line {
        flex-direction: column;
        text-align: center;
    }
}

.brand span.badge-admin {
    color: #ffffff;
}
