/* 
  Thai Fuel Price Web Application - Stylesheet
  Design System: Glassmorphism, Premium Dark/Light Themes, Fluid Typography & Animations
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  /* Fonts */
  --font-sans: 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette - Dark Mode (Default) */
  --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f0c1b 50%, #03000a 100%);
  --bg-color: #05020c;
  --card-bg: rgba(18, 12, 36, 0.5);
  --card-bg-hover: rgba(26, 18, 54, 0.65);
  --card-border: rgba(139, 92, 246, 0.15);
  --card-border-hover: rgba(139, 92, 246, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Brand/Status Accents */
  --primary: #8b5cf6; /* Indigo-purple */
  --primary-glow: rgba(139, 92, 246, 0.4);
  --secondary: #06b6d4; /* Cyan */
  --secondary-glow: rgba(6, 182, 212, 0.4);
  --success: #10b981; /* Emerald */
  --success-glow: rgba(16, 185, 129, 0.4);
  --warning: #f59e0b; /* Amber */
  --warning-glow: rgba(245, 158, 11, 0.4);
  --danger: #ef4444; /* Red */
  
  /* Station specific brand colors (for tags/badges) */
  --color-ptt: #0056b3;
  --color-bcp: #7cb342;
  --color-shell: #ffcc00;
  --color-caltex: #d32f2f;
  --color-pt: #388e3c;
  
  /* Glassmorphism settings */
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px -10px rgba(0, 0, 0, 0.7);
  --backdrop-blur: blur(16px);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  /* Layout constraints */
  --max-width: 1200px;
  --transition-speed: 0.3s;
}

/* Light Mode Override */
body.light-theme {
  --bg-gradient: radial-gradient(circle at 50% 0%, #eef2f6 0%, #dbeafe 50%, #eff6ff 100%);
  --bg-color: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-bg-hover: rgba(255, 255, 255, 0.9);
  --card-border: rgba(99, 102, 241, 0.12);
  --card-border-hover: rgba(99, 102, 241, 0.25);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --primary: #6366f1; /* Indigo */
  --primary-glow: rgba(99, 102, 241, 0.2);
  --secondary: #0d9488; /* Teal */
  --secondary-glow: rgba(13, 148, 136, 0.2);
  
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(99, 102, 241, 0.1), 0 8px 10px -6px rgba(99, 102, 241, 0.05);
  --shadow-lg: 0 20px 50px -10px rgba(99, 102, 241, 0.15);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-gradient);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 80px; /* Space for footer */
}

/* Background Glowing Orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
  transition: all var(--transition-speed) ease;
}

.bg-orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: 10%;
  left: 5%;
}

.bg-orb-2 {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  bottom: 20%;
  right: 5%;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px;
}

/* Typography Utility */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Header Component */
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

/* Main Navigation Bar */
.main-nav {
  flex: 0 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: var(--backdrop-blur);
  transition: all var(--transition-speed) ease;
}

.nav-link svg {
  flex-shrink: 0;
}

.nav-link:hover {
  transform: translateY(-2px);
  color: var(--text-primary);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-sm);
}

.nav-link-shop:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-color: transparent;
  box-shadow: 0 6px 20px -6px var(--primary-glow);
}

.nav-link-qrpay:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--success) 0%, var(--secondary) 100%);
  border-color: transparent;
  box-shadow: 0 6px 20px -6px var(--success-glow);
}

body.light-theme .nav-link {
  background: var(--card-bg-hover);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--primary-glow);
  color: white;
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.brand-logo {
  display: block;
  width: 180px;
  margin-bottom: 6px;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  transition: transform var(--transition-speed) ease, filter var(--transition-speed) ease;
}

.brand-logo:hover img {
  transform: scale(1.03);
  filter: drop-shadow(0 4px 12px var(--primary-glow));
}

body.light-theme .brand-logo img {
  filter: none;
}

.logo-text h1 {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all var(--transition-speed) ease;
}
body.light-theme .logo-text h1 {
  background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.date-badge {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed) ease;
}

.btn-icon:hover {
  background: var(--card-bg-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Glassmorphic Panel Layouts */
.glass-panel {
  background: var(--card-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-speed) ease, background var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.glass-panel:hover {
  border-color: var(--card-border-hover);
}

/* Main Grid Layout */
.main-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 992px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* Stations Selector Section */
.station-selector-wrapper {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.25rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

.station-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.station-tab {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.station-tab:hover {
  background: var(--card-bg-hover);
  color: var(--text-primary);
  border-color: var(--card-border-hover);
}

.station-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary) 50%, var(--secondary) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Price Cards Grid */
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.price-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.price-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-sm);
}

.price-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

/* Fuel Types custom highlight borders */
.price-card[data-fuel-group="gasoline"]::before { background: var(--warning); }
.price-card[data-fuel-group="gasohol_95"]::before { background: var(--primary); }
.price-card[data-fuel-group="gasohol_91"]::before { background: var(--secondary); }
.price-card[data-fuel-group="gasohol_e20"]::before { background: var(--success); }
.price-card[data-fuel-group="diesel"]::before { background: var(--text-secondary); }

.price-card .fuel-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.price-card .fuel-value-wrapper {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-card .price-number {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  font-feature-settings: "tnum";
}

body.light-theme .price-card .price-number {
  color: var(--text-primary);
}

.price-card .price-unit {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* A fuel the station did not report a price for */
.price-card.price-card-empty {
  opacity: 0.72;
}

.price-card .price-number-muted {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.price-card .price-trend {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.trend-stable { color: var(--text-muted); }
.trend-up { color: var(--danger); }
.trend-down { color: var(--success); }

/* Right Panel: Interactive Calculators & Visual Fuel Tank */
.calculator-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.calc-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

body.light-theme .calc-tabs {
  background: rgba(0, 0, 0, 0.05);
}

.calc-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  text-align: center;
  transition: all 0.2s ease;
}

.calc-tab.active {
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.calc-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.calc-content.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Input Fields and Forms Styling */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper select,
.input-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
}

body.light-theme .input-wrapper select,
body.light-theme .input-wrapper input {
  background: rgba(255, 255, 255, 0.8);
}

.input-wrapper select:focus,
.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-wrapper .input-unit {
  position: absolute;
  right: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  padding-right: 60px; /* Space for unit */
}

/* Calculator Result Block */
.result-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all var(--transition-speed) ease;
}

.result-card .result-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.result-card .result-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--secondary);
  text-shadow: 0 0 15px var(--secondary-glow);
  font-feature-settings: "tnum";
}

.result-card .result-sub-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Interactive Visual Fuel Tank Widget */
.fuel-tank-wrapper {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.fuel-tank-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.fuel-tank {
  width: 100px;
  height: 140px;
  border: 4px solid var(--text-secondary);
  border-radius: 12px 12px 8px 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.3);
}

body.light-theme .fuel-tank {
  background: rgba(255, 255, 255, 0.5);
  border-color: var(--text-secondary);
}

.fuel-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%; /* Dynamic height calculated in JS */
  background: linear-gradient(180deg, var(--secondary) 0%, var(--primary) 100%);
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--secondary-glow);
}

