/* =========================================
   Global Variables & Reset
========================================= */
:root {
    --primary-color: #4361EE; 
    --secondary-color: #F72585; 
    --bg-color: #F4F7FE; 
    --card-bg: #FFFFFF;
    --text-main: #2B2D42;
    --text-muted: #8D99AE;
    --border-radius: 20px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    --bg-color: #0F172A; 
    --card-bg: #1E293B; 
    --text-main: #F8FAFC; 
    --text-muted: #94A3B8; 
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================
   Navbar (Header)
========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: var(--card-bg);
    box-shadow: var(--box-shadow);
    transition: background-color 0.3s ease;
}

.logo { font-size: 20px; font-weight: 800; }
.highlight { color: var(--primary-color); }
.theme-btn {
    background: transparent; border: none;
    font-size: 1.4rem; cursor: pointer;
    transition: transform 0.3s ease;
}
.theme-btn:hover { transform: scale(1.2) rotate(15deg); }

/* =========================================
   Main Tool Layout
========================================= */
.tool-container {
    display: flex; justify-content: center; padding: 40px 5%;
}

.tool-card {
    background: var(--card-bg); width: 100%; max-width: 800px;
    padding: 40px; border-radius: var(--border-radius);
    box-shadow: var(--box-shadow); text-align: center;
    transition: background-color 0.3s ease;
}

.card-header { margin-bottom: 10px; }
.tool-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.subtitle { color: var(--text-muted); margin-bottom: 30px; font-size: 0.95rem; }

/* =========================================
   Calculator Layout & Inputs
========================================= */
.calculator-layout {
    text-align: left;
    margin-bottom: 30px;
}

.input-group { margin-bottom: 20px; }
.full-width { width: 100%; }

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.input-group label {
    display: block; font-weight: 800; margin-bottom: 8px;
    color: var(--text-muted); text-transform: uppercase; font-size: 0.85rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.custom-select, .input-wrapper input {
    width: 100%; padding: 15px 20px; font-size: 1.1rem; font-weight: 700;
    background-color: var(--bg-color); color: var(--text-main);
    border: 2px solid transparent; border-radius: 12px;
    outline: none; transition: border-color 0.3s, box-shadow 0.3s;
}

.custom-select {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 15px center; background-size: 15px;
}

.custom-select:focus, .input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

/* Remove arrows from number input */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none; margin: 0;
}

.input-wrapper input { padding-right: 75px; } /* Ensure text doesn't hide behind unit label */

.unit-label {
    position: absolute; right: 20px; font-weight: 800;
    color: var(--primary-color); font-size: 0.95rem;
    pointer-events: none; 
}

