/* Mapbox-inspired modern dark theme styles for Ardour */

/* Base styles and fonts */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #e5e7eb;
    background: #111827;
    overflow-x: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Hero grid background pattern */
.hero-grid {
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* Fade in up animation */
.fade-in-up {
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats cards animation */
.stats-card {
    animation: fadeInUp 1s ease-out;
    animation-fill-mode: both;
}

.stats-card:nth-child(1) {
    animation-delay: 0.2s;
}

.stats-card:nth-child(2) {
    animation-delay: 0.4s;
}

.stats-card:nth-child(3) {
    animation-delay: 0.6s;
}

/* CTA button effects */
.cta-button {
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.3);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cta-button:hover::before {
    left: 100%;
}

/* Product cards */
.product-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
    transition: left 0.5s;
}

.product-card:hover::before {
    left: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Use case accordion */
.use-case-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.use-case.active .use-case-content {
    max-height: 500px;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.75rem;
}

.use-case.active .chevron {
    transform: rotate(180deg);
}

.use-case {
    transition: all 0.3s ease;
}

.use-case:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Timeline items */
.timeline-item {
    animation: slideInLeft 0.6s ease-out;
    animation-fill-mode: both;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(4) {
    animation-delay: 0.4s;
}

.timeline-item:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Deliverable cards */
.deliverable-card {
    transition: all 0.3s ease;
}

.deliverable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* Navigation enhancements */
nav {
    transition: all 0.3s ease;
}

.nav-link {
    position: relative;
    padding: 0.5rem 0;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Scroll animations for sections */
section {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile menu animation */
#mobile-menu {
    transition: max-height 0.3s ease-out;
}

#mobile-menu.hidden {
    max-height: 0;
}

/* Responsive improvements */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .hero-grid {
        background-size: 30px 30px;
    }

    .stats-card {
        animation-delay: 0s !important;
    }

    .timeline-item {
        animation: fadeInUp 0.6s ease-out;
        animation-fill-mode: both;
    }
}

@media (max-width: 640px) {
    .timeline-item .flex {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-item .flex-shrink-0 {
        margin-bottom: 1rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #111827;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Loading animation for stats */
@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stats-card div:first-child {
    animation: countUp 0.8s ease-out;
}

/* Hover glow effect */
.glow-on-hover {
    position: relative;
}

.glow-on-hover::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
    filter: blur(10px);
}

.glow-on-hover:hover::before {
    opacity: 0.7;
}

/* Pulse animation for CTA */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 20px 50px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 20px 60px rgba(59, 130, 246, 0.5);
    }
}

.cta-button:hover {
    animation: pulse 2s infinite;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    nav,
    footer {
        display: none;
    }

    section {
        page-break-inside: avoid;
    }
}

/* 3D Visualization containers */
#scout-viz,
#lift-viz,
#mesh-viz,
#three-module-rail,
#thesis-toggle,
#region-map,
#scout-pipeline-funnel,
#intro-card-anatomy,
#gtm-sprint-board,
#portfolio-mesh-enhanced {
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

#scout-viz canvas,
#lift-viz canvas,
#mesh-viz canvas,
#three-module-rail canvas,
#thesis-toggle canvas,
#region-map canvas,
#scout-pipeline-funnel canvas,
#intro-card-anatomy canvas,
#gtm-sprint-board canvas,
#portfolio-mesh-enhanced canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Hover effect for interactive visualizations */
#thesis-toggle:hover,
#region-map:hover,
#portfolio-mesh-enhanced:hover {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: inset 0 0 30px rgba(59, 130, 246, 0.2), 0 0 40px rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

/* Glow animation for interactive elements */
@keyframes vizGlow {
    0%, 100% {
        box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: inset 0 0 30px rgba(59, 130, 246, 0.3);
    }
}

.viz-interactive {
    animation: vizGlow 4s ease-in-out infinite;
}

/* Loading state for visualizations */
.viz-loading {
    background: linear-gradient(90deg, rgba(31, 41, 55, 0.5) 25%, rgba(59, 130, 246, 0.2) 50%, rgba(31, 41, 55, 0.5) 75%);
    background-size: 200% 100%;
    animation: vizLoading 1.5s ease-in-out infinite;
}

@keyframes vizLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Tooltip for visualization interactions */
.viz-tooltip {
    position: absolute;
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.viz-tooltip.active {
    opacity: 1;
}

.viz-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(31, 41, 55, 0.95);
}

/* Section headers with visualization accent */
.viz-section-header {
    position: relative;
    display: inline-block;
    padding-bottom: 16px;
}

.viz-section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #10b981, #8b5cf6);
    border-radius: 2px;
}

/* Responsive adjustments for visualizations */
@media (max-width: 768px) {
    #scout-viz,
    #lift-viz,
    #mesh-viz,
    #three-module-rail,
    #thesis-toggle,
    #region-map,
    #scout-pipeline-funnel,
    #intro-card-anatomy,
    #gtm-sprint-board,
    #portfolio-mesh-enhanced {
        height: 300px !important;
    }

    .viz-tooltip {
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    #three-module-rail,
    #thesis-toggle,
    #region-map,
    #scout-pipeline-funnel,
    #intro-card-anatomy,
    #gtm-sprint-board,
    #portfolio-mesh-enhanced {
        height: 250px !important;
    }
}

/* Fade-in animation for visualizations */
@keyframes vizFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.viz-fade-in {
    animation: vizFadeIn 0.8s ease-out forwards;
}

/* Interactive element highlight */
.viz-highlight {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6), inset 0 0 30px rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.8);
}

/* Traveling dots animation */
@keyframes travel-rail {
    0% {
        left: 0%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

.animate-travel-rail {
    animation: travel-rail 6s ease-in-out infinite;
}

/* Leaflet custom marker styles */
.marker-pin {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.marker-pulse {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    opacity: 0;
    animation: pulse-marker 2s ease-out infinite;
}

@keyframes pulse-marker {
    0% {
        opacity: 0.7;
        transform: scale(0.5);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Leaflet popup custom styles */
.leaflet-popup-content-wrapper {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
}

.leaflet-popup-tip {
    background: #1f2937 !important;
    border: 1px solid #3b82f6 !important;
}
