/* ==========================================================================
   MOBLIS.id — Futuristic Electric Vehicle Design System (Dark & Light Mode)
   Primary Accent: #00a8ff | Dark Void: #0a0e17 | Light Ice: #f1f6fb
   ========================================================================== */

:root {
  --primary: #00a8ff;
  --primary-dark: #0088cc;
  --primary-light: #33bbff;
  --bg-dark: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1a1f2e;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --neon-glow: rgba(0, 168, 255, 0.3);
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
}

html.light {
  color-scheme: light;
  --bg-dark: #f1f6fb;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fbff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --neon-glow: rgba(0, 168, 255, 0.22);
}

/* Base Smoothness & Scrollbars */
html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #070a11;
}

html.light ::-webkit-scrollbar-track {
  background: #e2ecf6;
}

::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 9999px;
  border: 2px solid #070a11;
}

html.light ::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-color: #e2ecf6;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 168, 255, 0.65);
}

/* Glassmorphism Surfaces */
.glass {
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.88) 0%, rgba(26, 31, 46, 0.76) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.28s ease,
              box-shadow 0.28s ease,
              background 0.25s ease;
}

.glass-card:hover {
  border-color: rgba(0, 168, 255, 0.45);
  box-shadow: 0 18px 46px -18px rgba(0, 168, 255, 0.35);
}

.glass-elevated {
  background: rgba(26, 31, 46, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 168, 255, 0.22);
}

.glass-input {
  background: rgba(10, 14, 23, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.glass-input::placeholder {
  color: var(--text-secondary);
}

.glass-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(17, 24, 39, 0.95);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.22), 0 0 22px -6px rgba(0, 168, 255, 0.45);
}

/* ==========================================================================
   Futuristic EV Light Mode System (html.light)
   ========================================================================== */
html.light body {
  background-color: #f1f6fb !important;
  color: #0f172a !important;
}

html.light .ev-grid-bg {
  background-image:
    linear-gradient(to right, rgba(0, 168, 255, 0.075) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 168, 255, 0.075) 1px, transparent 1px);
}

html.light #moblis-navbar {
  background-color: rgba(255, 255, 255, 0.88) !important;
  border-bottom-color: rgba(0, 168, 255, 0.28) !important;
  box-shadow: 0 10px 30px -14px rgba(15, 23, 42, 0.12) !important;
}

html.light #moblis-navbar > div:first-child {
  background-color: rgba(241, 246, 251, 0.9) !important;
  border-bottom-color: rgba(15, 23, 42, 0.07) !important;
}

html.light #moblis-mobile-drawer,
html.light #moblis-search-dropdown,
html.light #hero-search-dropdown,
html.light #moblis-floating-compare,
html.light #compare-sticky-bar {
  background-color: rgba(255, 255, 255, 0.97) !important;
  border-color: rgba(0, 168, 255, 0.3) !important;
  box-shadow: 0 20px 50px -15px rgba(15, 23, 42, 0.16) !important;
}

html.light footer {
  background-color: #ffffff !important;
  color: #334155 !important;
  border-top-color: rgba(0, 168, 255, 0.28) !important;
}

html.light .glass,
html.light .glass-card,
html.light .car-card,
html.light .stat-card,
html.light .feature-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 251, 255, 0.92) 100%) !important;
  border-color: rgba(15, 23, 42, 0.09) !important;
  box-shadow: 0 10px 30px -16px rgba(15, 23, 42, 0.12);
}

html.light .glass-card:hover,
html.light .car-card:hover {
  border-color: rgba(0, 168, 255, 0.55) !important;
  box-shadow: 0 16px 38px -14px rgba(0, 168, 255, 0.25) !important;
}

html.light .glass-elevated {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(235, 246, 255, 0.92) 100%) !important;
  border-color: rgba(0, 168, 255, 0.32) !important;
  box-shadow: 0 18px 44px -18px rgba(0, 168, 255, 0.24) !important;
}

html.light .glass-input,
html.light select,
html.light input[type="text"],
html.light input[type="search"],
html.light input[type="email"],
html.light input[type="number"],
html.light input[type="password"],
html.light input[type="url"],
html.light textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.16);
}

html.light .glass-input:focus {
  background-color: #ffffff !important;
  border-color: #00a8ff !important;
}

/* Remap Tailwind dark-hex surfaces across pages & admin */
html.light [class*="bg-[#111827]"],
html.light [class*="bg-[#162033]"],
html.light [class*="bg-[#0d1322]"] {
  background-color: rgba(255, 255, 255, 0.94) !important;
}

