/* Custom Styles */
:root {
  --hunter: #2C5F2D;
  --asphalt: #4A4A4A;
  --signal: #FFFFFF;
  --warning: #FFC107;
  --success: #28A745;
  --danger: #DC3545;
  --calm: #0077B6;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
}

/* Scroll Progress */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background-color: var(--hunter);
  z-index: 9999;
  transition: width 0.1s ease-out;
}

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

.stagger-reveal {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }

/* Pulse effect for spots */
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.indicator.available {
  background-color: var(--success);
  animation: pulse-green 2s infinite;
}

.indicator.occupied {
  background-color: var(--danger);
  /* Use subtle inner shadow instead of busy pulse for occupied */
  box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

/* Gate Arm Animation */
.gate-container {
  position: relative;
  width: 100px;
  height: 100px;
  border-left: 6px solid #ccc;
  border-bottom: 6px solid #ccc;
  display: flex;
  align-items: flex-end;
}
.gate-arm {
  width: 90px;
  height: 6px;
  background: repeating-linear-gradient(45deg, #DC3545, #DC3545 10px, #FFFFFF 10px, #FFFFFF 20px);
  transform-origin: left center;
  transform: rotate(0deg);
  transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  left: 3px;
  bottom: 10px;
}
.gate-container.open .gate-arm {
  transform: rotate(-90deg);
}

/* Car Animation */
@keyframes driveIn {
  0% { transform: translateX(-150px) scale(0.8); opacity: 0; }
  50% { transform: translateX(20px) scale(1); opacity: 1; }
  100% { transform: translateX(120px) scale(1.1); opacity: 0; }
}

.animated-car {
  position: absolute;
  bottom: 15px;
  left: 0;
  width: 40px;
  opacity: 0;
}
.gate-container.open .animated-car {
  animation: driveIn 3s linear forwards;
}

/* Flash Animation for LPR */
@keyframes cameraFlash {
  0% { opacity: 0; }
  10% { opacity: 1; box-shadow: 0 0 30px 10px rgba(255,255,255,0.8); background: white; }
  20% { opacity: 0; box-shadow: none; background: transparent; }
  100% { opacity: 0; }
}

.lpr-camera {
  position: absolute;
  top: 10px;
  left: 20px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: transparent;
}
.gate-container.open .lpr-camera::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  animation: cameraFlash 3s;
}

/* Number Flip */
.flip-counter {
  display: inline-block;
  position: relative;
  transition: transform 0.3s ease;
}
.flip-counter.flipping {
  transform: rotateX(360deg);
}

/* Ripple Effect */
.ripple-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-anim 0.6s linear;
  background-color: rgba(255, 255, 255, 0.4);
}
@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--surface);
}
::-webkit-scrollbar-thumb {
  background: var(--hunter);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #1e4520;
}

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Map specific styling */
.parking-map svg {
  width: 100%;
  height: auto;
  max-width: 800px;
  cursor: crosshair;
}

.map-spot {
  transition: all 0.3s ease;
  cursor: pointer;
  transform-origin: center;
}
.map-spot:hover {
  filter: brightness(1.2);
  stroke: var(--signal);
  stroke-width: 2;
  transform: scale(1.02);
}

.map-spot-available { fill: var(--success); }
.map-spot-occupied { fill: var(--danger); opacity: 0.8; }
.map-spot-reserved { fill: var(--warning); opacity: 0.9; }

#map-tooltip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 50;
}

/* Forms styling */
.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  outline: none;
  transition: all 0.2s;
  background-color: #f9fafb;
}
.input-field:focus {
  border-color: var(--hunter);
  box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
  background-color: #fff;
}

/* Octopus Beep Visual */
@keyframes octopus-beep {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 10px var(--success)) brightness(1.5); }
  100% { transform: scale(1); filter: brightness(1); }
}
.octopus-animation.beeping {
  animation: octopus-beep 0.5s ease;
}

/* Traffic Flow Animation */
.traffic-path {
  stroke-dasharray: 10;
  animation: dash 5s linear infinite;
}
@keyframes dash {
  to {
    stroke-dashoffset: -100;
  }
}

.traffic-dot {
  animation: followPath 4s infinite linear;
}
@keyframes followPath {
  from { offset-distance: 0%; opacity: 0;}
  10% { opacity: 1;}
  90% { opacity: 1;}
  to { offset-distance: 100%; opacity: 0;}
}

/* Accordion transition for max-height */
.accordion-content {
  transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
}
.accordion-content.expanded {
  max-height: 500px;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Reveal call button text transition */
.call-btn-text {
  transition: all 0.3s ease;
}

/* Hide numbers initially in layout */
.phone-number-hidden {
  display: none;
}
.phone-number-visible {
  display: inline-block;
  animation: fadeInUp 0.3s ease forwards;
}

/* Toast container */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.toast {
  background: white;
  border-left: 4px solid var(--hunter);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  padding: 1rem 1.5rem;
  border-radius: 0.375rem;
  transform: translateX(120%);
  transition: transform 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toast.show {
  transform: translateX(0);
}

/* Success state overlays for forms */
.form-success-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: white;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  border-radius: 0.5rem;
}
.form-success-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
