/**
 * CS Quest - Responsive Layout & Mobile Bottom Navigation Bar
 */

/* Header & Desktop Nav */
.cs-site-header {
    background: var(--cs-surface);
    border-bottom: 1px solid var(--cs-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.cs-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.cs-site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cs-text);
    text-decoration: none;
}

.cs-brand-icon {
    font-size: 1.8rem;
}

.cs-primary-nav {
    display: none;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cs-nav-link {
    color: var(--cs-text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: var(--cs-radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cs-nav-link:hover, .cs-nav-link.active {
    color: var(--cs-primary);
    background: var(--cs-surface-alt);
}

.cs-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Grade Selector Pill */
.cs-current-grade-pill {
    background: var(--cs-surface-alt);
    border: 1px solid var(--cs-border);
    padding: 6px 14px;
    border-radius: var(--cs-radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cs-text);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.cs-current-grade-pill:hover {
    background: var(--cs-border);
}

/* Theme Toggle Button */
.cs-theme-toggle-btn {
    background: var(--cs-surface-alt);
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius-full);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--cs-text);
    transition: all 0.2s;
}

.cs-theme-toggle-btn:hover {
    background: var(--cs-border);
    transform: rotate(15deg);
}

/* Desktop Styles (min-width: 1024px) */
@media (min-width: 1024px) {
    .cs-primary-nav {
        display: flex;
    }
    .cs-mobile-bottom-nav {
        display: none !important;
    }
}

/* Mobile & Tablet Bottom Navigation Bar */
@media (max-width: 1023px) {
    body {
        padding-bottom: 78px; /* Offset for fixed bottom navigation */
    }

    .cs-mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 68px;
        background: var(--cs-surface);
        border-top: 1px solid var(--cs-border);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 9999;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
    }

    .cs-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        height: 100%;
        color: var(--cs-text-muted);
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 700;
        gap: 3px;
        min-height: 48px; /* 44px+ touch target */
        transition: color 0.2s;
    }

    .cs-bottom-nav-item .cs-bnav-icon {
        font-size: 1.35rem;
        line-height: 1;
    }

    .cs-bottom-nav-item:hover,
    .cs-bottom-nav-item.active {
        color: var(--cs-primary);
    }
}

/* Footer Styling */
.cs-site-footer {
    background: var(--cs-surface);
    border-top: 1px solid var(--cs-border);
    padding: 50px 0 35px;
    margin-top: 60px;
    color: var(--cs-text-muted);
    font-size: 0.95rem;
}

.cs-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.cs-footer-column h4 {
    color: var(--cs-text);
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.cs-footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cs-footer-column ul li {
    margin-bottom: 8px;
}

.cs-footer-bottom {
    border-top: 1px solid var(--cs-border);
    padding-top: 25px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
