:root {
    /* Modern Color Palette */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #f3f4f6;
    --accent: #f59e0b;
    
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    
    --bg-body: #ffffff;
    --bg-surface: #f9fafb;
    --bg-card: #ffffff;
    
    --border: #e5e7eb;
    --border-hover: #d1d5db;
    
    --success: #059669;
    --error: #dc2626;
    
    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Global Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.5;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    letter-spacing: -0.025em;
    font-weight: 700;
    color: var(--text-main);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    border-color: var(--border);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface);
}

.btn-text {
    background: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 4px 8px;
}

.btn-text:hover {
    color: var(--primary);
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* Header */
#main-header {
    height: 56px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

#main-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#main-nav ul {
    display: flex;
    list-style: none;
    gap: 24px;
}

#main-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

#main-nav a:hover {
    color: var(--primary);
}

/* Hero Section - Compact */
#hero {
    margin-top: 56px;
    padding: 40px 0 30px;
    text-align: center;
    background: radial-gradient(circle at top, #f0f9ff 0%, white 60%);
}

.hero-content h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 12px;
}

.subheadline {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 24px;
}

.cta-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 0; 
}

.hero-visual {
    display: none;
}

/* Horizontal Scroll Cards Layout */
.scroll-container {
    position: relative;
    display: flex;
    align-items: center;
}

.scroll-content {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 10px 4px;
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    width: 100%;
}

.scroll-content::-webkit-scrollbar { 
    display: none; 
}

.scroll-content > * {
    flex: 0 0 240px; /* Adjusted for 4 items visibility */
    scroll-snap-align: start;
}

.scroll-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 10;
    flex-shrink: 0;
    color: var(--primary);
    font-weight: bold;
    transition: all 0.2s;
}

.scroll-btn:hover {
    background: var(--bg-surface);
    transform: scale(1.1);
}

.scroll-btn.left { margin-right: 10px; }
.scroll-btn.right { margin-left: 10px; }


/* Features Section */
#features {
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
}

.feature-card {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.feature-card .icon {
    font-size: 1.5rem;
}

.feature-card h3 {
    font-size: 1rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

#features h2, #converter h2, #savings h2, #faq h2, #blog h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    text-align: center;
}

/* Tool Dashboard - Side-by-Side on Desktop */
#tool-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
    background: var(--bg-surface);
}

@media (min-width: 1024px) {
    #tool-dashboard {
        flex-direction: row;
        align-items: stretch;
        max-width: 1400px;
        margin: 0 auto;
        padding: 30px 20px;
    }
    
    #tool-dashboard > section {
        flex: 1;
        padding: 0 !important;
        background: transparent !important;
        min-width: 0;
    }

    #tool-dashboard .container {
        max-width: none;
        padding: 0 10px;
    }
}

/* Tabbed Interface Styles */
.tabbed-interface {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(0,0,0,0.02);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tab-pane {
    display: none;
    padding: 16px;
    flex: 1;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

#sample-selector {
    padding-left: 4px;
    padding-right: 4px;
    max-width: 90px;
}

/* Converter Inputs */
.controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px; /* Space for scrollbar if visible */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.controls-top::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.controls-top > * {
    flex-shrink: 0;
}

/* Mobile Text Toggle */
.mobile-text { display: none; }
.desktop-text { display: inline; }

@media (max-width: 768px) {
    .controls-top {
        justify-content: flex-start; /* Align left on mobile to allow scroll */
    }
    
    .mobile-text { display: inline; }
    .desktop-text { display: none; }
}

select, input[type="file"] {
    font-size: 0.85rem;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
}

textarea {
    width: 100%;
    height: auto;
    min-height: 300px;
    padding: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    resize: none;
    background: #f8fafc;
    color: var(--text-main);
    line-height: 1.4;
    flex: 1;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.conversion-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.stats {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
}

.error-message {
    color: var(--error);
    font-size: 0.8rem;
    text-align: center;
    margin-top: 8px;
    width: 100%;
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.stat-card-mini {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card-mini h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.big-number {
    font-size: 1.4rem;
    font-weight: 800;
    display: inline-block;
}

.unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.text-green { color: var(--success); }
.text-accent { color: var(--accent); }

.comparison-table-container {
    background: var(--bg-card);
    overflow: hidden;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-surface);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.chart-container-large {
    height: 300px;
    width: 100%;
    background: white;
}

/* FAQ - Compact */
#faq {
    padding: 30px 0;
    background: var(--bg-surface);
}

.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: none;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer p {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: #fcfcfc;
}

/* Blog - Cards */
#blog {
    padding: 30px 0;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.blog-content {
    padding: 16px;
}

.blog-content h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.blog-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.read-more {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Footer */
footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 0;
    color: var(--text-muted);
}

.footer-content {
    text-align: center;
    font-size: 0.9rem;
}

.footer-links {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}
