/* ============================================
   UNIFIED WEBSITE STYLES - YOLOPMENT
   Design System: Corporate Tech Hybrid
   ============================================ */

/* ============================================
   1. CSS VARIABLES - DESIGN TOKENS
   ============================================ */
:root {
  /* Primary Color System - Professional Blue */
  --primary-blue: #2563eb;
  --primary-blue-light: #3b82f6;
  --primary-blue-dark: #1d4ed8;
  --primary-blue-hover: #1e40af;

  /* Accent Colors */
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #22d3ee;
  --accent-purple: #8b5cf6;

  /* Neutral Colors */
  --dark-bg: #0f172a;
  --dark-surface: #1e293b;
  --dark-surface-light: #334155;
  --light-bg: #ffffff;
  --light-surface: #f8fafc;
  --light-surface-alt: #f1f5f9;

  /* Text Colors */
  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-blue: 0 10px 30px rgba(37, 99, 235, 0.3);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-tooltip: 1070;
}

/* ============================================
   2. RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-body);
  background-color: var(--light-surface);
  overflow-x: hidden;
}

/* ============================================
   3. TYPOGRAPHY SYSTEM
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-dark);
}

h1 {
  font-size: var(--text-5xl);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

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

a:hover {
  color: var(--primary-blue-dark);
}

/* ============================================
   4. ADVANCED HEADER & NAVIGATION
   ============================================ */

