/**
 * Calculadora de Combustível
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');


/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #1e293b;
    --secondary-color: #0f172a;
    --accent-color: #0ea5e9;
    --accent-2: #3b82f6;
    --surface-color: #ffffff;
    --text-color: #334155;
    --text-contrast: #ffffff;

    --primary-hover: #334155;
    --primary-light: #64748b;
    --accent-hover: #0284c7;
    --accent-glow: rgba(14, 165, 233, 0.2);
    --bg-color: #f8fafc;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;

    --border-radius: 16px;
    --border-radius-sm: 8px;
    --spacing-unit: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 64px;
    --bottom-nav-height: 68px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.03);
    --shadow-glow: 0 0 0 3px var(--accent-glow);
}

/* Dark Mode via media query (padrão do sistema) */
@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        --bg-color: #0f172a;
        --surface-color: #1e293b;
        --text-color: #f8fafc;
        --text-muted: #94a3b8;
        --border-color: #334155;
        --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
        --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.25);
    }
}

/* Dark Mode via classe (toggle manual) */
body.dark-mode {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.25);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: clamp(14px, 2.5vw, 16px);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-top: var(--header-height);
    padding-bottom: var(--bottom-nav-height);
    min-height: 100vh;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

/* ===== HEADER FIXO ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(241, 245, 249, 0.82);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 4px 24px rgba(0,0,0,0.06);
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(226,232,240,0.8);
    transition: var(--transition);
}

body.dark-mode .app-header {
    background: rgba(22, 27, 39, 0.85);
    border-bottom: 1px solid rgba(30,41,59,0.8);
    box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 4px 24px rgba(0,0,0,0.2);
}

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) .app-header {
        background: rgba(22, 27, 39, 0.85);
        border-bottom: 1px solid rgba(30,41,59,0.8);
        box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 4px 24px rgba(0,0,0,0.2);
    }
}

.header-logo h1 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

body.dark-mode .header-logo h1 {
    color: var(--text-color);
}

.header-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.header-logo i {
    color: var(--accent-color);
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: 8px;
    }
    
    .desktop-nav .nav-link {
        padding: 7px 16px;
        border-radius: 10px;
        color: var(--text-muted);
        text-decoration: none;
        font-weight: 600;
        font-size: 0.9rem;
        transition: var(--transition);
    }
    
    .desktop-nav .nav-link:hover {
        color: var(--text-color);
        background: var(--border-color);
    }

    .desktop-nav .nav-link.active {
        background: var(--accent-color);
        color: white;
        box-shadow: 0 4px 12px var(--accent-glow);
    }
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-icon:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* ===== BOTTOM NAVIGATION (MOBILE) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(241, 245, 249, 0.92);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -1px 0 rgba(0,0,0,0.06), 0 -4px 24px rgba(0,0,0,0.06);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(226,232,240,0.8);
}

body.dark-mode .bottom-nav {
    background: rgba(22, 27, 39, 0.92);
    border-top: 1px solid rgba(30,41,59,0.8);
}

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) .bottom-nav {
        background: rgba(22, 27, 39, 0.92);
        border-top: 1px solid rgba(30,41,59,0.8);
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: var(--transition);
    min-width: 64px;
    min-height: 48px;
    border-radius: 12px;
}

.nav-item i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.nav-item.active {
    color: var(--accent-color);
    background: var(--accent-glow);
}

.nav-item.active i {
    transform: scale(1.2);
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }
}

/* ===== CONTAINER ===== */
.container {
    max-width: 100%;
    padding: 16px;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 24px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

.hero-section {
    background: 
        linear-gradient(135deg, rgba(30,41,59,0.7) 0%, rgba(15,23,42,0.9) 100%),
        url('../assets/hero_banner.png') center/cover no-repeat;
    color: white;
    padding: 40px 0 48px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0,173,181,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,173,181,0.2);
    border: 1px solid rgba(0,173,181,0.4);
    color: var(--accent-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero-content h2 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-content p {
    font-size: 1rem;
    opacity: 0.85;
    max-width: 480px;
    margin: 0 auto;
}

/* ===== CARDS ===== */
.card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

@media (max-width: 480px) {
    .card {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 12px;
    }
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-2));
    opacity: 0;
    transition: var(--transition);
}

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

