/**
 * Navigation & Footer Styles - Academy Flow
 * Following frontend-rule.md design system
 * Mobile-first responsive design
 */

/* ==================== CSS Variables ==================== */
:root {
    /* Primary (Brand / Hero / Headers) */
    --primary-purple: #6F6BCF;
    --primary-purple-dark: #5C58B8;
    --primary-purple-soft: #8A87E6;

    /* Accent (CTA / Success / Fitness) */
    --accent-green: #4CAF50;
    --accent-green-soft: #E8F5E9;
    --accent-green-dark: #3D9140;

    /* Backgrounds */
    --bg-main: #F7F8FC;
    --bg-card: #FFFFFF;
    --bg-section: #F1F2FA;
    --bg-footer: #1F1F1F;

    /* Text */
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-white: #FFFFFF;

    /* Borders */
    --border-light: #E5E7EB;
    --border-soft: #EEF0F6;
}

/* ==================== NAVIGATION ==================== */

.main-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.main-nav .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Brand/Logo */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    transition: opacity 0.2s ease;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-brand-icon {
    stroke: var(--primary-purple);
}

.nav-brand-text {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--primary-purple-soft) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.nav-toggle:hover {
    color: var(--primary-purple);
}

.nav-toggle-icon {
    display: block;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-purple);
    background: rgba(111, 107, 207, 0.08);
}

.nav-link svg {
    flex-shrink: 0;
}

/* Auth Links */
.nav-auth {
    display: flex;
    align-items: center;
}

.nav-auth-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ==================== GLOBAL BUTTON STYLES ==================== */
/* Single source of truth for ALL button styling across the application */

.btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-green) 0%, #66BB6A 100%);
    color: var(--text-white);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.35);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-soft);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary-purple);
    color: var(--primary-purple);
    background: rgba(111, 107, 207, 0.04);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem 1rem;
        gap: 1rem;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-auth-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .nav-auth .btn {
        width: 100%;
    }
}

/* ==================== FOOTER ==================== */

.main-footer {
    background: var(--bg-footer);
    color: var(--text-white);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.main-footer .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Footer Top */
.footer-top {
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2.5rem;
}

/* Footer Brand */
.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-brand-icon {
    stroke: var(--accent-green);
}

.footer-brand-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-white);
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

/* Social Links */
.footer-social {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-white);
    transition: all 0.2s ease;
}

.social-link:hover {
    background: var(--primary-purple);
    transform: translateY(-2px);
}

/* Footer Headings */
.footer-heading {
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-white);
    margin-bottom: 1rem;
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-green);
}

/* Footer Bottom */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin: 0;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-bottom-links a:hover {
    color: var(--text-white);
}

/* Responsive Footer */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .footer-column:first-child {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-column:first-child {
        grid-column: 1;
    }

    .main-footer {
        padding: 2rem 0 1rem;
    }
}

/* ==================== Accessibility ==================== */

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-purple);
    color: var(--text-white);
    padding: 0.75rem 1rem;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    font-weight: 600;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus Styles */
.nav-link:focus,
.social-link:focus,
.footer-links a:focus,
.footer-bottom-links a:focus,
.btn:focus {
    outline: 3px solid var(--primary-purple);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .main-nav {
        border-bottom: 2px solid var(--text-primary);
    }

    .main-footer {
        border-top: 2px solid var(--text-white);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .nav-link,
    .btn,
    .social-link,
    .footer-links a,
    .nav-menu {
        transition: none !important;
    }
}