/* Skip to Content Link (Accessibility) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-blue);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Main Navbar - Advanced Design */
.modern-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Scrolled State - Glassmorphism White */
.modern-navbar.navbar-scrolled {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Container Padding with Smooth Transition */
.modern-navbar .container {
  padding-top: 18px;
  padding-bottom: 18px;
  transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-navbar.navbar-scrolled .container {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* Logo - Premium Design */
.navbar-brand {
  padding: 0;
  margin-right: 3rem;
  display: flex;
  align-items: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.navbar-brand:hover {
  transform: scale(1.02);
}

/* Logo Separator */
.navbar-brand::after {
  content: '';
  position: absolute;
  right: -1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 32px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.navbar-scrolled .navbar-brand::after {
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.1) 50%, transparent 100%);
  opacity: 1;
}

.navbar-brand .logo-image {
  height: 48px;
  max-width: 200px;
  width: auto;
  object-fit: contain;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.navbar-scrolled .navbar-brand .logo-image {
  height: 40px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Navigation Links - Advanced Styling */
.navbar-nav {
  gap: 4px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  padding: 10px 18px;
  margin: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: var(--radius-md);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.navbar-scrolled .nav-link {
  color: var(--text-dark);
  text-shadow: none;
}

/* Advanced Underline Animation */
.nav-link::before {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--primary-blue));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.navbar-scrolled .nav-link:hover {
  color: var(--primary-blue);
  background: rgba(37, 99, 235, 0.06);
}

.nav-link:hover::before {
  transform: scaleX(1);
}

.nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.navbar-scrolled .nav-link.active {
  color: var(--primary-blue);
  background: rgba(37, 99, 235, 0.1);
}

.nav-link.active::before {
  transform: scaleX(1);
}

/* Dropdown Menu - Enhanced */
.nav-item.dropdown .dropdown-menu {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-xl);
  padding: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  margin-top: 0;
  /* Remove gap that breaks hover on desktop */
  padding-top: 12px;
  /* Use padding instead for spacing */
  min-width: 240px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* ... existing desktop hover styles ... */

/* Global hover rule removed. Handled in @media (min-width: 992px) */
/* .nav-item.dropdown:hover .dropdown-menu ... moved to desktop query */

.dropdown-item {
  color: var(--text-dark);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 4px 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  font-size: 0.9375rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary-blue), var(--accent-cyan));
  transform: scaleY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-item i {
  width: 20px;
  margin-right: 12px;
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.dropdown-item:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-blue);
  transform: translateX(4px);
  padding-left: 20px;
}

.dropdown-item:hover::before {
  transform: scaleY(1);
}

.dropdown-item:hover i {
  color: var(--primary-blue);
  transform: scale(1.1);
}

/* Mega Menu - Removed (no HTML implementation) */
/* If needed in future, implement HTML first then add CSS */


/* CTA Button - Premium Gradient */
.nav-cta-btn {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-cyan) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 10px 28px;
  font-weight: 600;
  margin-left: 16px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  border: none;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-cta-btn:hover {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  color: white;
}

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

/* Navbar Toggler - Modern Design */
.navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  width: 44px;
  height: 44px;
}

.navbar-scrolled .navbar-toggler {
  border-color: rgba(0, 0, 0, 0.1);
  background: white;
}

.navbar-toggler:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.navbar-scrolled .navbar-toggler:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.3);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  outline: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.navbar-scrolled .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(26, 26, 26, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
  transform: rotate(90deg);
}

/* Mobile Menu */
@media (max-width: 991px) {
  /* ============================================================
     CRITICAL: KILL ALL DESKTOP DROPDOWN BEHAVIOR ON MOBILE
     ============================================================ */

  /* Force ALL dropdowns to be static (no floating/absolute positioning) */
  .dropdown-menu,
  .mega-menu,
  .nav-item.dropdown .dropdown-menu {
    position: static !important;
    float: none !important;
    transform: none !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Kill hover behavior completely */
  .nav-item.dropdown:hover .dropdown-menu {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: all !important;
  }

  .modern-navbar .container {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .navbar-brand::after {
    display: none;
  }

  .navbar-brand {
    margin-right: auto;
  }

  /* Mobile Menu Backdrop */
  .navbar-collapse::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    z-index: -1;
  }

  .navbar-collapse.show::before {
    opacity: 1;
    visibility: visible;
  }

  /* ============================================================
     FULL-SCREEN MOBILE MENU CONTAINER
     ============================================================ */

  .navbar-collapse {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #0f172a !important;
    /* Solid dark background */
    padding: 80px 24px 40px !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    transform: translateX(100%) !important;
    /* Start off-screen right */
    z-index: 9999 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .navbar-collapse.show {
    transform: translateX(0) !important;
    /* Slide in */
  }

  /* Lock body scroll when menu is open */
  body.menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
  }

  /* Remove backdrop (we're full-screen now) */
  .navbar-collapse::before {
    display: none !important;
  }

  /* -------------------------------------------------------------
     PREMIUM SAAS MOBILE MENU
     Theme: Modern Dark Enterprise
     ------------------------------------------------------------- */

  /* NOTE: .navbar-collapse styles are already defined above (lines 539-555). 
     We are now refining the internal components. */

  /* Main Nav Items and Links */
  .navbar-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Remove gap, use padding/border for separation */
    width: 100%;
    margin-top: 10px;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

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

  /* High Specificity Link Styles */
  .navbar-collapse .navbar-nav .nav-link {
    color: #cbd5e1 !important;
    /* Slate 300 */
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    /* Large, touch-friendly */
    padding: 18px 4px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    transition: all 0.2s ease;
    background: transparent !important;
  }

  .navbar-collapse .navbar-nav .nav-link:hover,
  .navbar-collapse .navbar-nav .nav-link:active {
    color: #ffffff !important;
    padding-left: 8px;
    /* Subtle slide on interact */
  }

  /* Keep parent subtle when dropdown is open - no color change */
  .navbar-collapse .navbar-nav .nav-link[aria-expanded="true"] {
    /* Remove cyan highlight - keep it subtle */
    font-weight: 500;
    /* Keep normal weight */
  }

  /* Active Link State */
  .navbar-collapse .navbar-nav .nav-link.active {
    color: #38bdf8 !important;
    font-weight: 600;
  }

  /* Dropdown Toggle Caret - Custom Icon */
  .dropdown-toggle::after {
    content: '\f107';
    /* FontAwesome Angle Down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    border: none;
    margin-left: auto;
    font-size: 1rem;
    color: #64748b;
    /* Muted */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
  }

  .dropdown-toggle[aria-expanded="true"]::after,
  .dropdown-toggle.show::after {
    transform: rotate(180deg);
    color: #38bdf8;
    /* Highlight on open */
  }

  /* CTA Button - Mobile Version */
  .nav-cta-btn {
    margin-top: 30px;
    width: 100%;
    text-align: center;
    padding: 16px;
    font-size: 1.05rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.25);
  }


  /* 
   * MOBILE ACCODRION DROPDOWN 
   * Styled like a nested list
   */
  /* Mobile Dropdown Container - Single Column Only */
  .navbar-collapse .nav-item.dropdown .dropdown-menu {
    position: static !important;
    float: none !important;
    transform: none !important;
    opacity: 1 !important;
    display: none;
    /* Controlled by Bootstrap */
    visibility: visible !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    /* Remove all margins */
    padding: 8px 0 !important;
    /* Only vertical padding */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-left: none !important;
    /* Remove left border */
    border-radius: 0 !important;
  }

  /* When Bootstrap adds 'show' (or manual toggle) */
  .navbar-collapse .nav-item.dropdown .dropdown-menu.show {
    display: block !important;
    /* Block, not flex - prevents columns */
    animation: slideDownEnhanced 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideDownEnhanced {
    from {
      opacity: 0;
      transform: translateY(-8px) scaleY(0.95);
      max-height: 0;
    }

    to {
      opacity: 1;
      transform: translateY(0) scaleY(1);
      max-height: 500px;
    }
  }

  /* Dropdown Items - Full Width, No Indentation */
  .navbar-collapse .dropdown-item {
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    padding: 14px 16px !important;
    /* Symmetric padding */
    color: #94a3b8 !important;
    background: transparent !important;
    border-radius: 8px !important;
    margin: 4px 0 !important;
    /* Only vertical margin */
    white-space: normal !important;
    display: block !important;
    /* Block display - no flex */
    width: 100% !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .navbar-collapse .dropdown-item i {
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: color 0.2s;
  }

  .navbar-collapse .dropdown-item:active,
  .navbar-collapse .dropdown-item:focus,
  .navbar-collapse .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #38bdf8 !important;
    /* Cyan active color */
  }

  .navbar-collapse .dropdown-item:hover i {
    color: #38bdf8;
  }

  /* CTA Button in Menu */
  .nav-cta-btn {
    text-align: center;
    display: block;
    width: 100%;
    margin: 24px 0 0 0;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-cyan) 100%);
    border: none;
    color: white;
    font-weight: 600;
    border-radius: 50px;
    /* Pill shape */
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
  }

  /* Brand Adjustment */
  .navbar-brand .logo-image {
    height: 38px;
    /* In dark menu, original logo might not work if it's black. 
       Assuming logo is handled by conditional PHP or filter.
       If navbar-scrolled is transparent/dark, ensure branding is visible. */
  }
}

/* Desktop Only: Hover to Show Dropdown */
@media (min-width: 992px) {

  .nav-item.dropdown:hover .dropdown-menu,
  .nav-item.dropdown .dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
  }
}

/* ============================================
   5. UTILITY CLASSES
   ============================================ */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   6. PERFORMANCE OPTIMIZATIONS
   ============================================ */
/* .modern-navbar transform removed for mobile fix */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}