.card:hover::before {
    opacity: 1;
}

body.dark-mode .card {
    background: var(--surface-color);
    border-color: var(--border-color);
}

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) .card {
        background: var(--surface-color);
        border-color: var(--border-color);
    }
}

.card-header {
    margin-bottom: 24px;
}

.card-header h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== FORMS ===== */
.fuel-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--accent-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    min-height: 52px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: var(--shadow-glow);
    background: var(--surface-color);
}

.form-group input.error,
.form-group select.error {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #0096a0 100%);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #007a82 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,201,212,0.3);
}

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

.btn-secondary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(16,185,129,0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16,185,129,0.35);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(239,68,68,0.25);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239,68,68,0.35);
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 140px;
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        min-width: 100%;
    }
}

/* ===== RESULTS ===== */
.results-section {
    animation: fadeInUp 0.4s ease both;
}

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

.result-item:nth-child(1) { animation: fadeInUp 0.3s 0.05s ease both; }
.result-item:nth-child(2) { animation: fadeInUp 0.3s 0.10s ease both; }
.result-item:nth-child(3) { animation: fadeInUp 0.3s 0.15s ease both; }
.result-item:nth-child(4) { animation: fadeInUp 0.3s 0.20s ease both; }

.stat-card:nth-child(1) { animation: fadeInUp 0.35s 0.05s ease both; }
.stat-card:nth-child(2) { animation: fadeInUp 0.35s 0.10s ease both; }
.stat-card:nth-child(3) { animation: fadeInUp 0.35s 0.15s ease both; }
.stat-card:nth-child(4) { animation: fadeInUp 0.35s 0.20s ease both; }

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.result-item {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.result-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,201,212,0.04) 0%, transparent 60%);
    pointer-events: none;
}

.result-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #0096a0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.result-content {
    display: flex;
    flex-direction: column;
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.result-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--accent-color);
    line-height: 1;
    letter-spacing: -0.02em;
}

.result-unit {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== ESTIMATES ===== */
.estimates-section {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.estimates-section h4 {
    color: var(--primary-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.estimates-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 768px) {
    .estimates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.estimate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--surface-color);
    border-radius: 8px;
}

.estimate-label {
    font-weight: 500;
    color: var(--text-color);
}

.estimate-value {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.1rem;
}

/* ===== STATS SECTION ===== */
.stats-section {
    margin: 32px 0;
}

.stats-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-2));
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.stat-card:hover::after {
    transform: scaleX(1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #0096a0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--accent-color);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== FAQ SECTION ===== */
.faq-section {
    margin: 40px 0;
}

.faq-section h2 {
    color: var(--primary-color);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    gap: 12px;
}

.faq-question:hover {
    color: var(--accent-color);
}

.faq-icon {
    font-size: 1.3rem;
    color: var(--accent-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border-radius: 50%;
    font-size: 1rem;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
    background: var(--accent-color);
    color: white;
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer:not([hidden]) {
    padding: 0 20px 20px;
    max-height: 500px;
}

.faq-answer p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== FOOTER ===== */
.app-footer {
    background: var(--surface-color);
    padding: 28px 0;
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.app-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), var(--accent-2), transparent);
}

.app-footer p {
    margin: 8px 0;
    color: var(--text-muted);
}

.b20-link {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.b20-link:hover {
    text-decoration: underline;
    transform: scale(1.05);
    display: inline-block;
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text-color);
    color: var(--bg-color);
    padding: 12px 28px;
    border-radius: 30px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    pointer-events: none; /* Prevents blocking clicks! */
    font-weight: 600;
    font-size: 0.95rem;
}

@media (max-width: 767px) {
    .toast {
        top: 16px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
    color: white;
}

.toast.error {
    background: var(--error-color);
    color: white;
}

/* ===== UTILITIES ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: calc(var(--spacing-unit) * 1); }
.mt-2 { margin-top: calc(var(--spacing-unit) * 2); }
.mt-3 { margin-top: calc(var(--spacing-unit) * 3); }
.mb-1 { margin-bottom: calc(var(--spacing-unit) * 1); }
.mb-2 { margin-bottom: calc(var(--spacing-unit) * 2); }
.mb-3 { margin-bottom: calc(var(--spacing-unit) * 3); }

/* ===== LOADING SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, var(--surface-color) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius);
}

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

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 767px) {
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== PAGE HEADER (historico / comparador) ===== */
.page-header {
    margin-bottom: 32px;
    padding: 24px;
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(14, 165, 233, 0.05) 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-color);
    box-shadow: 0 0 12px var(--accent-glow);
}

.page-header h2 {
    color: var(--primary-color);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-header h2 i {
    color: var(--accent-color);
    background: rgba(14, 165, 233, 0.1);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.2rem;
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.2);
}

body.dark-mode .page-header h2 {
    color: var(--text-color);
}

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) .page-header h2 {
        color: var(--text-color);
    }
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-left: 58px; /* Alinha o texto com o título, ignorando o ícone */
}

