/* ============================================================================
   VehicleVector - Consolidated Styles
   Industry standard CSS architecture
   ============================================================================ */

/* ============================================================================
   1. CSS VARIABLES & DESIGN TOKENS
   ============================================================================ */
:root {
    /* Brand Colors */
    --vv-primary: #2563eb;
    --vv-secondary: #1e40af;
    --vv-accent: #0ea5e9;
    --vv-dark: #1e293b;
    --vv-light: #f8fafc;

    /* Extended Color Palette */
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #06b6d4;
    --secondary-light: #22d3ee;
    --secondary-dark: #0891b2;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dark: #d97706;
    --dark: #1e293b;
    --light: #f8fafc;

    /* Grays */
    --gray: #64748b;
    --gray-light: #f1f5f9;
    --gray-dark: #475569;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --text-primary: #333333;

    /* Spacing */
    --spacing-xs: 0.15rem;
    --spacing-sm: 0.35rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.75rem;
    --spacing-xxl: 2.5rem;

    /* Typography */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-base: 0.94rem;
    --line-height-base: 1.45;

    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --navbar-height: 60px;
}

/* ============================================================================
   2. BASE STYLES & RESETS
   ============================================================================ */

/* Smooth transitions for all interactive elements */
.btn, .card, .nav-link, a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Body */
body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--light);
    color: var(--text-primary);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Main content area */
main#main {
    flex: 1;
    padding-top: var(--navbar-height);
}

p.lead {
    font-size: 1.15rem;
    line-height: 1.6;
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

/* ============================================================================
   3. NAVIGATION
   ============================================================================ */

/* Navbar Base */
.navbar {
    z-index: var(--z-fixed);
    background: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--vv-primary);
    margin-right: 2rem;
    padding: 0.5rem 0;
}

.navbar-brand span {
    color: var(--vv-secondary);
}

/* Nav Links */
.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    font-weight: 500;
    color: var(--vv-dark);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--vv-primary);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link.active {
    color: var(--vv-primary);
    font-weight: 600;
}

.nav-link:hover {
    color: var(--vv-primary);
}

/* Navbar CTA */
.navbar-cta {
    margin-left: 0.5rem;
    padding: 0.5rem 1.5rem;
    white-space: nowrap;
}

/* User Menu */
.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--vv-primary) 0%, var(--vv-accent) 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 8px;
    font-size: 14px;
}

.user-menu {
    display: flex;
    align-items: center;
}

.user-name {
    font-weight: 500;
}

/* Dropdown Menu */
.dropdown-menu {
    z-index: var(--z-dropdown);
    margin-top: 0.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.dropdown-menu.show {
    z-index: var(--z-dropdown);
}

/* Mega Menu */
.mega-menu {
    max-width: 1000px;
    min-width: 900px;
    padding: 2.5rem;
    z-index: var(--z-dropdown);
    position: absolute;
    background: #ffffff;
}

@media (max-width: 992px) {
    .mega-menu {
        min-width: auto;
        width: 95vw;
    }
}

/* Navbar scrolled state */
.navbar.navbar-scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* ============================================================================
   4. BUTTONS
   ============================================================================ */

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--vv-primary) 0%, var(--vv-secondary) 100%);
    border: none;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px 0 rgba(37, 99, 235, 0.35);
}

/* Outline Button */
.btn-outline-primary {
    border: 2px solid var(--vv-primary);
    color: var(--vv-primary);
}

.btn-outline-primary:hover {
    background: var(--vv-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.25);
}

/* ============================================================================
   5. CARDS
   ============================================================================ */

.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.card-img-top {
    transition: transform 0.5s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* ============================================================================
   6. FOOTER
   ============================================================================ */

.compact-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 48px 0 32px;
}

.compact-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.compact-footer a:hover {
    color: white;
    transform: translateX(3px);
    display: inline-block;
}

.compact-footer h6,
.footer-heading {
    font-size: 0.875rem;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compact-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compact-footer li {
    margin-bottom: 12px;
}

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

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: white;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-contact-link {
    display: inline-flex;
}

.footer-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 12px;
}

.footer-icon {
    font-size: 0.85rem;
}

