/* Modern Custom CSS for EV Smart Calculators & Hub */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #10b981;
    --accent: #f59e0b;
    --background: #f8fafc;
    --card: #ffffff;
    --foreground: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --input-bg: #f1f5f9;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    --background: #0f172a;
    --card: #1e293b;
    --foreground: #f8fafc;
    --muted: #94a3b8;
    --border: #334155;
    --input-bg: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* Header & Nav */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.logo svg {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle, .mobile-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--foreground);
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover, .mobile-toggle:hover {
    background-color: var(--input-bg);
}

.mobile-toggle {
    display: none;
}

/* Mobile Drawer */
.mobile-menu {
    display: none;
    flex-direction: column;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 1rem;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    color: var(--foreground);
    text-decoration: none;
    font-weight: 500;
}

/* Main Content & Layout */
main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2.5rem 1.5rem;
}

.hero {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem auto;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.15rem;
    color: var(--muted);
    line-height: 1.6;
}

/* Grid & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.75rem;
}

.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.card-desc {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

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

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
}

.btn-secondary:hover {
    background-color: var(--input-bg);
}

/* Calculator Specific Styling */
.calc-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 3rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.form-control, select.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--foreground);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
}

.results-panel {
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-item {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.result-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.result-label {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.result-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 0.25rem;
}

.result-value.accent {
    color: var(--secondary);
}

/* Article / Content Pages */
.article-container {
    max-width: 820px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.article-meta {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.editorial-note {
    background-color: var(--input-bg);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

.prose h2 {
    font-size: 1.65rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.prose h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    color: var(--foreground);
    line-height: 1.7;
}

.prose ul, .prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--border);
}

th {
    background-color: var(--input-bg);
    font-weight: 600;
}

/* AdSense Slot Placeholder */
.adsense-slot {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--input-bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer */
footer {
    background-color: var(--card);
    border-top: 1px solid var(--border);
    padding: 3rem 1.5rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-toggle { display: block; }
    .calc-container { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
}
