/**
 * AbhiHub — 04_layout.css
 * Container, section, bottom navbar, public navbar, footer,
 * search overlay, PWA install popup, overlay system.
 * Depends on: 01_tokens.css, 02_base.css
 */

/* ════════════════════════════════════════
   CONTAINERS
   ════════════════════════════════════════ */
.container {
    width: 100%;
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}
.container-sm { max-width: 800px; }
.container-lg { max-width: 1400px; }

.section        { padding: var(--space-12) 0; }
.section-title  {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--primary-600);
    margin-bottom: var(--space-6);
    text-align: center;
}
.section-header {
    margin-bottom: var(--space-6);
}
.section-header h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-2) 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.section-header h2::before {
    content: '';
    width: 4px; height: 24px;
    background: var(--gradient-primary);
    border-radius: 2px;
    flex-shrink: 0;
}
.section-header p {
    color: var(--text-secondary);
    font-size: var(--text-base);
    margin: 0;
}

@media (max-width: 768px) {
    .container { padding: 0 var(--space-4); }
    .section   { padding: var(--space-8) 0; }
    .section-header h2 { font-size: var(--text-xl); }
}

/* ════════════════════════════════════════
   BOTTOM NAVBAR (authenticated)
   ════════════════════════════════════════ */
.navbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    border-radius: 24px 24px 0 0;
    position: fixed;
    left: 50%; bottom: 0;
    transform: translateX(-50%);
    z-index: 1000;
    width: 100vw;
    max-width: 600px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s;
}
.navbar::after {
    content: '';
    width: 120px;
    background: var(--gray-300);
    position: absolute;
    bottom: 8px; left: 50%;
    height: 3px;
    transform: translateX(-50%);
    opacity: 0.7;
    pointer-events: none;
    border-radius: var(--radius-full);
}
.navbar.hide-navbar {
    transform: translateX(-50%) translateY(100%);
    opacity: 0.2;
    pointer-events: none;
}

.navbar__item {
    width: auto; min-width: 64px; height: 64px;
    position: relative;
    cursor: pointer;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 20px;
    color: var(--primary-500);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    background: transparent;
}
.navbar__item:hover  { background: rgba(59,130,246,0.05); }
.navbar__item:active { transform: scale(0.95); }
.navbar__item--active {
    background: linear-gradient(145deg, rgba(59,130,246,0.12), rgba(37,99,235,0.05));
    border-radius: 12px;
}
.navbar__item--active .icon        { fill: var(--primary-600); transform: scale(1.1); }
.navbar__item--active .navbar__label { color: var(--primary-600); font-weight: 700; }

.navbar__label {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
    line-height: 1;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
}

.navbar__icon {
    display: inline-block;
    position: relative; z-index: 2;
    transition: all 0.5s cubic-bezier(0.71,0.03,0.23,0.95);
    transition-delay: 0.1s;
}

/* FAB — center upload button */
.navbar__item--fab { position: relative; overflow: visible; }
.navbar__item--fab .navbar__icon--fab {
    background: var(--gradient-primary);
    padding: 12px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
    transition: all var(--transition-fast);
    display: flex; align-items: center; justify-content: center;
}
.navbar__item--fab .navbar__icon--fab .icon { fill: white; width: 20px; height: 20px; }
.navbar__item--fab:hover .navbar__icon--fab {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}