.footer-social-group {
    margin-top: 20px;
}

.footer-icon--primary {
    color: #3b82f6;
}

.footer-icon--success {
    color: #10b981;
}

.footer-icon--purple {
    color: #8b5cf6;
}

.footer-icon--amber {
    color: #f59e0b;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 40px;
    padding-top: 24px;
}

.footer-meta {
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
    margin: 0;
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 12px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    color: white;
}

.social-icons i {
    font-size: 1.1rem;
}

.social-icons a:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.social-link--twitter {
    background: linear-gradient(135deg, #1DA1F2 0%, #0d8bd9 100%);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.social-link--twitter:hover {
    box-shadow: 0 8px 20px rgba(29, 161, 242, 0.5);
}

.social-link--linkedin {
    background: linear-gradient(135deg, #0077B5 0%, #005885 100%);
    box-shadow: 0 4px 12px rgba(0, 119, 181, 0.3);
}

.social-link--linkedin:hover {
    box-shadow: 0 8px 20px rgba(0, 119, 181, 0.5);
}

.social-link--github {
    background: linear-gradient(135deg, #333 0%, #24292e 100%);
    box-shadow: 0 4px 12px rgba(51, 51, 51, 0.3);
}

.social-link--github:hover {
    box-shadow: 0 8px 20px rgba(51, 51, 51, 0.5);
}

.social-link--instagram {
    background: linear-gradient(135deg, #E1306C 0%, #C13584 50%, #833AB4 100%);
    box-shadow: 0 4px 12px rgba(225, 48, 108, 0.3);
}

.social-link--instagram:hover {
    box-shadow: 0 8px 20px rgba(225, 48, 108, 0.5);
}

/* ============================================================================
   7. FORMS & INPUTS
   ============================================================================ */

.form-control {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--vv-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ============================================================================
   8. UTILITIES
   ============================================================================ */

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    animation: fadeInUp 0.6s ease-out;
}

/* Gradient backgrounds */
.section-with-bg {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.section-with-bg-alt {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

/* Section spacing */
section {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--vv-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: var(--z-fixed);
    transition: all 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--vv-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: var(--z-tooltip);
}

.skip-link:focus {
    top: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.loading-spinner {
    text-align: center;
}

.spinner-ring {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    margin-top: 1rem;
}

/* Toast Messages */
.toast-container {
    z-index: var(--z-tooltip);
}

.modern-toast {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.toast-success { color: var(--success); }
.toast-error { color: var(--danger); }
.toast-warning { color: --warning); }
.toast-info { color: var(--info); }

/* ============================================================================
   8. COMPACT UI ADJUSTMENTS
   ============================================================================ */
body {
    letter-spacing: 0.01em;
}

h1, .h1 {
    font-size: clamp(1.6rem, 2.8vw, 2rem);
    margin-bottom: var(--spacing-md);
}

h2, .h2 {
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    margin-bottom: var(--spacing-sm);
}

h3, .h3 {
    font-size: clamp(1.2rem, 1.8vw, 1.4rem);
    margin-bottom: var(--spacing-sm);
}

.card {
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.card-body {
    padding: 0.9rem 1rem;
}

.card-header {
    padding: 0.65rem 1rem;
}

.btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.92rem;
    border-radius: 6px;
}

.navbar .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.92rem;
}

.navbar-brand .brand-text {
    font-size: 1.15rem;
}

.table > :not(caption) > * > * {
    padding: 0.55rem 0.75rem;
}

.form-control,
.form-select {
    padding: 0.45rem 0.7rem;
    font-size: 0.95rem;
}

.badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
}


/* ============================================================================
   9. RESPONSIVE UTILITIES
   ============================================================================ */

@media (max-width: 991px) {
    :root {
        --navbar-height: 64px;
    }
}

/* Ensure all sections don't block dropdowns */
section,
section.hero,
section.hero-modern,
div.hero,
main,
#main {
    position: relative;
    z-index: 1;
}

/* Force dropdown visibility */
.dropdown:hover .dropdown-menu,
.dropdown.show .dropdown-menu {
    z-index: var(--z-dropdown);
    visibility: visible;
    opacity: 1;
}
