/* 
* BrainSpark Digital - Base Styles
* Core styles for the base template including header, footer, navigation and layout
*/

/* ====== CSS VARIABLES - Anthropic-Inspired Theme ====== */
:root {
    /* Primary Backgrounds - Anthropic's warm cream palette */
    --bg-cream: #FAF7F2;
    --bg-warm: #F5F1EA;
    --bg-primary: #FAF7F2;
    --bg-secondary: #F0EBE3;
    --background-color: #FAF7F2;
    --background-alt: #F0EBE3;
    
    /* Card Backgrounds - Anthropic's muted pastels */
    --card-beige: #E8DDD1;
    --card-sage: #C5D6CD;
    --card-lavender: #D2D0DE;
    --card-bg: #ffffff;
    
    /* Text Colors */
    --text-color: #191919;
    --text-secondary: #3D3D3D;
    --text-light: #5A5A5A;
    --text-muted: #7A7A7A;
    --header-color: #191919;
    --muted-text: #7A7A7A;
    
    /* Accent Colors */
    --accent-terracotta: #CC6848;
    --accent-black: #191919;
    --accent-sage: #C5D6CD;
    --accent-lavender: #D2D0DE;
    --primary-color: #CC6848;
    --secondary-color: #191919;
    --accent-color: #C5D6CD;
    
    /* Footer */
    --footer-bg: #191919;
    
    /* Semantic Colors */
    --success-color: #4A7C59;
    --warning-color: #CC6848;
    --danger-color: #C45C5C;
    
    /* UI Elements */
    --border-color: #E5E0D8;
    --border-dark: #D4CFC5;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
    --border-radius-sm: 8px;
    
    /* Typography */
    --font-serif: 'Source Serif 4', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ====== CSS RESET ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 62.5%;
}

body {
    font-family: var(--font-sans);
    font-size: 1.6rem;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
    transition: all 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size-adjust: 0.5;
}

/* Layout: Sticky footer (full-height pages) */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}

/* Prevent body scroll when mobile menu is open */
body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ====== TYPOGRAPHY ====== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

h1 {
    font-size: 4.2rem;
}

h2 {
    font-size: 3.6rem;
}

h3 {
    font-size: 2.4rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ====== LAYOUT ====== */
.container {
    width: 100%;
    max-width: 120rem;
    margin: 0 auto;
    padding: 0 2rem;
}


/* ====== BUTTONS ====== */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 1.2rem 2.4rem;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ====== HEADER - Anthropic Style ====== */
header {
    background-color: #F4EFE6;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
    min-height: 7rem;
}

header.scrolled {
    background-color: rgba(244, 239, 230, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--border-color);
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 2rem;
    min-height: 7rem;
    gap: 0;
}

.logo {
    display: flex;
    align-items: center;
    margin-right: 0;
    padding: 0;
    background: transparent;
}

.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0;
    background: transparent;
}

/* Logo Image Styling */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    margin-right: 0;
    padding: 0;
    background: transparent;
}

.logo-image {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
    display: block;
    margin: 0;
    padding: 0;
}

.logo-link:hover .logo-image {
    transform: scale(1.02);
    opacity: 0.9;
}

.logo-text {
    font-size: 2.2rem;
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0;
    letter-spacing: -0.03em;
    line-height: 1;
}

.logo-text span {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--accent-terracotta);
}

.logo-link:hover .logo-text {
    opacity: 0.85;
}

.logo-text {
    font-size: 2rem;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0;
    letter-spacing: -0.02em;
}

.logo h1 {
    font-size: 2rem;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0;
    letter-spacing: -0.02em;
}

.logo span {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--accent-terracotta);
}

nav {
    flex: 1;
    display: flex;
    justify-content: center;
    margin-left: 0.5rem;
}

/* Mobile nav positioning - moved outside for proper cascade */

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.nav-links li {
    margin: 0;
    position: relative;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 400;
    font-family: var(--font-sans);
    font-size: 1.4rem;
    transition: var(--transition);
    position: relative;
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius-sm);
}

.nav-links a:hover {
    background-color: var(--bg-secondary);
    color: var(--text-color);
}

.nav-links a.active {
    color: var(--accent-terracotta);
}

