/**
 * SHARED COMPONENTS CSS
 * All Navigation and Footer styles consolidated
 * Responsive breakpoints: Mobile (<768px), Tablet (768-1024px), Desktop (>1024px)
 */

/* ════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES (Variables)
   These reference the existing project variables
   ════════════════════════════════════════════════════════════ */
:root {
    /* Colors */
    --accent: #1a9e72;
    --accent-hover: #148b63;
    --ink: #1a1a1a;
    --ink-light: #6b7280;
    --ink-mid: #9ca3af;
    --nav-bg: #fafaf8;
    --border: rgba(29, 158, 117, 0.12);
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 56px;
    
    /* Transitions */
    --transition-fast: 200ms ease;
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index scale - nav must be above page loader (10000) */
    --z-nav: 11000;
    --z-overlay: 99999;
    --z-panel: 100001;
    --z-cursor: 2147483647; /* Maximum possible z-index */
}

/* ════════════════════════════════════════════════════════════
   PAGE LOADER
   ════════════════════════════════════════════════════════════ */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000000 !important; /* Absolute top priority, above navbar and everything else */
    background-color: var(--nav-bg); /* Use theme background */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.loader-letters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ch-svg { width: 60px; height: 82px; overflow: visible; }
.bob1 { animation: bob 2.8s ease-in-out infinite 0s; display: inline-flex; }
.bob3 { animation: bob 2.8s ease-in-out infinite 0.5s; display: inline-flex; }

@keyframes bob {
    0%,100% { transform: translateY(0) scale(1); }
    30%     { transform: translateY(-5px) scale(1.05); }
    60%     { transform: translateY(2px) scale(0.97); }
}

.ring-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
}

.ring-dash {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px dashed var(--accent);
    animation: spinR 5s linear infinite;
    box-shadow: 0 0 20px rgba(29, 158, 117, 0.3);
}

.ring-arc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-right-color: rgba(29, 158, 117, 0.3);
    box-shadow: 0 0 15px rgba(29, 158, 117, 0.4);
    animation: spinR 1.4s linear infinite;
}

@keyframes spinR { to { transform: rotate(360deg); } }

.center-svg {
    position: relative;
    z-index: 2;
    width: 56px;
    height: 76px;
    overflow: visible;
    animation: pulseSvg 2.8s ease-in-out infinite;
}

@keyframes pulseSvg { 
    0%,100% { transform: scale(1); } 
    50% { transform: scale(1.08); } 
}

.bar-wrap { 
    width: 140px; 
    display: flex; 
    align-items: center; 
    gap: 0; 
}

.bar-side { 
    flex: 1; 
    height: 1px; 
    background: rgba(29, 158, 117, 0.1); 
}

.bar-mid { 
    height: 1px; 
    background: var(--accent); 
    animation: barPulse 2.8s ease-in-out infinite; 
    box-shadow: 0 0 10px rgba(29, 158, 117, 0.5); 
}

@keyframes barPulse { 
    0%,100% { width: 0px; } 
    40%,60% { width: 50px; } 
}

.loader-label {
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    letter-spacing: 0.22em;
    color: var(--accent);
    text-transform: uppercase;
    animation: labelPulse 2.8s ease-in-out infinite;
}

@keyframes labelPulse { 
    0%,100% { opacity: 0.4; } 
    50% { opacity: 1; } 
}

/* ════════════════════════════════════════════════════════════
   CUSTOM CURSOR
   ════════════════════════════════════════════════════════════ */
#cursor-wrap {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: var(--z-cursor) !important;
}
#c-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    mix-blend-mode: normal;
    transition: width 0.3s, height 0.3s, background 0.3s, transform 0.3s;
}
#c-circle {
    width: 56px;
    height: 56px;
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.5s cubic-bezier(0.16,1,0.3,1), height 0.5s cubic-bezier(0.16,1,0.3,1), background 0.5s, border-color 0.3s;
}
#c-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s;
    color: #E5E7EB;
    white-space: nowrap;
}
/* Cursor States */
#cursor-wrap.is-link #c-dot { transform: translate(-50%, -50%) scale(0); }
#cursor-wrap.is-link #c-circle {
    width: 72px;
    height: 72px;
    background: var(--accent);
    border-color: transparent;
}
#cursor-wrap.is-link #c-label { opacity: 1; }

#cursor-wrap.is-service-card #c-dot { transform: translate(-50%, -50%) scale(0); }
#cursor-wrap.is-service-card #c-circle {
    width: 90px;
    height: 90px;
    background: var(--accent);
    border-color: transparent;
}
#cursor-wrap.is-service-card #c-label { opacity: 1; }