/* Notification dot */
.notification-dot {
    position: absolute; top: -2px; right: -2px;
    width: 10px; height: 10px;
    background: linear-gradient(135deg, var(--accent-red), #dc2626);
    border-radius: 50%;
    border: 2px solid var(--surface);
    display: none;
    animation: pulse 2s infinite;
}
.notification-dot.show { display: block; }

.icon {
    display: inline-block;
    width: 1em; height: 1em;
    stroke-width: 0;
    stroke: currentColor;
    fill: currentColor;
}

/* Mobile floating nav */
@media (max-width: 768px) {
    .navbar {
        justify-content: space-evenly;
        padding: 10px 12px 12px;
        background: rgba(255,255,255,0.85);
        backdrop-filter: blur(25px);
        border: 1px solid rgba(255,255,255,0.4);
        border-radius: 24px;
        bottom: 20px;
        width: calc(100% - 32px);
        max-width: 400px;
        box-shadow: 0 15px 35px rgba(0,0,0,0.15), 0 5px 15px rgba(0,0,0,0.05);
    }
    .navbar__item {
        width: auto; height: auto;
        padding: 6px 10px;
        flex: 1;
        border-radius: 16px;
    }
    .navbar__item--fab {
        margin-top: -35px;
        overflow: visible;
    }
    .navbar__item--fab .navbar__icon--fab {
        width: 54px; height: 54px;
        border: 4px solid rgba(255,255,255,0.9);
        padding: 0;
    }

    @keyframes fabPulse {
        0%   { transform: scale(1); }
        50%  { transform: scale(1.08); }
        100% { transform: scale(1); }
    }
    .navbar__item--fab .navbar__icon--fab { animation: fabPulse 2s infinite; }
}

@media (min-width: 768px) {
    .navbar { max-width: 500px; bottom: 20px; border-radius: 30px; padding: 10px 40px 15px; }
}
@media (min-width: 1024px) {
    .navbar { max-width: 420px; bottom: 30px; border-radius: 30px; padding: 10px 60px 15px; }
}

/* ════════════════════════════════════════
   SEARCH OVERLAY
   ════════════════════════════════════════ */
.nav-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(15px);
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}
.nav-search-overlay.show { display: flex; }

.nav-search-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    max-width: 700px;
    margin: 0 auto;
    height: 100%;
    width: 100%;
}
.nav-search-field {
    width: 100%; max-width: 480px;
    font-size: var(--text-lg);
    padding: var(--space-4);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    outline: none;
    background: var(--surface);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-primary);
}
.nav-search-field:focus {
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12), 0 6px 20px rgba(37,99,235,0.18);
    transform: translateY(-2px);
}
.nav-search-btn {
    font-size: var(--text-xl);
    padding: var(--space-4) var(--space-6);
    border: 2px solid var(--primary-600);
    border-radius: var(--radius-xl);
    background: var(--gradient-primary);
    color: var(--text-inverse);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-blue-md);
    font-weight: 600;
}
.nav-search-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-blue-lg);
}
.nav-search-close-btn {
    font-size: var(--text-xl);
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 50%;
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    font-weight: 600;
}
.nav-search-close-btn:hover {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: var(--text-inverse);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .nav-search-overlay { padding: var(--space-6); }
    .nav-search-field   { font-size: var(--text-base); padding: var(--space-3) var(--space-4); }
    .nav-search-btn     { font-size: var(--text-lg); padding: var(--space-3) var(--space-5); }
    .nav-search-close-btn { width: 44px; height: 44px; }
}
@media (max-width: 480px) {
    .nav-search-overlay { padding: var(--space-4); }
    .nav-search-field   { font-size: var(--text-sm); }
    .nav-search-close-btn { width: 40px; height: 40px; }
}

/* PWA install popup styles live in pipeline/pwa-install.css */

/* ════════════════════════════════════════
   FOOTER (public pages)
   ════════════════════════════════════════ */
.site-footer {
    background: var(--gray-600);
    color: var(--text-inverse);
    font-family: var(--font-primary);
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
}
.site-footer a { color: var(--text-inverse); text-decoration: none; margin: 0 5px; }
.site-footer a:hover { text-decoration: underline; color: var(--text-inverse); }
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-4);
}

@media (max-width: 600px) {
    .footer-inner { flex-direction: column; padding: 0; gap: var(--space-2); }
}

/* Feature tour styles live in pipeline/feature-tour.css */

/* ════════════════════════════════════════
   PRINT
   ════════════════════════════════════════ */
@media print {
    .navbar, .skip-nav, header { display: none !important; }
    main { margin: 0; padding: 0; }
}