@media (max-width: 480px) {
    .page-header {
        padding: 20px 16px;
    }
    
    .page-header h2 {
        font-size: 1.3rem;
        gap: 10px;
    }
    
    .page-header h2 i {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .page-header p {
        margin-left: 46px;
        font-size: 0.9rem;
    }
}

/* ===== HISTORICO STYLES ===== */
.stats-summary {
    margin-bottom: 24px;
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 240px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.filter-select {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    flex: 1;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.history-item {
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    border-top: 4px solid var(--accent-color);
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.history-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fuel-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-date {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-delete {
    background: var(--surface-color) !important;
    border: 1px solid var(--error-color) !important;
    color: var(--error-color) !important;
}

.btn-delete:hover {
    background: var(--error-color) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

.history-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 768px) {
    .history-details {
        grid-template-columns: repeat(3, 1fr);
    }
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.detail-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-color);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 20px;
    gap: 12px;
}

.empty-state i {
    font-size: 64px;
    color: var(--text-muted);
}

.empty-state h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ===== COMPARADOR STYLES ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.winner-card {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: white;
    margin-bottom: 24px;
}

.winner-card .card-hover-off:hover {
    transform: none;
}

.winner-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.winner-icon {
    width: 80px;
    height: 80px;
    min-width: 80px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.winner-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    opacity: 0.85;
}

.winner-fuel {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.winner-savings {
    font-size: 1rem;
    opacity: 0.85;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .comparison-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.fuel-comparison-card {
    transition: var(--transition);
    padding: 0;
    overflow: hidden;
}

.fuel-header {
    padding: 16px 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.fuel-header i {
    font-size: 1.4rem;
}

.fuel-header h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.fuel-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.fuel-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-color);
    border-radius: 8px;
}

.fuel-detail-item .detail-label {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.fuel-detail-item .detail-value {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1rem;
}

.fuel-detail-item .detail-value.highlight {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.analysis-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.analysis-item i {
    font-size: 1.4rem;
    color: var(--accent-color);
    margin-top: 2px;
    flex-shrink: 0;
}

.analysis-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--primary-color);
    font-weight: 700;
}

body.dark-mode .analysis-item strong {
    color: var(--text-color);
}

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) .analysis-item strong {
        color: var(--text-color);
    }
}

.analysis-item p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
}

/* ===== FOOTER ===== */
.app-footer {
    padding: 32px 0 100px; /* Extra bottom padding for mobile bottom-nav */
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: transparent;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

@media (min-width: 768px) {
    .app-footer {
        padding-bottom: 32px;
    }
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.footer-links a:not(:last-child)::after {
    content: "•";
    position: absolute;
    right: -14px;
    color: var(--text-muted);
    opacity: 0.5;
    font-weight: normal;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.app-footer p {
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.app-footer a:hover {
    color: var(--accent-color);
}