#cursor-wrap.is-process-card #c-dot { transform: translate(-50%, -50%) scale(0); }
#cursor-wrap.is-process-card #c-circle {
    width: 80px;
    height: 80px;
    background: var(--bg);
    border-color: transparent;
}
#cursor-wrap.is-process-card #c-label { opacity: 1; }

#cursor-wrap.is-cta #c-dot { transform: translate(-50%, -50%) scale(0); }
#cursor-wrap.is-cta #c-circle {
    width: 100px;
    height: 100px;
    background: var(--accent);
    border-color: transparent;
}
#cursor-wrap.is-cta #c-label { opacity: 1; font-size: 11px; }

/* Hide custom cursor on touch devices */
@media (pointer: coarse) {
    #cursor-wrap { display: none !important; }
    body { cursor: auto !important; }
}

/* ════════════════════════════════════════════════════════════
   GLOBAL STYLES
   ════════════════════════════════════════════════════════════ */
body {
    cursor: none;
}

/* ════════════════════════════════════════════════════════════
   NAVIGATION - DESKTOP NAVBAR
   ════════════════════════════════════════════════════════════ */

/* Main Navbar Container */
.navbar-nft {
    background: rgba(250, 250, 248, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    transition: box-shadow var(--transition-fast);
}

.navbar-nft.fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: var(--z-nav);
}

/* Navbar Brand / Logo */
.navbar-nft .navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a4d38 !important;
    padding: 0;
    text-decoration: none;
}

.navbar-nft .navbar-brand svg {
    width: 40px;
    height: 40px;
}

.navbar-nft .navbar-brand:hover {
    color: var(--accent) !important;
}

/* Navigation Links */
.navbar-nft .navbar-nav {
    list-style: none !important;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.navbar-nft .navbar-nav li {
    list-style: none !important;
}

.navbar-nft .nav-link {
    color: #6B8A7E !important;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
}

.navbar-nft .nav-link:hover,
.navbar-nft .nav-link.active {
    color: var(--accent) !important;
    background: rgba(26, 158, 114, 0.08);
}

.navbar-nft .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}

/* Desktop CTA Button */
.navbar-nft .btn-nft {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white !important;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    border: none;
    margin-left: 1rem;
    box-shadow: 0 4px 12px rgba(26, 158, 114, 0.3);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.navbar-nft .btn-nft:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 158, 114, 0.4);
    color: white !important;
}

/* Desktop horizontal nav layout */
.navbar-nft .navbar-nav.flex-row {
    flex-direction: row;
    gap: 0.5rem;
}

.navbar-nft .navbar-nav.flex-row .nav-link {
    padding: 0.5rem 1rem !important;
    white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════
   MOBILE MENU TOGGLE BUTTON
   ════════════════════════════════════════════════════════════ */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    color: #1a4d38;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: rgba(26, 158, 114, 0.1);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Hide Bootstrap toggler when using custom */
.navbar-toggler { 
    display: none !important; 
}

/* ════════════════════════════════════════════════════════════
   MOBILE OVERLAY NAVIGATION (SaaS Style)
   ════════════════════════════════════════════════════════════ */

/* Mobile Overlay Container */
.mobile-saas-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 300ms, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-saas-overlay.active {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

/* Backdrop */
.mobile-saas-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.mobile-saas-overlay.active .mobile-saas-backdrop {
    opacity: 1;
}

/* Panel - Slides down from top */
.mobile-saas-panel {
    position: relative;
    z-index: var(--z-panel);
    background: #ffffff;
    border-radius: 0 0 32px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow-y: auto;
}

.mobile-saas-overlay.active .mobile-saas-panel {
    transform: translateY(0);
}

/* Mobile Header */
.mobile-saas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px var(--spacing-lg);
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-saas-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: #1a4d38;
    font-weight: 600;
    font-size: 1.1rem;
    font-family: 'Playfair Display', Georgia, serif;
}

.mobile-saas-logo svg {
    width: 36px;
    height: 36px;
}

.mobile-saas-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.mobile-saas-btn-start {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(26, 158, 114, 0.3);
}

.mobile-saas-btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 158, 114, 0.4);
}

.mobile-saas-close {
    background: rgba(29, 158, 117, 0.1);
    border: none;
    cursor: pointer;
    padding: 10px;
    color: #1a4d38;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.mobile-saas-close:hover {
    background: rgba(29, 158, 117, 0.2);
    transform: rotate(90deg);
}

.mobile-saas-close svg {
    width: 24px;
    height: 24px;
}

/* Mobile Menu Content */
.mobile-saas-content {
    padding: var(--spacing-lg);
}