/* Newsletter CTA Card — Desain responsif & kontras tinggi untuk Dark & Light Mode */
.moblis-newsletter-card {
  background: linear-gradient(135deg, #0b1b34 0%, #102442 50%, #091529 100%);
  border: 1px solid rgba(0, 168, 255, 0.38);
  box-shadow: 0 24px 60px -20px rgba(0, 168, 255, 0.42);
}

html.light .moblis-newsletter-card {
  background: linear-gradient(135deg, #ffffff 0%, #eef7ff 52%, #dff1ff 100%) !important;
  border: 1px solid rgba(0, 168, 255, 0.35) !important;
  box-shadow: 0 22px 52px -22px rgba(0, 136, 204, 0.28) !important;
}

/* Siluet Peta Indonesia di kanvas gelap SPKLU agar menyala biru elektrik futuristik */
.moblis-indo-map-img {
  filter: brightness(0) invert(1) sepia(1) saturate(4.5) hue-rotate(174deg) opacity(0.36) drop-shadow(0 0 10px rgba(0, 168, 255, 0.5));
}

html.light [class*="bg-[#1a1f2e]"] {
  background-color: #eef5fc !important;
}

html.light [class*="bg-[#0a0e17]"]:not(figure *):not(.keep-dark):not([data-keep-dark]) {
  background-color: #edf4fb !important;
}

html.light [class*="from-[#111827]"]:not(figure *):not(.keep-dark):not([data-keep-dark]),
html.light [class*="from-[#1a1f2e]"]:not(figure *):not(.keep-dark):not([data-keep-dark]),
html.light [class*="from-[#0a0e17]"]:not(figure *):not(.keep-dark):not([data-keep-dark]) {
  --tw-gradient-from: #ffffff var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgba(241, 246, 251, 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html.light [class*="via-[#111827]"]:not(figure *):not(.keep-dark):not([data-keep-dark]),
html.light [class*="via-[#1a1f2e]"]:not(figure *):not(.keep-dark):not([data-keep-dark]),
html.light [class*="via-[#0a0e17]"]:not(figure *):not(.keep-dark):not([data-keep-dark]),
html.light [class*="via-[#162033]"]:not(figure *):not(.keep-dark):not([data-keep-dark]) {
  --tw-gradient-via-position: 50%;
  --tw-gradient-stops: var(--tw-gradient-from), #f4f9ff var(--tw-gradient-via-position), var(--tw-gradient-to) !important;
}

html.light [class*="to-[#111827]"]:not(figure *):not(.keep-dark):not([data-keep-dark]),
html.light [class*="to-[#1a1f2e]"]:not(figure *):not(.keep-dark):not([data-keep-dark]),
html.light [class*="to-[#0a0e17]"]:not(figure *):not(.keep-dark):not([data-keep-dark]) {
  --tw-gradient-to: #e8f2fc var(--tw-gradient-to-position) !important;
}

html.light [class*="to-transparent"] {
  --tw-gradient-to: transparent var(--tw-gradient-to-position) !important;
}

html.light .car-photo-fade {
  display: none !important;
}

html.light [data-car-card] figure {
  background-color: #f8fafc !important;
}

html.light [class*="bg-white/5"],
html.light [class*="bg-white/[0.0"] {
  background-color: rgba(15, 23, 42, 0.045) !important;
}

html.light [class*="bg-white/10"] {
  background-color: rgba(15, 23, 42, 0.07) !important;
}

/* Preserve dark media containers & photo gradient overlays */
html.light figure:not([data-car-card] figure),
html.light #youtube-lite-player,
html.light [data-spklu-map-canvas] {
  background-color: #0f172a !important;
}

/* Remap text colors in Light Mode */
html.light .text-white:not(figure *):not(#youtube-lite-player *):not([data-keep-white]):not(.keep-white):not(.tab-item.is-active):not([class*="bg-[#00a8ff]"]:not([class*="bg-[#00a8ff]/"])) {
  color: #0f172a !important;
}

html.light .bg-clip-text.from-white {
  --tw-gradient-from: #0f172a var(--tw-gradient-from-position) !important;
}

html.light .text-slate-100:not(figure *),
html.light .text-slate-200:not(figure *),
html.light .text-gray-100:not(figure *),
html.light .text-gray-200:not(figure *) {
  color: #1e293b !important;
}

html.light .text-slate-300:not(figure *),
html.light .text-gray-300:not(figure *) {
  color: #334155 !important;
}

html.light .text-slate-400:not(figure *),
html.light .text-gray-400:not(figure *) {
  color: #475569 !important;
}

html.light .text-slate-500:not(figure *),
html.light .text-gray-500:not(figure *) {
  color: #64748b !important;
}

html.light .text-cyan-300:not(figure *) {
  color: #0284c7 !important;
}

html.light .text-emerald-300:not(figure *) {
  color: #047857 !important;
}

html.light .text-emerald-400:not(figure *) {
  color: #059669 !important;
}

html.light .text-amber-300:not(figure *),
html.light .text-amber-400:not(figure *) {
  color: #b45309 !important;
}

html.light .text-rose-300:not(figure *) {
  color: #be123c !important;
}

/* Remap white hairline borders & dividers in Light Mode */
html.light [class*="border-white/"] {
  border-color: rgba(15, 23, 42, 0.12) !important;
}

html.light [class*="divide-white/"] > :not([hidden]) ~ :not([hidden]) {
  border-color: rgba(15, 23, 42, 0.08) !important;
}

html.light .calc-ring-track {
  stroke: rgba(15, 23, 42, 0.1) !important;
}

/* Neon Effects & Futuristic Accents */
.neon-text {
  color: var(--primary);
  text-shadow: 0 0 18px rgba(0, 168, 255, 0.55);
}

html.light .neon-text {
  color: #0284c7;
  text-shadow: 0 0 14px rgba(0, 168, 255, 0.25);
}

.neon-border {
  border: 1px solid rgba(0, 168, 255, 0.45);
  box-shadow: 0 0 24px -6px var(--neon-glow), inset 0 0 14px -8px var(--neon-glow);
}

.neon-line {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 168, 255, 0.85) 50%, transparent 100%);
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.6);
}

