/* Theme Variables */
:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #6a6a6a;
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: rgba(0, 0, 0, 0.1);
    --accent-color: #000000;
}

:root[data-theme="dark"] {
    --bg-primary: #0b0b0f;
    --bg-secondary: #151520;
    --bg-tertiary: #1f1f2e;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #b0b0b0;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.5);
    --accent-color: #ffffff;
}

/* Global Scrollbar Fix */
html {
    overflow: hidden;
    height: 100%;
}

body {
    overflow: auto;
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Remove extra scrollbars */
.page {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.snap-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.snap-container::-webkit-scrollbar {
    width: 8px;
}

.snap-container::-webkit-scrollbar-track {
    background: transparent;
}

.snap-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.snap-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px var(--shadow);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px var(--shadow);
    background: var(--glass-bg);
    border-color: var(--accent-color);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(15deg);
}

/* Glassmorphic Effects */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 12px 48px var(--shadow);
    transform: translateY(-2px);
}

/* Button Animations */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-animated:hover::before {
    width: 300px;
    height: 300px;
}

.btn-animated:active {
    transform: scale(0.98);
}

/* Text Contrast Fixes */
.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-tertiary {
    color: var(--text-tertiary) !important;
}

/* Ensure readable text on glass backgrounds */
.glass-card,
.vehicle-hero-field,
.battery-hero-content,
.checkout-box,
.checkout-summary {
    color: var(--text-primary);
}

.glass-card p,
.glass-card span,
.glass-card label,
.vehicle-hero-field p,
.vehicle-hero-field span,
.vehicle-hero-field label,
.battery-hero-content p,
.battery-hero-content span,
.battery-hero-content label,
.checkout-box p,
.checkout-box span,
.checkout-box label {
    color: var(--text-primary);
}

/* Ensure strong contrast for important text */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

p, span, label, div {
    color: var(--text-primary);
}

/* Links */
a {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--text-primary);
}

/* Code elements */
code {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Footer Theme Toggle */
.footer-theme-toggle {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

/* Navbar Theme Toggle */
.wbs-nav-center-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

