/* Global CSS Variables */
:root {
  --primary: #0ea5e9; /* Electric Blue */
  --primary-dark: #0284c7;
  --secondary: #10b981; /* Eco Green */
  --secondary-dark: #059669;
  --dark: #0f172a;
  --dark-light: #1e293b;
  --light: #f8fafc;
  --white: #ffffff;
  --gray: #64748b;
  --gray-light: #e2e8f0;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s ease;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  color: var(--dark);
  background-color: var(--light);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

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

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--dark);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
p { margin-bottom: 1rem; color: var(--gray); }

/* Layout & Containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--white);
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
  color: var(--white);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: var(--transition);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 110px;
}

.logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  color: var(--dark-light);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background: linear-gradient(to right, rgba(255,255,255,0.9) 40%, rgba(255,255,255,0.2)), url('./hero.png') center/cover no-repeat;
  position: relative;
}

.hero-content {
  max-width: 600px;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: var(--dark-light);
}

.hero-btns {
  display: flex;
  gap: 1rem;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  transition: var(--transition);
  border-top: 4px solid var(--primary);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: var(--light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

/* Services Page specific */
.page-header {
  padding: 150px 0 80px;
  background: var(--dark);
  color: var(--white);
  text-align: center;
}

.page-header h1 {
  color: var(--white);
}

.page-header p {
  color: var(--gray-light);
  max-width: 600px;
  margin: 1rem auto 0;
  font-size: 1.1rem;
}

.service-row {
  display: flex;
  align-items: center;
  gap: 4rem;
  margin-bottom: 6rem;
}

.service-row:nth-child(even) {
  flex-direction: row-reverse;
}

.service-image {
  flex: 1;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.service-row:hover .service-image img {
  transform: scale(1.05);
}

.service-content {
  flex: 1;
}

.service-features {
  margin: 1.5rem 0;
}

.service-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--dark-light);
  font-weight: 500;
}

.service-features li svg {
  color: var(--secondary);
}

/* Contact Page specific */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-info-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.contact-info-card .icon {
  background: var(--light);
  padding: 1rem;
  border-radius: 50%;
  color: var(--primary);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark);
}

.form-control {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--gray-light);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 150px;
}

/* Footer */
footer {
  background: var(--dark);
  color: var(--white);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h3 {
  color: var(--white);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.footer-col p {
  color: var(--gray-light);
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--gray-light);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
  padding-left: 0.5rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: var(--gray);
}

/* Animations */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
  .hero {
    background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%), url('./hero.png') center/cover no-repeat;
    text-align: center;
    padding-top: 100px;
  }
  
  .hero-content {
    margin: 0 auto;
  }

  .hero-btns {
    justify-content: center;
  }
  
  .service-row, .service-row:nth-child(even) {
    flex-direction: column;
    gap: 2rem;
  }
  
  .contact-wrapper {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--white);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    clip-path: circle(0% at top right);
    transition: clip-path 0.4s ease-in-out;
  }
  
  .nav-links.active {
    clip-path: circle(150% at top right);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* App Mode Styles */
body.app-mode {
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--light);
}

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

.app-header {
  height: 70px;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 2000;
  position: relative;
  gap: 2rem;
}

.logo-container {
  display: flex;
  align-items: center;
}

.app-logo {
  height: 32px;
  width: auto;
}

.search-container {
  flex: 1;
  max-width: 500px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-container .search-icon {
  position: absolute;
  left: 1rem;
  color: var(--gray);
  width: 18px;
  height: 18px;
}

.search-container input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.75rem;
  border: 1px solid var(--gray-light);
  border-radius: 999px;
  background: var(--light);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.search-container input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark);
  padding: 0.5rem;
  display: flex;
}

.app-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.sidebar {
  width: 350px;
  background: var(--light);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 15px rgba(0,0,0,0.05);
  z-index: 1000;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

.filter-btn {
  background: none;
  border: none;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
}

.filter-btn:hover {
  color: var(--primary);
}

.station-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.app-disclaimer {
  background: #fffbeb;
  border-top: 1px solid #fde68a;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: #92400e;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  z-index: 10;
}

.app-disclaimer i {
  color: #d97706;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.app-disclaimer p {
  margin: 0;
  color: inherit;
  line-height: 1.4;
}

.station-card {
  border: 1px solid var(--gray-light);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
}

.station-card:hover, .station-card.active {
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1);
}

.station-card.active {
  border-width: 2px;
  padding: calc(1.25rem - 1px);
}

.station-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.station-header h3 {
  font-size: 1rem;
  margin: 0;
  flex: 1;
  padding-right: 0.5rem;
  line-height: 1.3;
}

.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-badge.available {
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary-dark);
}

.status-badge.full {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.station-address {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--gray);
}

.station-details {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--dark-light);
}

.station-details .detail {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.station-details .detail i {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.map-container {
  flex: 1;
  position: relative;
  background: #e5e5e5;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.locate-btn {
  position: absolute;
  bottom: 2rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  background: var(--white);
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  color: var(--primary);
  transition: var(--transition);
}

.locate-btn:hover {
  transform: scale(1.05);
}

.spin {
  animation: spin 1s linear infinite;
}

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

/* Custom Leaflet Marker */
.custom-marker {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  background: none;
  border: none;
}

.marker-pin {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -2px 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.custom-marker:hover .marker-pin {
  transform: rotate(-45deg) scale(1.1);
}

.marker-pin i {
  transform: rotate(45deg);
  color: white;
  width: 18px;
  height: 18px;
}

.marker-pin.available {
  background: var(--secondary);
  border: 2px solid white;
}

.marker-pin.full {
  background: #ef4444;
  border: 2px solid white;
}

/* Mobile Responsiveness for App */
@media (max-width: 768px) {
  .app-header {
    gap: 1rem;
    padding: 0 1rem;
    height: 60px;
  }
  
  .search-container {
    display: flex; /* Keep it on mobile but smaller */
  }
  
  .search-container input {
    font-size: 0.9rem;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
  }
  
  .app-main {
    flex-direction: column;
  }
  
  .sidebar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45vh;
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    z-index: 1000;
  }

  .sidebar-header {
    border-radius: 1.5rem 1.5rem 0 0;
    padding: 1rem 1.5rem;
  }
  
  .map-container {
    height: 55vh;
    flex: none;
  }
  
  .locate-btn {
    bottom: 48vh; /* Keep above sidebar */
    right: 1rem;
    width: 44px;
    height: 44px;
  }

  /* Make leaflet zoom controls move up slightly on mobile so they aren't hidden by sidebar */
  .leaflet-bottom.leaflet-right {
    bottom: 47vh !important;
  }
}