/* UNIFIED NAVIGATION & LAYOUT SYSTEM
 * Consistent header, breadcrumbs, and user orientation across all pages
 * Import this before page-specific CSS
 * Note: Fonts should be loaded in HTML <head> with <link> for better performance
 */

:root {
    /* Unified dark color system with improved contrast */
    --nav-bg: #0B1120;
    --nav-bg-blur: rgba(11, 17, 32, 0.95);
    --nav-text: #F9FAFB;
    --nav-text-muted: #D1D5DB;
    --nav-border: rgba(255,255,255,0.15);
    --nav-hover-bg: rgba(255,255,255,0.1);
    --nav-active: #00B894;
    --breadcrumb-text: #D1D5DB;
    --breadcrumb-separator: #9CA3AF;
    
    /* Page colors with improved contrast */
    --page-bg: #0B1120;
    --page-bg-alt: #1a2332;
    --page-text: #E5E7EB;
    --page-text-heading: #FFFFFF;
    --page-text-muted: #D1D5DB;
    --accent: #00B894;
    --accent-hover: #00a07f;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    
    /* Layout constants */
    --nav-height: 72px;
    --max-width: 1200px;
}

/* ==== BASE STYLES ==== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ==== GLOBAL TYPOGRAPHY — HEADINGS (NON-NEGOTIABLE) ==== */
/* Letter-spacing is a brand invariant. Do not override. */
h1, h2, h3, h4, h5, h6,
.hero h1, .page-title, .section-title, .case-title, .intro h2 {
    letter-spacing: 0.01em !important;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, .hero h1, .page-title {
    letter-spacing: 0.015em !important;
}

h2, .section-title, .case-title, .intro h2 {
    letter-spacing: 0.01em !important;
}

h3, h4 {
    letter-spacing: 0.02em !important;
}

h5, h6 {
    letter-spacing: 0.03em !important;
}

body.unified-theme {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--page-bg);
    color: var(--page-text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==== GLOBAL HEADER (ALL PAGES) ==== */
.global-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: transparent;
    border-bottom: none;
    transition: all 0.3s ease;
}

.global-header.scrolled {
    background: var(--nav-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    height: 64px;
}

.global-header.scrolled .nav-container {
    height: 64px;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
    gap: 8px;
}

.nav-logo:hover {
    opacity: 0.85;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    display: block;
}

/* Mobile logo optimization */
@media (max-width: 768px) {
    .nav-logo-img {
        height: 32px;
    }
}

/* Text fallback if logo doesn't load */
.nav-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--nav-text);
    display: flex;
    align-items: center;
    letter-spacing: -0.01em;
}

.nav-logo-prefix {
    color: #FFFFFF;
}

.nav-logo-accent {
    color: var(--accent);
    margin-left: 4px;
    font-weight: 800;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-link {
    color: var(--nav-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    position: relative;
}

.nav-link:hover {
    color: var(--nav-text);
}

.nav-link.active {
    color: var(--nav-active);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--nav-active);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link-secondary {
    color: var(--nav-text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.nav-link-secondary:hover {
    color: var(--nav-text);
}

.nav-link-primary {
    padding: 10px 24px;
    background: var(--accent);
    color: #0B1120;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.2);
}

.nav-link-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.35);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--nav-text);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s;
}

.nav-user:hover {
    background: var(--nav-hover-bg);
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* ==== BREADCRUMBS ==== */
.breadcrumbs {
    padding: 1rem 2rem;
    background: var(--page-bg-alt);
    border-bottom: none;
}

.breadcrumb-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 14px;
}

.breadcrumb-item {
    color: var(--breadcrumb-text);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item:hover {
    color: var(--nav-text);
}

.breadcrumb-item.current {
    color: var(--nav-text);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--breadcrumb-separator);
    user-select: none;
}

/* ==== PAGE HEADER (CONTEXTUAL) ==== */
.page-header {
    padding: 3rem 2rem;
    background: var(--page-bg);
    border-bottom: none;
}

.page-header-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.page-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--page-text-heading);
    margin-bottom: 0.5rem;
    letter-spacing: 0.015em;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 18px;
    color: var(--page-text-muted);
    max-width: 600px;
}

/* ==== MOBILE MENU ==== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--nav-bg);
        flex-direction: column;
        padding: 2rem;
        border-bottom: none;
        transform: translateY(-100%);
        opacity: 0;
        transition: all 0.3s;
        pointer-events: none;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    
    .nav-link {
        font-size: 16px;
        padding: 12px 0;
        width: 100%;
        text-align: center;
    }
    
    .mobile-menu-toggle {
        display: block;
        min-width: 44px;
        min-height: 44px;
    }
    
    .nav-link.active::after {
        display: none;
    }
    
    .nav-container {
        padding: 0 1.5rem;
    }
}

/* ==== FOOTER (CONSISTENT) ==== */
.global-footer {
    background: linear-gradient(180deg, #0a0f1a 0%, #0d1117 100%);
    color: var(--nav-text-muted);
    padding: 4rem 2rem 2rem;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Mobile: Add padding for fixed CTA button */
@media (max-width: 768px) {
    .global-footer {
        padding-bottom: 100px;
    }
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--nav-text);
    margin-bottom: 1.25rem;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: #9CA3AF;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #F9FAFB;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 2rem;
    text-align: center;
    font-size: 13px;
    color: #6B7280;
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ==== CONTENT CONTAINERS ==== */
.content-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
}

.content-section {
    background: var(--page-bg-alt);
    padding: 3rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--page-text-heading);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.section-subtitle {
    color: var(--page-text-muted);
    margin-bottom: 2rem;
}

/* ==== CARDS ==== */
.card {
    background: var(--page-bg-alt);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(0, 184, 148, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ==== BUTTONS ==== */
.btn-primary {
    display: inline-block;
    padding: 14px 32px;
    background: var(--accent);
    color: #0B1120;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 184, 148, 0.25);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4);
}

.btn-secondary {
    display: inline-block;
    padding: 14px 28px;
    background: var(--page-bg-alt);
    color: var(--page-text);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==== HERO SECTION ==== */
.hero {
    padding: 120px 2rem 100px;
    text-align: center;
    background: var(--page-bg);
    position: relative;
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    color: var(--page-text-heading);
    margin-bottom: 1.5rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.hero p {
    font-size: 19px;
    color: var(--page-text-muted);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.75;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }
    .hero p {
        font-size: 16px;
    }
    .nav-auth {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        padding: 12px 20px;
        border-top: 1px solid var(--nav-border);
        z-index: 999;
        display: flex;
        justify-content: center;
    }
    .nav-link-primary {
        width: 100%;
        text-align: center;
        padding: 14px 24px;
    }
}
