﻿:root {
    --page: #f4f7fb;
    --ink: #142033;
    --muted: #64748b;
    --line: #dbe5f1;
    --panel: #ffffff;
    --primary: #0b5ed7;
    --rise: #dc2626;
    --drop: #15803d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
    background: #0d6efd;
    color: #fff;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.brand-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 25px;
    margin-left: auto;
    flex-wrap: wrap;
}

.mobile-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.menu-line {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    display: block;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
}

.nav-menu a:hover,
.nav-menu a:focus {
    color: rgba(255, 255, 255, 0.82);
}

.social-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-links a {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
}

.social-links svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.page-shell {
    width: min(100%, 1220px);
    margin: 0 auto;
    padding: 0 16px;
}

.hero {
    padding: 28px 0 18px;
}

.eyebrow {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.02;
    margin: 6px 0 10px;
    letter-spacing: 0;
}

.hero p {
    max-width: 720px;
    color: var(--muted);
    font-size: 1.05rem;
    margin: 0;
}

.panel,
.price-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.price-card {
    min-height: 126px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-top-width: 4px;
    border-top-style: solid;
}

#summaryCards {
    justify-content: center;
}

.highest-card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    justify-content: center;
}

.highest-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-top-width: 4px;
    border-top-style: solid;
    border-radius: 8px;
    padding: 16px;
    min-height: 122px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.highest-card-price {
    font-size: 1.55rem;
    line-height: 1.15;
    font-weight: 800;
    margin-top: 12px;
}

.highest-card-date {
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: 6px;
    font-weight: 700;
}

.fuel-card-LP_92 {
    border-top-color: #2563eb;
}

.fuel-card-LP_95 {
    border-top-color: #dc2626;
}

.fuel-card-LAD {
    border-top-color: #16a34a;
}

.fuel-card-LSD {
    border-top-color: #7c3aed;
}

.fuel-card-LK {
    border-top-color: #ea580c;
}

.price-label {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.price-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: 0;
}

.change-pill {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 28px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.83rem;
    font-weight: 700;
    background: #eef2f7;
    color: #475569;
}

.change-pill.up {
    background: #fee2e2;
    color: var(--rise);
}

.change-pill.down {
    background: #dcfce7;
    color: var(--drop);
}

.filter-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-actions .apply-button {
    white-space: nowrap;
}

.filter-actions .reset-button {
    white-space: nowrap;
}

.chart-wrap {
    height: 520px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
}

.history-search-filter {
    min-width: 220px;
}

.history-year-filter {
    width: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    margin-left: auto;
}



#historyYearHome {
    display: none;
}

.table {
    --bs-table-striped-bg: #f8fbff;
}

.table th,
.table td {
    white-space: nowrap;
}

.site-footer {
    position: relative;
    min-height: 72px;
    margin-top: 28px;
    background: #0d6efd;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 58px;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.scroll-top {
    position: absolute;
    right: 30px;
    top: 10px;
    width: 31px;
    height: 31px;
    border: 0;
    border-radius: 2px;
    background: #00068f;
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.scroll-top:hover,
.scroll-top:focus {
    background: #00046d;
}

@media (max-width: 991px) {
    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-grid .filter-action {
        grid-column: 1 / -1;
    }

    .highest-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .page-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .site-nav {
        align-items: center;
        flex-direction: row;
        gap: 12px;
        flex-wrap: wrap;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-menu {
        display: none;
        width: 100%;
        margin-left: 0;
        padding: 12px 0 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.28);
        justify-content: flex-start;
        align-items: stretch;
        flex-direction: column;
        gap: 0;
    }

    .site-nav.menu-open .nav-menu {
        display: flex;
    }

    .nav-menu a {
        min-height: 42px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    }

    .social-links {
        padding-top: 12px;
    }

    .brand-logo {
        height: 34px;
    }

    .hero {
        padding-top: 20px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-actions {
        width: 100%;
    }

    .filter-grid .filter-action {
        grid-column: 1 / -1;
    }

    .filter-actions .apply-button {
        flex: 1 1 auto;
    }

    .history-year-filter {
        width: 100%;

    }

    .history-search-filter {
        width: 100%;
        min-width: 0;
    }

    .history-search-filter .form-label,
    #fuelTable_wrapper .history-year-filter .form-label {
        margin-bottom: 5px;
    }

    #fuelTable_wrapper > .row:first-child {
        align-items: end;
        gap: 0;
        margin-bottom: 12px;
    }

    #fuelTable_wrapper > .row:first-child > [class*="col-"] {
        width: 50%;
        max-width: 100%;
        flex: 0 0 50%;
    }

    #fuelTable_wrapper .dataTables_length,
    #fuelTable_wrapper .dataTables_filter,
    #fuelTable_wrapper .history-year-filter {
        text-align: left !important;
    }

    #fuelTable_wrapper .dataTables_length label {
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    #fuelTable_wrapper .dataTables_length select {
        width: auto;
        min-width: 64px;
        margin: 0 !important;
    }

    #fuelTable_wrapper .dataTables_filter label {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
        margin: 0;
        font-weight: 600;
        font-size: 0.9rem;
    }

    #fuelTable_wrapper .dataTables_filter input {
        flex: 1 1 auto;
        min-width: 0;
        width: 100% !important;
        margin: 0 !important;
    }

    #fuelTable_wrapper .history-year-filter select {
        width: 100%;
    }

    .chart-wrap {
        height: 390px;
    }

    .highest-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .highest-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        width: calc(50% - 6px);
        justify-self: center;
    }

    .highest-card {
        min-height: 104px;
        padding: 14px;
    }

    .highest-card-price {
        font-size: 1.45rem;
        margin-top: 8px;
    }

    .price-card {
        min-height: 116px;
    }

    .price-value {
        font-size: 1.55rem;
    }

    .site-footer {
        min-height: 70px;
        padding: 18px 54px 18px 16px;
    }

    .site-footer p {
        font-size: 0.92rem;
    }

    .scroll-top {
        right: 16px;
    }

}
