/* 
 * MERLAI SHARED NAVIGATION & FOOTER STYLES
 * Unified theme system for all MerlAI pages
 * Based on homepage design with Apple-inspired aesthetics
 */

:root {
    /* Apple-inspired color system */
    --color-white: #ffffff;
    --color-black: #000000;
    --color-gray-50: #f9f9f9;
    --color-gray-100: #f3f3f3;
    --color-gray-200: #e8e8ed;
    --color-gray-300: #d2d2d7;
    --color-gray-400: #aaaa9e;
    --color-gray-500: #86868b;
    --color-gray-600: #6e6e73;
    --color-gray-700: #424245;
    --color-gray-800: #1d1d1f;
    --color-gray-900: #000000;
    
    /* Apple blue accents */
    --color-blue: #0051d0;
    --color-blue-light: #1e40af;
    --color-blue-dark: #003a9b;
    
    /* Apple green (for AI theme) */
    --color-green: #30d158;
    --color-green-light: #64d2ff;
    --color-green-dark: #00d4aa;
    
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #000000 0%, #1d1d1f 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    --gradient-blue: linear-gradient(135deg, var(--color-blue) 0%, var(--color-blue-dark) 100%);
    
    /* Typography */
    --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 60px;
    --space-3xl: 80px;
    --space-4xl: 120px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.25);
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

/* Base reset for consistency */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Navigation - Apple style */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-white);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

/* Logo image container for dual logo support */
.logo-logo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.logo-image {
    width: 36px;
    height: 36px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Dark logo shown by default (for dark backgrounds) */
.logo-image-dark {
    opacity: 1;
}

/* Light logo hidden by default */
.logo-image-light {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

/* When on white background, swap logos */
.logo--on-white .logo-image-dark {
    opacity: 0;
}
.logo--on-white .logo-image-light {
    opacity: 1;
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    padding: var(--space-sm) 0;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--color-white);
}

.auth-buttons {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-blue);
    color: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Make nav buttons match app-wide button text size */
.nav-container .auth-buttons .btn {
    font-size: 0.9rem;
    padding: 10px 18px;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-white);
    transition: all 0.3s ease;
}

/* Mobile Menu - solid dark background for maximum readability */
/* Slides in from RIGHT to LEFT (hamburger is on the right) */
.mobile-menu {
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    height: calc(100vh - 56px);
    background: #000000 !important; /* Solid black - no transparency */
    display: flex;
    flex-direction: column;
    padding: 24px 20px; /* Smaller padding */
    gap: 8px; /* Smaller gap between items */
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 9999; /* Higher z-index to ensure it's on top */
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu a {
    color: var(--color-white);
    text-decoration: none;
    font-size: 0.95rem; /* Smaller font */
    font-weight: 500;
    padding: 10px 0; /* Smaller padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.3s ease;
}

.mobile-menu a:hover {
    color: var(--color-blue-light);
}

.mobile-auth {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.mobile-menu .mobile-auth .btn {
    width: 100%;
    justify-content: center;
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }

    .auth-buttons {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 var(--space-md);
    }
}

/* Footer Styles - Apple minimalist design matching homepage */
.footer, .site-footer {
    background: var(--color-white);
    color: var(--color-black);
    padding: var(--space-3xl) 0 var(--space-lg);
    border-top: 1px solid var(--color-gray-200);
}

.footer-container, .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: grid;
    /* Force equal footer columns so Product/Resources/Company/Legal sit side-by-side */
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-section h4 {
    color: var(--color-gray-800);
    margin-bottom: var(--space-md);
    font-weight: 600;
    font-size: 0.875rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--space-sm);
}

.footer-section ul li a {
    color: var(--color-black);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.875rem;
}

.footer-section ul li a:hover {
    color: var(--color-blue);
}

.footer-bottom {
    border-top: 1px solid var(--color-gray-200);
    padding-top: var(--space-lg);
    text-align: center;
    color: var(--color-black);
    font-size: 0.875rem;
    grid-column: 1 / -1;
}

.footer-bottom p {
    color: var(--color-black);
    font-size: 0.875rem;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-container, .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
}

@media (max-width: 480px) {
    .footer-container, .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
}

/* Ensure body has proper top margin for fixed navbar */
body {
    margin-top: 56px;
    font-family: var(--font-system);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus states for accessibility */
.btn:focus-visible,
.nav-links a:focus-visible {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
}

/* Navbar color transitions based on scroll */
.navbar-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

.navbar-scrolled .logo {
    color: var(--color-black) !important;
}

.navbar-scrolled .nav-links a {
    color: rgba(0, 0, 0, 0.8) !important;
}

.navbar-scrolled .nav-links a:hover {
    color: var(--color-black) !important;
}

.navbar-scrolled .btn-secondary {
    background: rgba(0, 0, 0, 0.1) !important;
    color: var(--color-black) !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
}

.navbar-scrolled .menu-toggle span {
    background: var(--color-black) !important;
}