/* styles.css - Custom animations & styling for Jonaki Transport Agency */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;600;700;800&display=swap');

:root {
  --primary: #047857; /* Emerald Green */
  --primary-dark: #064e3b;
  --primary-light: #10b981;
  --accent: #f59e0b; /* Amber / Golden */
  --accent-dark: #d97706;
  --dark: #0f172a;
  --road: #1e293b;
}

body {
  font-family: 'Hind Siliguri', 'Inter', sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.font-english {
  font-family: 'Inter', sans-serif;
}

.font-bengali {
  font-family: 'Hind Siliguri', sans-serif;
}

/* Glassmorphism */
.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Truck on Highway Animation Section (Top Showcase) */
.highway-scene {
  position: relative;
  width: 100%;
  height: 270px;
  background: radial-gradient(ellipse at 50% 0%, #1e1b4b 0%, #0f172a 60%, #020617 100%);
  overflow: hidden;
  border-bottom: 2px solid #334155;
  box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.7);
}

/* Twinkling Stars in Night Sky */
.star {
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
  animation: starTwinkle 2.5s infinite ease-in-out alternate;
}

@keyframes starTwinkle {
  0% { opacity: 0.2; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 6px #ffffff; }
}

/* Glowing Night Moon */
.highway-moon {
  position: absolute;
  top: 25px;
  right: 10%;
  width: 52px;
  height: 52px;
  background: radial-gradient(circle at 35% 35%, #fffbeb 0%, #fef3c7 70%, #fde68a 100%);
  border-radius: 50%;
  box-shadow: 0 0 35px rgba(254, 240, 138, 0.6), inset -4px -4px 10px rgba(217, 119, 6, 0.3);
  z-index: 2;
}

/* Distant skyline/trees and Meghna Bridge silhouette */
.scenery-skyline {
  position: absolute;
  bottom: 64px;
  left: 0;
  width: 200%;
  height: 90px;
  background-repeat: repeat-x;
  background-size: 500px 90px;
  opacity: 0.35;
  animation: moveSkyline 20s linear infinite;
}

@keyframes moveSkyline {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Hero Background Bengali Brand Typography */
.hero-bg-brand-text {
  color: rgba(255, 255, 255, 0.13);
  text-shadow: 0 0 35px rgba(16, 185, 129, 0.22), 0 0 70px rgba(245, 158, 11, 0.15);
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.24);
  letter-spacing: 0.02em;
  padding: 14px 0;
  line-height: 1.35;
  overflow: visible;
  transition: all 0.4s ease;
}

/* Live Route Map Pulse & Animation */
@keyframes routePulse {
  from { stroke-dashoffset: 40; }
  to { stroke-dashoffset: 0; }
}

.animated-route-line {
  stroke-dasharray: 8 5;
  animation: routePulse 1.8s linear infinite;
}

@keyframes mapPingPulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.8); opacity: 0.3; }
  100% { transform: scale(2.4); opacity: 0; }
}