.fuel-liquid::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  width: 200%;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  animation: wave 3s linear infinite;
}

.fuel-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Secondary Panels: Comparison & Chart */
.comparison-section {
  margin-top: 24px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

.table-container {
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

th {
  border-bottom: 2px solid var(--card-border);
  padding: 10px 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-primary);
  font-feature-settings: "tnum";
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

body.light-theme tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-ptt { background: rgba(0, 86, 179, 0.15); color: #66b0ff; border: 1px solid rgba(0, 86, 179, 0.3); }
.badge-bcp { background: rgba(124, 179, 66, 0.15); color: #a2e060; border: 1px solid rgba(124, 179, 66, 0.3); }
.badge-shell { background: rgba(255, 204, 0, 0.15); color: #ffeb60; border: 1px solid rgba(255, 204, 0, 0.3); }
.badge-caltex { background: rgba(211, 47, 47, 0.15); color: #ff6b6b; border: 1px solid rgba(211, 47, 47, 0.3); }
.badge-pt { background: rgba(56, 142, 60, 0.15); color: #72e577; border: 1px solid rgba(56, 142, 60, 0.3); }

body.light-theme .badge-ptt { background: rgba(0, 86, 179, 0.1); color: #0056b3; }
body.light-theme .badge-bcp { background: rgba(124, 179, 66, 0.1); color: #4e801b; }
body.light-theme .badge-shell { background: rgba(255, 204, 0, 0.15); color: #8a6d00; }
body.light-theme .badge-caltex { background: rgba(211, 47, 47, 0.1); color: #b71c1c; }
body.light-theme .badge-pt { background: rgba(56, 142, 60, 0.1); color: #2e7d32; }

/* SVG Chart styling */
.chart-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-height: 250px;
}

.chart-svg {
  width: 100%;
  height: 200px;
}

.chart-bar {
  fill: var(--primary);
  opacity: 0.7;
  transition: all 0.3s ease;
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 1;
  fill: var(--secondary);
  filter: drop-shadow(0 0 6px var(--secondary-glow));
}

.chart-axis-line {
  stroke: var(--card-border);
  stroke-width: 1px;
}

.chart-text {
  fill: var(--text-secondary);
  font-size: 10px;
  font-family: var(--font-sans);
}

.chart-bar-label {
  fill: #fff;
  font-size: 10px;
  font-weight: bold;
  text-anchor: middle;
}
body.light-theme .chart-bar-label {
  fill: var(--text-primary);
}

/* Toast Notification (API status) */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  z-index: 999;
  transform: translateY(150px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateY(0);
}

.toast-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.toast-icon.success { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.toast-icon.warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.toast-icon.danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.toast-content p {
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
}

body.light-theme .toast {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
body.light-theme .toast-content p {
  color: var(--text-primary);
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius-md);
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

/* Footer style */
footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.8rem;
  color: var(--text-muted);
}
body.light-theme footer {
  background: rgba(255, 255, 255, 0.5);
}

/* Animations definitions */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes wave {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Interactive helper layouts */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 150px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.empty-state svg {
  width: 36px;
  height: 36px;
  stroke: var(--text-muted);
  margin-bottom: 8px;
}

/* History Feature Styles */
.btn-save {
  width: 100%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-speed) ease;
  margin-top: 12px;
}
.btn-save:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-save:active {
  transform: translateY(0);
}

.btn-clear {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}
.btn-clear:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
}

.history-row {
  cursor: pointer;
  transition: all 0.2s ease;
}
.history-row:hover td {
  background: rgba(139, 92, 246, 0.08) !important;
}
body.light-theme .history-row:hover td {
  background: rgba(99, 102, 241, 0.08) !important;
}

.history-row-action {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-delete-row {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-delete-row:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.history-badge-type {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}
.history-badge-budget {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
body.light-theme .history-badge-budget {
  background: rgba(13, 148, 136, 0.1);
  color: #0d9488;
}
.history-badge-liters {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
body.light-theme .history-badge-liters {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}
.history-badge-trip {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
body.light-theme .history-badge-trip {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