.mobile-saas-menu {
    list-style: none;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mobile-saas-item {
    border-bottom: 1px solid var(--border);
}

.mobile-saas-item:last-child {
    border-bottom: none;
}

.mobile-saas-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 18px var(--spacing-lg);
    text-decoration: none;
    color: #1a4d38;
    font-weight: 500;
    font-size: 1rem;
    transition: all var(--transition-fast);
    position: relative;
    background: #ffffff;
}

.mobile-saas-link:hover {
    background: rgba(29, 158, 117, 0.05);
    color: var(--accent);
}

.mobile-saas-link:active {
    background: rgba(29, 158, 117, 0.1);
}

.mobile-saas-link.active {
    background: rgba(29, 158, 117, 0.1);
    color: var(--accent);
}

.mobile-saas-icon {
    width: 24px;
    height: 24px;
    color: #6b8a7e;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.mobile-saas-link:hover .mobile-saas-icon,
.mobile-saas-link.active .mobile-saas-icon {
    color: var(--accent);
}

.mobile-saas-text {
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

/* Mobile CTA Section */
.mobile-saas-cta {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(29, 158, 117, 0.1) 0%, rgba(29, 158, 117, 0.05) 100%);
    border-radius: 20px;
    text-align: center;
}

.mobile-saas-cta-text {
    color: #3d5a52;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.mobile-saas-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #ffffff;
    padding: 14px 32px;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(26, 158, 114, 0.35);
}

.mobile-saas-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 158, 114, 0.45);
}

/* ════════════════════════════════════════════════════════════
   FOOTER STYLES
   ════════════════════════════════════════════════════════════ */

footer {
    background: var(--nav-bg);
    border-top: 1px solid var(--border);
    padding: 72px 56px 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-2xl);
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--spacing-2xl);
}

/* Footer Brand Column */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.footer-logo-svg {
    width: 40px;
    height: 40px;
}

.footer-logo-wordmark {
    font-family: 'Playfair Display', 'Cormorant Garamond', 'Libre Baskerville', serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.5px;
}

.footer-brand h3 {
    font-family: 'Playfair Display', 'Cormorant Garamond', 'Libre Baskerville', serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 10px;
}

.footer-brand p {
    font-size: 14px;
    color: var(--ink-light);
    line-height: 1.75;
    max-width: 260px;
}

/* Footer Columns */
.footer-col h5 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 20px;
}

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

.footer-col ul li + li {
    margin-top: 12px;
}

.footer-col ul a {
    color: var(--ink-light);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition-fast);
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
}

.footer-col ul a:hover {
    color: var(--accent);
}

/* Footer Bottom Bar */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 32px;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    max-width: 1300px;
    margin: 0 auto;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--ink-mid);
    margin: 0;
}

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

/* Social Links */
.socials {
    display: flex;
    gap: 10px;
}

.social-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-light);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-btn:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    transform: translateY(-2px);
}

.social-btn svg {
    width: 16px;
    height: 16px;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────
   TABLET (768px - 1024px)
   ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) and (min-width: 768px) {
    /* Footer: 2-column grid on tablet */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* ─────────────────────────────────────────────────────────
   MOBILE (< 768px)
   ───────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    /* Show hamburger, hide desktop CTA */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .navbar-nft .btn-nft {
        display: none;
    }
    
    /* Mobile footer: single column */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        margin-bottom: var(--spacing-xl);
    }
    
    footer {
        padding: 60px var(--spacing-lg) 32px;
    }
    
    /* Footer bottom: stack on mobile */
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    /* Touch-friendly tap targets */
    .footer-col ul a {
        min-height: 44px;
        line-height: 44px;
        padding: 0;
    }
    
    .social-btn {
        width: 44px;
        height: 44px;
    }
    
    .social-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ─────────────────────────────────────────────────────────
   DESKTOP (> 1024px)
   ───────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
    /* Full horizontal nav */
    .navbar-nft .navbar-nav {
        display: flex !important;
    }
    
    /* Full 4-column footer */
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

/* Hide mobile overlay on desktop */
@media (min-width: 992px) {
    .mobile-saas-overlay {
        display: none !important;
    }
}

/* ════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ════════════════════════════════════════════════════════════ */

.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-lg-none { display: none !important; }
.d-lg-flex { display: flex !important; }

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-flex { display: flex !important; }
}

@media (max-width: 991px) {
    .d-lg-none { display: flex !important; }
    .d-lg-flex { display: none !important; }
}

.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.ms-auto { margin-left: auto !important; }

.container {
    width: 100%;
    padding-right: var(--spacing-md);
    padding-left: var(--spacing-md);
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}

@media (min-width: 768px) {
    .container { max-width: 720px; }
}

@media (min-width: 992px) {
    .container { max-width: 960px; }
}

@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}