.map-ping {
  transform-origin: center;
  animation: mapPingPulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Passing Highway Streetlights (Lampposts) - Grounded on Road */
.highway-streetlight {
  position: absolute;
  bottom: 50px;
  right: -100px;
  width: 60px;
  height: 155px;
  z-index: 5;
  animation: passStreetlight 6s linear infinite;
  pointer-events: none;
}

@keyframes passStreetlight {
  0% { right: -100px; }
  100% { right: 110%; }
}

.streetlight-glow {
  position: absolute;
  top: 10px;
  right: 15px;
  width: 140px;
  height: 140px;
  background: radial-gradient(ellipse at 50% 0%, rgba(254, 240, 138, 0.35) 0%, rgba(254, 240, 138, 0) 70%);
  clip-path: polygon(35% 0%, 65% 0%, 100% 100%, 0% 100%);
  pointer-events: none;
}

/* Grounded Highway Billboard / Gantry Structure - firmly planted on the road */
.highway-overhead-sign {
  position: absolute;
  bottom: 50px;
  right: -360px;
  z-index: 5;
  animation: passGantry 13s linear infinite;
  animation-delay: 2s;
  pointer-events: none;
}

@keyframes passGantry {
  0% { right: -360px; }
  100% { right: 115%; }
}

/* Roadside Trees (Bangladesh highway palm, banyan & neem trees) */
.highway-tree {
  position: absolute;
  bottom: 50px;
  right: -120px;
  z-index: 4;
  pointer-events: none;
}

.highway-tree-1 {
  animation: passTree1 7.5s linear infinite;
  animation-delay: 0.5s;
}

.highway-tree-2 {
  animation: passTree2 9.5s linear infinite;
  animation-delay: 4.2s;
}

.highway-tree-3 {
  animation: passTree3 11s linear infinite;
  animation-delay: 7s;
}

@keyframes passTree1 {
  0% { right: -120px; }
  100% { right: 110%; }
}

@keyframes passTree2 {
  0% { right: -120px; }
  100% { right: 110%; }
}

@keyframes passTree3 {
  0% { right: -120px; }
  100% { right: 110%; }
}

/* Highway Road */
.highway-road {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background: #1e293b;
  border-top: 4px solid #475569;
  box-shadow: 0 -5px 25px rgba(0,0,0,0.6);
  z-index: 6;
}

.road-markings {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 200%;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    #f59e0b 0px,
    #f59e0b 35px,
    transparent 35px,
    transparent 70px
  );
  animation: moveRoad 0.65s linear infinite;
}

.road-curb {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    #ef4444 0px,
    #ef4444 20px,
    #ffffff 20px,
    #ffffff 40px
  );
}

@keyframes moveRoad {
  0% { transform: translateY(-50%) translateX(0); }
  100% { transform: translateY(-50%) translateX(-70px); }
}

/* Turbo Speed Active Modifier */
body.turbo-active .road-markings {
  animation-duration: 0.28s !important;
}

body.turbo-active .wheel-spin {
  animation-duration: 0.15s !important;
}

body.turbo-active .scenery-skyline {
  animation-duration: 8s !important;
}

body.turbo-active .highway-streetlight {
  animation-duration: 2.5s !important;
}

/* Milestone signs along the road */
.highway-milestone {
  position: absolute;
  bottom: 32px;
  right: -80px;
  animation: passMilestone 8s linear infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 7;
}

@keyframes passMilestone {
  0% { right: -80px; }
  100% { right: 110%; }
}

/* The Animated Moving Cargo Truck - Cruising Realistically Inside the Highway Road Lane */
.truck-container {
  position: absolute;
  bottom: 24px; /* Wheels sit directly on the lane surface in front of markings, fully grounded */
  left: 12%;
  z-index: 10;
  animation: truckBounce 0.8s ease-in-out infinite alternate;
}

@keyframes truckBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-1.5px); }
}

/* Wheel rotation */
.wheel-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: rotateWheel 0.35s linear infinite;
}

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

/* Exhaust smoke */
.smoke-particle {
  position: absolute;
  bottom: 12px;
  left: -15px;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  animation: smokeFly 0.9s linear infinite;
}

.smoke-particle:nth-child(2) {
  animation-delay: 0.3s;
}
.smoke-particle:nth-child(3) {
  animation-delay: 0.6s;
}

/* Headlight Beam - Perfectly Aligned with Truck Headlight Bulbs at x=202px, y=56-62px */
.headlight-beam {
  position: absolute;
  left: 202px;
  top: 48px;
  width: 220px;
  height: 32px;
  background: linear-gradient(90deg, rgba(255, 235, 59, 0.9) 0%, rgba(255, 235, 59, 0.4) 45%, rgba(255, 235, 59, 0) 100%);
  clip-path: polygon(0% 25%, 100% 0%, 100% 100%, 0% 75%);
  pointer-events: none;
  filter: blur(1px);
  transition: all 0.25s ease-out;
  z-index: 15;
}

