/* ==========================================
   CSS VARIABLES - Easy theming across site
   ========================================== */
:root {
    /* Layout */
    --navbar-height: 56px;
    --section-padding: 80px;
    --section-padding-mobile: 40px;
    
    /* Hero Section */
    --hero-gradient-start: rgba(0, 0, 0, 0.8);
    --hero-gradient-mid: rgba(0, 0, 0, 0.5);
    --hero-gradient-end: rgba(0, 0, 0, 0);
    
    /* Colors - Add these for consistency */
    --primary-color: #0d6efd;      /* Bootstrap primary blue */
    --secondary-color: #6c757d;    /* Bootstrap secondary gray */
    --success-color: #198754;      /* Bootstrap success green */
    --danger-color: #dc3545;       /* Bootstrap danger red */
    --warning-color: #ffc107;      /* Bootstrap warning yellow */
    --info-color: #0dcaf0;         /* Bootstrap info cyan */
    --light-color: #f8f9fa;        /* Bootstrap light */
    --dark-color: #212529;         /* Bootstrap dark */
    --white: #ffffff;
    --black: #000000;
    
    /* Text Colors */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #6c757d;
    --text-light: #ffffff;
    
    /* Background Colors */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --bg-dark: #212529;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    --space-2xl: 3rem;     /* 48px */
    --space-3xl: 4rem;     /* 64px */
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 1rem;
    --radius-circle: 50%;
    
    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    /* Transitions */
    --transition-fast: 0.15s ease-in-out;
    --transition-base: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.5;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ==========================================
   GLOBAL STYLES
   ========================================== */
html {
    scroll-behavior: smooth;
}

body {
    padding-top: var(--navbar-height);
    overflow-x: hidden;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
}

/* Account for fixed navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: var(--z-fixed);
    background-color: var(--bg-dark);
    box-shadow: var(--shadow-sm);
}

/* Fix Jeremy's LI for drone components page */
li {
    display: block;
}

/* ==========================================
   HERO SECTION WITH 360 VIEWER
   ========================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60vh;
    background: linear-gradient(to bottom, 
        var(--hero-gradient-start) 0%,
        var(--hero-gradient-mid) 30%,
        var(--hero-gradient-end) 60%
    );
    z-index: 5;
    pointer-events: none; 
}

#viewer {
    width: 100%;
    background-color: var(--bg-white);
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    touch-action: pan-y pinch-zoom;
}

/* Hero overlay text */
.hero-overlay {
    position: relative;
    z-index: 10;
    padding: var(--space-2xl) var(--space-lg);
    margin: auto auto 0;
    border-radius: var(--radius-lg);
    max-width: 800px;
    color: var(--text-light);
}

.hero-overlay h1,
.hero-overlay p {
    color: var(--text-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Scroll down button */
.scroll-down-btn {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: bounce 2s infinite;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.scroll-down-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: var(--shadow-lg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ==========================================
   SECTIONS
   ========================================== */
.section {
    min-height: 100vh;
    padding: var(--section-padding) 0;
}

.section.bg-light {
    background-color: var(--bg-light);
}

.section.bg-white {
    background-color: var(--bg-white);
}

.section.bg-dark {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

/* ==========================================
   CARDS - Enhanced with variables
   ========================================== */
.card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), 
                box-shadow var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: var(--space-xl);
}

.card-title {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.card-text {
    color: var(--text-secondary);
    line-height: var(--line-height-base);
}

/* ==========================================
   BUTTONS - Enhanced with variables
   ========================================== */
.btn {
    transition: all var(--transition-base);
    border-radius: var(--radius-md);
    font-weight: 500;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.125rem;
}

/* ==========================================
   IMAGE CAROUSEL
   ========================================== */
.carousel-item img {
    height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

/* Make carousel captions more readable */
.carousel-caption {
    background: rgba(0, 0, 0, 0.6);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
}

.carousel-caption h5 {
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.carousel-caption p {
    color: var(--text-light);
    margin-bottom: 0;
}

/* Carousel controls */
.carousel-control-prev,
.carousel-control-next {
    opacity: 0.7;
    transition: opacity var(--transition-base);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

/* ==========================================
   TYPOGRAPHY ENHANCEMENTS
   ========================================== */
.display-4,
.display-5 {
    font-weight: 700;
    line-height: 1.2;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-secondary);
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: var(--space-lg);
    font-weight: 600;
}

p {
    margin-bottom: var(--space-md);
}

/* ==========================================
   MOBILE OPTIMIZATIONS
   ========================================== */
@media (max-width: 767px) {
    :root {
        --section-padding: 40px;
    }

    body {
        padding-top: 50px;
    }

    #viewer {
        height: 100vh;
    }
    
    .hero-overlay {
        padding: var(--space-lg) var(--space-md);
        margin: auto var(--space-md) 80px;
    }
    
    .scroll-down-btn {
        bottom: 160px;
    }

    .section {
        min-height: auto;
        padding: var(--section-padding-mobile) 0;
    }

    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }

    .hero-overlay .tagline {
        display: none;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Stack buttons vertically on mobile */
    .d-flex.gap-3 {
        flex-direction: column !important;
        gap: var(--space-md) !important;
    }
    
    .d-flex.gap-3 .btn {
        width: 100%;
    }

    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .card {
        margin-bottom: var(--space-xl);
    }

    .card-body {
        padding: var(--space-lg);
    }

    .img-fluid {
        margin-bottom: var(--space-lg);
    }
    
    .carousel-item img {
        height: 300px;
    }
}

/* ==========================================
   TABLET OPTIMIZATIONS
   ========================================== */
@media (min-width: 768px) and (max-width: 991px) {
    .section {
        padding: 60px 0;
    }
    
    .carousel-item img {
        height: 400px;
    }
}

/* Desktop and larger */
@media (min-width: 768px) {
    #viewer {
        height: 100vh;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.container, .container-fluid {
    overflow-x: hidden;
}

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

/* Spacing Utilities - Use CSS variables */
.mt-custom {
    margin-top: var(--space-xl);
}

.mb-custom {
    margin-bottom: var(--space-xl);
}

.py-custom {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
}

/* Text utilities */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-shadow-dark {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Border utilities */
.border-radius-custom {
    border-radius: var(--radius-lg);
}

/* Shadow utilities */
.shadow-custom {
    box-shadow: var(--shadow-md);
}

.shadow-custom-lg {
    box-shadow: var(--shadow-lg);
}

/* Hover effects */
.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Smooth transitions */
.transition-all {
    transition: all var(--transition-base);
}

/* ==========================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================== */

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to content link (if you add one) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--text-light);
    padding: var(--space-sm) var(--space-md);
    text-decoration: none;
    border-radius: 0 0 var(--radius-sm) 0;
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* ==========================================
   LOADING STATES (Optional)
   ========================================== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 3px solid var(--light-color);
    border-top: 3px solid var(--primary-color);
    border-radius: var(--radius-circle);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    body {
        padding-top: 0;
    }
    
    .navbar,
    .scroll-down-btn,
    .carousel-control-prev,
    .carousel-control-next {
        display: none !important;
    }
    
    .section {
        page-break-inside: avoid;
        min-height: auto;
    }
}

/* ==========================================
   DARK MODE SUPPORT (Optional - Future Enhancement)
   ========================================== */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode */
    /*
    :root {
        --bg-white: #1a1a1a;
        --bg-light: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #b8b8b8;
    }
    */
}