.heading-accent {
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
}

.heading-accent::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3.5rem;
  height: 3px;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--primary), #00f2fe);
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.7);
}

/* Futuristic Animated Grid / Circuit Backdrop */
.hero-grid {
  background-image:
    linear-gradient(to right, rgba(0, 168, 255, 0.065) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 168, 255, 0.065) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 35%, #000 35%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 35%, transparent 80%);
}

/* Animations & Scroll Reveals */
@keyframes moblisFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes moblisSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes moblisPulseGlow {
  0%, 100% { box-shadow: 0 0 18px -4px rgba(0, 168, 255, 0.35); }
  50% { box-shadow: 0 0 34px 0 rgba(0, 168, 255, 0.7); }
}

@keyframes moblisFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

@keyframes moblisSkeletonShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-in {
  animation: moblisFadeIn 0.55s ease-out both;
}

.animate-slide-up {
  animation: moblisSlideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-pulse-glow {
  animation: moblisPulseGlow 2.8s ease-in-out infinite;
}

.animate-float {
  animation: moblisFloat 4.2s ease-in-out infinite;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease-out, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].animate-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Card & Component Patterns */
.car-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.94), rgba(26, 31, 46, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1rem;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.28s ease,
              box-shadow 0.28s ease;
}

.car-card:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(0, 168, 255, 0.65);
  box-shadow: 0 0 36px -8px rgba(0, 168, 255, 0.45);
}

.stat-card,
.feature-card {
  background: rgba(17, 24, 39, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  backdrop-filter: blur(14px);
}

/* Tabs */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab-item {
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  cursor: pointer;
}

html.light .tab-item {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

.tab-item:hover {
  color: #ffffff;
  border-color: rgba(0, 168, 255, 0.4);
}

html.light .tab-item:hover {
  color: #0284c7;
}

.tab-item.is-active,
.tab-item[aria-selected="true"] {
  color: #0a0e17 !important;
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 22px -4px rgba(0, 168, 255, 0.6);
}

.tab-content.is-hidden {
  display: none;
}

/* Tables */
.spec-table,
.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table th,
.spec-table td,
.compare-table th,
.compare-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

html.light .spec-table th,
html.light .spec-table td,
html.light .compare-table th,
html.light .compare-table td {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

.compare-table td.is-best {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  font-weight: 700;
}

html.light .compare-table td.is-best {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #00a8ff 0%, #0284c7 100%);
  color: #0a0e17;
  font-weight: 700;
  box-shadow: 0 0 24px -4px rgba(0, 168, 255, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 32px -2px rgba(0, 168, 255, 0.75);
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  border-radius: 0.85rem;
  background: rgba(10, 14, 23, 0.65);
  border: 1px solid rgba(0, 168, 255, 0.45);
  color: var(--primary);
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

html.light .btn-outline {
  background: rgba(255, 255, 255, 0.9);
  color: #0284c7;
}

.btn-outline:hover {
  background: rgba(0, 168, 255, 0.14);
  border-color: var(--primary);
  color: #ffffff;
}

html.light .btn-outline:hover {
  color: #0f172a;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  color: var(--text-secondary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

html.light .btn-ghost:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

/* Badges */
.badge-success {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

html.light .badge-success {
  color: #047857;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

html.light .badge-warning {
  color: #b45309;
}

.badge-info {
  background: rgba(0, 168, 255, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(0, 168, 255, 0.35);
}

html.light .badge-info {
  color: #0284c7;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

html.light .badge-danger {
  color: #b91c1c;
}

/* Skeleton Loader & Rating Stars */
.skeleton {
  background: linear-gradient(90deg, #111827 25%, #1f2937 50%, #111827 75%);
  background-size: 200% 100%;
  animation: moblisSkeletonShimmer 1.5s infinite linear;
  border-radius: 0.75rem;
}

html.light .skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
}

.rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: #fbbf24;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