/* High Beam Active: Super intense 500px projection beam lighting up the highway */
.headlight-beam.headlight-high-beam {
  width: 520px !important;
  height: 60px !important;
  top: 34px !important;
  background: linear-gradient(90deg, #ffffff 0%, rgba(254, 240, 138, 0.98) 15%, rgba(253, 224, 71, 0.65) 50%, rgba(253, 224, 71, 0) 100%) !important;
  filter: drop-shadow(0 0 35px rgba(254, 240, 138, 1)) drop-shadow(0 0 12px #ffffff) blur(0.5px) !important;
  clip-path: polygon(0% 25%, 100% 0%, 100% 100%, 0% 75%) !important;
  z-index: 25 !important;
}

/* Road surface light pool cast by headlights */
.road-light-pool {
  position: absolute;
  left: 205px;
  top: 68px;
  width: 170px;
  height: 14px;
  background: radial-gradient(ellipse at 30% 50%, rgba(254, 240, 138, 0.45) 0%, rgba(254, 240, 138, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: all 0.25s ease-out;
  z-index: 11;
}

.truck-highbeam-on .road-light-pool {
  width: 480px !important;
  height: 28px !important;
  background: radial-gradient(ellipse at 30% 50%, rgba(255, 255, 255, 0.95) 0%, rgba(254, 240, 138, 0.75) 40%, rgba(254, 240, 138, 0) 80%) !important;
  filter: drop-shadow(0 0 20px rgba(254, 240, 138, 0.9)) !important;
}

.truck-highbeam-on .truck-headlight-bulb {
  fill: #ffffff !important;
  filter: drop-shadow(0 0 10px #ffffff) drop-shadow(0 0 20px #facc15) !important;
}

@keyframes smokeFly {
  0% {
    opacity: 0.8;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-40px, -20px) scale(2.5);
  }
}

/* Divi-like Inline Visual Builder Mode Styles */
body.visual-builder-active [data-editable] {
  outline: 2px dashed #0284c7 !important;
  outline-offset: 3px;
  position: relative;
  cursor: text;
  transition: all 0.2s ease;
  min-height: 1.2em;
}

body.visual-builder-active [data-editable]:hover {
  outline: 2px solid #0369a1 !important;
  background-color: rgba(224, 242, 254, 0.4) !important;
}

body.visual-builder-active [data-editable]:focus {
  outline: 2px solid #2563eb !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
}

body.visual-builder-active [data-editable]::after {
  content: '✎ Edit';
  position: absolute;
  top: -18px;
  right: 0;
  background: #0284c7;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 50;
  font-family: sans-serif;
}

body.visual-builder-active [data-editable]:hover::after {
  opacity: 1;
}

/* Builder Floating Toolbar (Divi Style) */
.builder-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulsing badge */
.pulse-badge {
  animation: pulseBadge 2s infinite;
}

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

/* Gradient accents */
.text-gradient {
  background: linear-gradient(135deg, #047857 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-amber {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Toast notifications */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
}

/* ========================================================
   MOBILE-FIRST OPTIMIZATIONS & APP-STYLE DOCK
   ======================================================== */

/* Mobile Safe Area Padding */
.safe-pb {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* Mobile Fixed Bottom App Bar */
.mobile-app-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 45;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.4);
}

/* Mobile Screens (Under 640px) Adjustments */
@media (max-width: 640px) {
  /* Prevent horizontal scrolling glitches */
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Prevent iOS Safari input auto-zooming */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Highway Scene Height & Scaling */
  .highway-scene {
    height: 220px !important;
  }

  .truck-container {
    transform: scale(0.82) !important;
    transform-origin: bottom left;
    bottom: 24px !important;
    left: 4% !important;
  }

  .highway-moon {
    width: 36px !important;
    height: 36px !important;
    top: 12px !important;
    right: 4% !important;
  }

  .highway-milestone {
    bottom: 30px !important;
    transform: scale(0.82);
  }

  /* Toast position on mobile */
  #toast-container {
    top: 16px !important;
    right: 16px !important;
    left: 16px !important;
  }

  /* Builder Dock position above Mobile App Bar */
  .builder-dock {
    bottom: 80px !important;
    width: 92% !important;
    max-width: 400px !important;
  }
}