/* =========================================
   Buttons
========================================= */
.action-btn {
    width: 100%; padding: 18px; font-size: 1.2rem; font-weight: 800;
    background-color: var(--primary-color); color: white;
    border: none; border-radius: 12px; cursor: pointer;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
    transition: transform 0.2s, background 0.3s;
    margin-bottom: 15px;
}
.action-btn:hover { background-color: #324edb; transform: translateY(-3px); }

.clear-btn {
    width: 100%; background: rgba(141, 153, 174, 0.15); color: var(--text-main);
    border: none; padding: 15px; border-radius: 12px; font-weight: 800; font-size: 1.1rem;
    cursor: pointer; transition: background 0.3s, transform 0.2s;
    margin-bottom: 30px;
}
.clear-btn:hover { background: rgba(141, 153, 174, 0.25); transform: translateY(-2px); }

/* =========================================
   Result Display
========================================= */
.result-display {
    background: var(--bg-color); border-radius: var(--border-radius);
    padding: 30px 20px; text-align: center; border: 2px dashed rgba(141, 153, 174, 0.3);
    transition: all 0.3s ease;
}

.result-display.active {
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 15px 35px rgba(67, 97, 238, 0.3);
    transform: scale(1.02);
}

.result-label { font-size: 1.1rem; font-weight: 800; color: var(--text-main); transition: 0.3s; }
.result-display.active .result-label { color: rgba(255, 255, 255, 0.9); }

.fuel-result { 
    font-size: 3rem; font-weight: 900; color: var(--text-muted); 
    line-height: 1.2; margin: 10px 0; transition: 0.3s;
}
.result-display.active .fuel-result { color: white; }

.result-breakdown {
    background: rgba(255,255,255,0.15);
    border-radius: 10px; padding: 15px; margin: 20px auto;
    max-width: 400px; color: var(--text-main); transition: 0.3s;
}
.result-display.active .result-breakdown { color: white; }

.result-note { color: var(--text-muted); font-size: 0.95rem; font-weight: 600; transition: 0.3s; }
.result-display.active .result-note { color: rgba(255, 255, 255, 0.8); }

.hidden { display: none !important; }

/* =========================================
   SEO Content & FAQ
========================================= */
.content-section {
    max-width: 800px; margin: 0 auto 40px; padding: 30px;
    background: var(--card-bg); border-radius: var(--border-radius);
    box-shadow: var(--box-shadow); transition: background-color 0.3s ease;
}
.content-section h2 { color: var(--primary-color); margin-bottom: 20px; }
.content-section h3 { margin: 25px 0 10px; color: var(--text-main); }
.content-section p, .content-section ol { margin-bottom: 15px; color: var(--text-muted); }
.content-section ol { padding-left: 20px; }
.faq-item { margin-bottom: 20px; border-bottom: 1px solid rgba(141, 153, 174, 0.2); padding-bottom: 15px; }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-main); }
footer { text-align: center; padding: 30px 5%; margin-top: 20px; color: var(--text-muted); }

/* =========================================
   Mobile Responsiveness
========================================= */
@media (max-width: 600px) {
    .tool-card { padding: 30px 20px; }
    .input-grid { grid-template-columns: 1fr; gap: 15px; }
    .fuel-result { font-size: 2.4rem; }
    .input-group { margin-bottom: 15px; }
}

/* =========================================
   Cookie Consent Banner (Original PC, Compact Mobile)
========================================= */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px; /* Restored to original PC size */
    background: var(--card-bg);
    border-radius: var(--border-radius, 20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 20px 30px; /* Restored to original PC padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    border: 2px solid var(--primary-color);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}

/* Hidden state for smooth animation */
.cookie-banner.hidden {
    transform: translate(-50%, 150px);
    opacity: 0;
    pointer-events: none;
}

.cookie-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cookie-icon {
    font-size: 35px; /* Restored to original PC size */
}

.cookie-content p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.5;
}

.cookie-content a {
    color: var(--primary-color);
    font-weight: 800;
    text-decoration: underline;
}

.cookie-btn {
    background-color: var(--primary-color);
    padding: 12px 25px; /* Restored to original PC size */
    font-size: 1.05rem;
    width: auto;
    white-space: nowrap;
    margin-left: 20px;
}

/* =========================================
   Mobile Responsiveness (Micro Version)
========================================= */
@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        gap: 6px;
        padding: 8px 12px; /* Bare minimum top and bottom padding */
        bottom: 0; /* Flushes the banner to the absolute bottom of the screen */
        border-radius: 15px 15px 0 0; /* Rounded top, flat bottom to save space */
        border-bottom: none;
        width: 100%; /* Stretches edge-to-edge on mobile */
    }
   
    .cookie-content {
        flex-direction: row; /* Puts the emoji NEXT to the text to save a whole line of height! */
        align-items: flex-start;
        text-align: left;
        gap: 8px;
    }

    .cookie-icon {
        font-size: 18px; /* Micro emoji */
        margin-top: 2px;
    }

    .cookie-content p {
        font-size: 0.75rem; /* Smallest comfortable reading size */
        line-height: 1.2; /* Tightly packs the text lines together */
    }
   
    .cookie-btn {
        width: 100%;
        margin-left: 0;
        padding: 6px; /* Extremely thin button vertically */
        font-size: 0.85rem;
        border-radius: 8px;
    }
}