/* ============================================
   TankPilot Website - Dark Theme Design System
   ============================================ */

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

:root {
  --bg: #0a0b10;
  --bg-surface: #12141d;
  --bg-card: #1a1d28;
  --bg-card-hover: #222637;
  --bg-elevated: #2a2e3d;
  --primary: #00e676;
  --primary-dark: #00c853;
  --primary-glow: rgba(0, 230, 118, 0.15);
  --blue: #3b82f6;
  --blue-glow: rgba(59, 130, 246, 0.12);
  --red: #ef4444;
  --yellow: #fbbf24;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e2231;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
  --max-width: 1200px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.hero h1, .hero p, .search-box, .search-mode-toggle { animation: fadeInUp 0.6s ease-out backwards; }
.hero p { animation-delay: 0.1s; }
.search-mode-toggle { animation-delay: 0.15s; }
.search-box { animation-delay: 0.2s; }

/* --- Scroll-Animationen --- */
.scroll-hidden {
  opacity: 0;
  transform: translateY(24px);
}
.scroll-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* Leicht unterschiedliche Animation für Karten (von links/rechts) */
.station-card.scroll-hidden, .charging-card.scroll-hidden {
  opacity: 0;
  transform: translateX(-16px) translateY(12px);
}
.station-card.scroll-visible, .charging-card.scroll-visible {
  opacity: 1;
  transform: translateX(0) translateY(0);
  transition: opacity 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* Reduce motion für Nutzer die das nicht wollen */
@media (prefers-reduced-motion: reduce) {
  .scroll-hidden { opacity: 1; transform: none; }
  .scroll-visible { transition: none; }
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
ul { list-style: none; }

/* --- Container --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* --- Navigation --- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.nav-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800; color: var(--text);
}
.nav-logo .logo-icon {
  width: 32px; height: 32px;
  color: var(--primary);
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  color: var(--text-secondary); padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; transition: all var(--transition);
}
.nav-links a:hover { color: var(--text); background: var(--bg-card); }
.nav-links a.active { color: var(--primary); background: var(--primary-glow); }
.nav-cta {
  background: var(--primary); color: var(--bg) !important; font-weight: 700;
  padding: 8px 18px !important; border-radius: var(--radius-sm) !important;
}
.nav-cta:hover { background: var(--primary-dark) !important; transform: translateY(-1px); }
.nav-mobile { display: none; background: none; border: none; color: var(--text); cursor: pointer; font-size: 24px; }
.nav-search-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; font-size: 20px; padding: 8px; }
.nav-search { display: none !important; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-surface); border-bottom: 1px solid var(--border); z-index: 98; }

/* --- Hero --- */
.hero {
  position: relative; padding: 80px 0 60px; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,230,118,0.06) 0%, transparent 60%);
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px); font-weight: 900;
  line-height: 1.1; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero h1 span { -webkit-text-fill-color: var(--primary); }
.hero p { font-size: 18px; color: var(--text-secondary); max-width: 550px; margin: 0 auto 36px; }

/* --- Search Box --- */
.search-box {
  max-width: 620px; margin: 0 auto;
  display: flex; gap: 0; background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,230,118,0.08);
  transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input {
  flex: 1; padding: 16px 20px; background: none; border: none; outline: none;
  color: var(--text); font-size: 16px; font-family: var(--font);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box select {
  padding: 16px 12px; background: var(--bg-surface); border: none; border-left: 1px solid var(--border);
  color: var(--text-secondary); font-size: 14px; font-family: var(--font); cursor: pointer; outline: none;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
}
.search-btn {
  padding: 16px 28px; background: var(--primary); border: none; cursor: pointer;
  color: var(--bg); font-weight: 700; font-size: 16px; font-family: var(--font);
  transition: background var(--transition);
}
.search-btn:hover { background: var(--primary-dark); }

/* --- Price Ticker --- */
.ticker {
  background: var(--bg-surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 14px 0; overflow: hidden;
}
.ticker-inner { display: flex; gap: 40px; align-items: center; justify-content: center; flex-wrap: wrap; }
.ticker-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ticker-label { color: var(--text-muted); font-weight: 500; }
.ticker-price { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 18px; }
.ticker-trend { font-size: 12px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.trend-down { color: var(--primary); background: var(--primary-glow); }
.trend-up { color: var(--red); background: rgba(239,68,68,0.12); }
.trend-stable { color: var(--yellow); background: rgba(251,191,36,0.12); }

/* --- Section --- */
.section { padding: 60px 0; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.section-title { font-size: 24px; font-weight: 800; }
.section-link { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.section-link:hover { color: var(--primary); }

/* --- City Grid --- */
.city-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.city-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border); transition: all var(--transition); cursor: pointer;
}
.city-card:hover {
  border-color: var(--primary); transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 35px rgba(0,230,118,0.15);
}
.city-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.city-card .city-price {
  font-size: 28px; font-weight: 900; color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.city-card .city-fuel { font-size: 12px; color: var(--text-muted); }
.city-card .city-count { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* --- Station Card --- */
.station-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center;
  transition: all var(--transition); margin-bottom: 10px;
}
.station-card:hover {
  border-color: rgba(0,230,118,0.3); transform: translateX(6px);
  box-shadow: -4px 0 20px rgba(0,230,118,0.06);
}
.station-card { transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.station-info { flex: 1; }
.station-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.station-brand { color: var(--primary); font-size: 13px; font-weight: 600; }
.station-address { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.station-meta { display: flex; gap: 12px; margin-top: 8px; }
.station-meta span {
  font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px;
}
.station-meta .open { color: var(--primary); }
.station-meta .closed { color: var(--red); }
.station-prices { text-align: right; min-width: 100px; }
.station-prices .price-main {
  font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.station-prices .price-fuel { font-size: 11px; color: var(--text-muted); }
.price-green { color: var(--primary); }
.price-yellow { color: var(--yellow); }
.price-red { color: var(--red); }
.station-prices .price-others {
  display: flex; gap: 10px; margin-top: 6px; justify-content: flex-end;
}
.station-prices .price-small { font-size: 13px; color: var(--text-secondary); font-weight: 600; }

/* --- Rankings Table --- */
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th {
  text-align: left; padding: 12px 16px; color: var(--text-muted); font-size: 12px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.ranking-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.ranking-table tr:hover td { background: var(--bg-card); }
.ranking-table .rank {
  font-weight: 800; color: var(--text-muted); width: 40px;
}
.ranking-table .rank-top { color: var(--primary); }
.ranking-table .city-name { font-weight: 600; }
.ranking-table .city-name a { color: var(--text); }
.ranking-table .city-name a:hover { color: var(--primary); }
.ranking-table .price { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }

/* --- Chart --- */
.chart-container {
  background: var(--bg-card); border-radius: var(--radius); padding: 24px;
  border: 1px solid var(--border);
}
.chart-container h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.chart-canvas { width: 100%; height: 300px; }

/* --- News --- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.news-card {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); transition: all var(--transition);
}
.news-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.news-card img { width: 100%; height: 200px; object-fit: cover; }
.news-card-body { padding: 20px; }
.news-card .news-category {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--primary); margin-bottom: 8px;
}
.news-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
.news-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.news-card .news-date { color: var(--text-muted); font-size: 12px; margin-top: 12px; }

/* --- App Download CTA --- */
.cta-section {
  background: linear-gradient(135deg, rgba(0,230,118,0.08) 0%, rgba(59,130,246,0.05) 100%);
  border: 1px solid rgba(0,230,118,0.15); border-radius: var(--radius);
  padding: 48px; text-align: center; margin: 40px 0;
}
.cta-section h2 { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.cta-section p { color: var(--text-secondary); margin-bottom: 24px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius-sm); font-weight: 700;
  font-size: 15px; cursor: pointer; border: none; transition: all var(--transition);
  font-family: var(--font);
}
.btn-primary { background: var(--primary); color: var(--bg); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); color: var(--bg); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* --- Stats Row --- */
.stats-row { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin: 40px 0; }
.stat-item { text-align: center; }
.stat-value { font-size: 32px; font-weight: 900; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* --- Price Boxes --- */
.price-boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 32px; }
.price-box {
  background: var(--bg-card); border-radius: var(--radius); padding: 24px; text-align: center;
  border: 1px solid var(--border);
}
.price-box .fuel-label { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.price-box .fuel-price { font-size: 36px; font-weight: 900; font-variant-numeric: tabular-nums; }
.price-box .fuel-trend { font-size: 12px; margin-top: 4px; }

/* --- Footer --- */
.footer {
  background: var(--bg-surface); border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px;
}
.footer-brand { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.footer-brand span { color: var(--primary); }
.footer-desc { color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.footer h4 { font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.footer ul li { margin-bottom: 10px; }
.footer ul a { color: var(--text-muted); font-size: 14px; }
.footer ul a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-muted); font-size: 13px;
}

/* --- Breadcrumb --- */
.breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 24px; font-size: 14px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-muted); }

/* --- Article --- */
.article-content { max-width: 720px; }
.article-content h1 { font-size: 32px; font-weight: 900; margin-bottom: 16px; line-height: 1.2; }
.article-content .article-meta { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }
.article-content p { margin-bottom: 16px; color: var(--text-secondary); line-height: 1.8; }
.article-content h2 { font-size: 22px; font-weight: 800; margin: 32px 0 12px; color: var(--text); }
.article-content img { border-radius: var(--radius); margin: 24px 0; }

/* --- Loading / Empty --- */
.loading { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile { display: block; }
  .nav-search-toggle { display: block; }
  .nav-search.open { display: block !important; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-surface); border-bottom: 1px solid var(--border); padding: 16px; z-index: 99; }
  .hero { padding: 50px 0 40px; }
  .search-box { flex-direction: column; }
  .search-box select { border-left: none; border-top: 1px solid var(--border); }
  .price-boxes { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .city-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .cta-section { padding: 32px 20px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 480px) {
  .city-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .ticker-inner { flex-direction: column; gap: 12px; }
  .price-boxes { grid-template-columns: 1fr; }
}

/* --- Autocomplete --- */
.search-wrapper { position: relative; flex: 1; }
.search-wrapper input { width: 100%; }
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--bg-card); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); max-height: 280px; overflow-y: auto;
  display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
  padding: 12px 16px; cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; font-size: 14px; border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.autocomplete-item:hover, .autocomplete-item.active { background: var(--bg-elevated); }
.autocomplete-item .ac-name { font-weight: 600; }
.autocomplete-item .ac-state { color: var(--text-muted); font-size: 12px; }
.autocomplete-item .ac-flag { font-size: 12px; color: var(--text-muted); }

/* --- Map --- */
.map-container {
  width: 100%; height: 450px; border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden; margin-bottom: 24px;
}
.map-toggle {
  display: flex; gap: 0; margin-bottom: 16px; background: var(--bg-card);
  border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border);
  width: fit-content;
}
.map-toggle button {
  padding: 10px 20px; border: none; background: none; color: var(--text-secondary);
  font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.map-toggle button.active { background: var(--primary); color: var(--bg); }
.map-price-marker { background: none !important; border: none !important; }
@media (max-width: 768px) {
  .map-container { height: 300px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* --- Scroll to Top --- */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: var(--bg); border: none;
  font-size: 20px; cursor: pointer; display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,230,118,0.3);
  transition: all var(--transition);
}
.scroll-top:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,230,118,0.4); }
.scroll-top.visible { display: flex; }

/* --- Skeleton Loading --- */
.skeleton-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border); height: 120px; position: relative; overflow: hidden;
}
.skeleton-card::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { left: 100%; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* --- Search Mode Toggle --- */
.search-mode-toggle {
  background: var(--bg-card); border-radius: 50px; overflow: hidden;
  border: 1px solid var(--border); width: fit-content; margin: 0 auto 20px;
  padding: 4px; position: relative;
}
.search-mode-btn {
  padding: 10px 28px; border: none; background: none; color: var(--text-muted);
  font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 50px;
  position: relative; z-index: 1;
}
.search-mode-btn:hover:not(.active) { color: var(--text); }
.search-mode-btn.active {
  color: var(--bg); background: var(--primary);
  box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
}
.search-mode-btn:last-child.active {
  background: var(--blue);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* --- Charging Station Card --- */
.charging-card:hover {
  border-color: rgba(59,130,246,0.3); transform: translateX(6px);
  box-shadow: -4px 0 20px rgba(59,130,246,0.08);
}

/* --- Mobile App Banner --- */
.mobile-app-banner { display: none; }
@media (max-width: 768px) {
  .mobile-app-banner {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
    background: rgba(18, 20, 29, 0.95); backdrop-filter: blur(20px);
    border-top: 1px solid var(--border); padding: 10px 16px;
    align-items: center; justify-content: space-between; gap: 8px; font-size: 14px;
  }
  .scroll-top { bottom: 70px; }
}

/* --- Error State --- */
.error-state {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.error-state button {
  margin-top: 12px; padding: 8px 20px; background: var(--primary); color: var(--bg);
  border: none; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer;
  font-family: var(--font);
}