.nav-links a.active::after {
    display: none;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown > a i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.dropdown:hover > a i {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 24rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    z-index: 1001;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
}

.dropdown-menu li {
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.6rem !important;
    color: var(--text-color);
    font-size: 1.4rem;
    transition: var(--transition);
    border-radius: 0;
}

.dropdown-menu a:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.dropdown-menu a i {
    color: var(--primary-color);
    font-size: 1.6rem;
    width: 2rem;
    text-align: center;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 20rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1001;
}

.dropdown-content a {
    display: block;
    padding: 1.2rem 1.6rem;
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    transition: var(--transition);
}

.dropdown-content a:hover {
    background-color: var(--background-alt);
    color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Desktop dropdown arrow - hidden on mobile */
.dropdown > a::after {
    content: '';
    display: none;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
    position: relative;
}

.mobile-toggle span {
    width: 2.5rem;
    height: 3px;
    background-color: var(--text-color);
    margin: 3px 0;
    transition: var(--transition);
    border-radius: 2px;
    transform-origin: center;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}



/* CTA Button */
.cta-btn {
    margin-left: auto;
}

/* ====== FOOTER - Anthropic Style ====== */
footer {
    background-color: var(--footer-bg);
    color: rgba(255, 255, 255, 0.9);
    padding: 4rem 0 2rem;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.footer-logo-image {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.footer-logo h2 {
    color: #ffffff;
    margin-bottom: 0;
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 600;
}

.footer-logo span {
    color: var(--accent-terracotta);
}

.footer-col p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.2rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.6rem;
    height: 3.6rem;
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
    border-radius: 50%;
    transition: var(--transition);
    position: relative;
}

.social-links a i {
    font-size: 1.4rem;
    line-height: 1;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.social-links a:hover {
    background-color: var(--accent-terracotta);
}

.footer-col h3 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
    font-size: 1.4rem;
}

.footer-links a:hover {
    color: #fff;
}

.contact-info li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.4rem;
}

.contact-info i {
    color: var(--accent-terracotta);
    margin-right: 0.8rem;
    width: 1.6rem;
    font-size: 1.4rem;
}

.contact-info a {
    color: rgba(255, 255, 255, 0.7);
}

.contact-info a:hover {
    color: var(--accent-terracotta);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
}

.copyright p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.4rem;
}

/* ====== RESPONSIVE STYLES ====== */
@media screen and (max-width: 768px) {
    /* Mobile Logo Adjustments */
    .logo-image {
        height: 40px;
    }
    
    .logo-text {
        font-size: 1.8rem;
    }
    
    .logo-link {
        gap: 0;
    }
    
    header .container {
        padding: 0.8rem 2rem;
        min-height: 6rem;
    }
    
    .footer-logo {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .footer-logo-image {
        height: 45px;
    }
    
    /* Mobile Menu */
    .cta-btn {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    /* Mobile Menu Backdrop */
    .mobile-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }

    .mobile-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile Menu Overlay */
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 90%;
        max-width: 400px;
        height: 100vh;
        background: #ffffff;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        z-index: 1000;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
        padding: 0;
        overflow-y: auto;
    }

    .nav-links.active {
        left: 0;
    }

    /* Mobile Menu Header */
    .nav-links::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 7rem;
        background: var(--primary-color);
        z-index: -1;
    }

    /* Mobile Menu Items */
    .nav-links li {
        margin: 0;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
    }

    .nav-links li:last-child {
        border-bottom: none;
    }
    
    /* Mobile Dropdown */
    .dropdown {
        position: relative;
    }
    
    .dropdown > a {
        justify-content: space-between;
    }
    
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        margin-top: 0;
        background-color: var(--bg-secondary);
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .dropdown-menu a {
        padding: 1.5rem 3rem !important;
        font-size: 1.5rem;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.8rem 2.5rem;
        font-size: 1.6rem;
        font-weight: 500;
        color: var(--text-color);
        transition: all 0.2s ease;
        position: relative;
        min-height: 5.5rem;
    }

    .nav-links a:hover {
        background-color: #f8fafc;
        color: var(--primary-color);
    }

    .nav-links a.active {
        background-color: var(--primary-color);
        color: white;
        border-left: none;
    }

    .nav-links a.active::after {
        display: none;
    }

    /* Mobile Dropdown Styles */
    .dropdown-content {
        position: static;
        display: none;
        background: #f8fafc;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        border-left: none;
        overflow: hidden;
    }

    .dropdown.active .dropdown-content {
        display: block;
        animation: slideDown 0.2s ease-out;
    }

    .dropdown-content a {
        padding: 1.5rem 2.5rem 1.5rem 4rem;
        font-size: 1.4rem;
        color: var(--text-light);
        border-bottom: 1px solid #e2e8f0;
        position: relative;
        min-height: 5rem;
    }

    .dropdown-content a:last-child {
        border-bottom: none;
    }

    .dropdown-content a:hover {
        background-color: #e2e8f0;
        color: var(--primary-color);
    }

    .dropdown-content a.active {
        background-color: var(--primary-color);
        color: white;
        font-weight: 600;
        position: relative;
    }

    .dropdown-content a.active::before {
        display: none;
    }

    /* Dropdown Arrow Indicator - Only show on mobile */
    .dropdown > a::after {
        content: '⌄';
        font-size: 1.6rem;
        color: var(--text-light);
        transition: transform 0.2s ease;
        margin-left: auto;
    }

    .dropdown.active > a::after {
        transform: rotate(180deg);
        color: inherit;
    }

    /* Animation for dropdown */
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Mobile Menu Close Button */
    .mobile-close {
        display: flex;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        width: 4rem;
        height: 4rem;
        background: rgba(255, 255, 255, 0.9);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        color: var(--text-color);
        transition: all 0.2s ease;
        z-index: 1001;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-close:hover {
        background: var(--primary-color);
        color: white;
        transform: scale(1.05);
    }

    .mobile-close:active {
        transform: scale(0.95);
    }

    /* Ensure mobile menu items are properly spaced */
    .nav-links li {
        margin: 0;
    }

    /* Improve mobile menu scroll behavior */
    .nav-links {
        -webkit-overflow-scrolling: touch;
    }

    /* Better mobile menu transitions */
    .nav-links,
    .mobile-backdrop {
        will-change: transform, opacity;
    }

    /* Touch-friendly improvements */
    .nav-links a {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .dropdown-content a {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Loading state for dropdowns */
    .dropdown.loading .dropdown-content {
        opacity: 0.7;
        pointer-events: none;
    }

    /* Focus styles for accessibility */
    .nav-links a:focus,
    .dropdown-content a:focus,
    .mobile-close:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    /* Better mobile menu spacing */
    .nav-links {
        padding-top: 8rem;
    }

    /* Mobile menu item spacing */
    .nav-links li:first-child {
        margin-top: 1rem;
    }

    /* High contrast mode support */
    @media (prefers-contrast: high) {
        .nav-links {
            border: 2px solid var(--text-color);
        }
        
        .nav-links a {
            border-bottom: 1px solid var(--text-color);
        }
        
        .dropdown-content {
            border: 2px solid var(--text-color);
        }
    }

    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {
        .nav-links,
        .dropdown-content,
        .mobile-toggle span,
        .nav-links a,
        .dropdown-content a {
            transition: none;
        }
        
        .dropdown.active .dropdown-content {
            animation: none;
        }
    }

    /* Footer Responsive */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 55%;
    }

    .nav-links {
        width: 90%;
    }
}

/* ====== SCROLLED HEADER ====== */
header.scrolled {
    background-color: rgba(243, 240, 231, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(25, 25, 25, 0.08);
} 

/* Sticky bottom CTA for mobile */
.sticky-bottom-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    background: rgba(17, 24, 39, 0.9);
    color: #fff;
    padding: 12px 16px;
    backdrop-filter: blur(6px);
}
.sticky-bottom-cta .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.sticky-bottom-cta .cta-text {
    font-weight: 600;
}
.sticky-bottom-cta .btn {
    background: linear-gradient(45deg, #10b981, #059669);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
}
@media (max-width: 768px) {
    .sticky-bottom-cta { display: block; }
}

/* Toast notifications */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  background: #111;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  z-index: 9999;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }