:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-background: #f0f2f5;
    --card-background: #ffffff;
    --text-color: #333333;
    --light-text-color: #6c757d;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --accent-success: #28a745;
    --accent-warning: #ffc107;
    --accent-danger: #dc3545;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Lato', sans-serif;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    background-color: var(--secondary-background);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-color);
    box-sizing: border-box; /* Include padding in element's total width and height */
}

header {
    text-align: center;
    padding-bottom: 1.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

header .subtitle {
    font-size: 1.1rem;
    color: var(--light-text-color);
    max-width: 600px;
    margin: 0 auto;
}

/* section heading */
h2 {
    font-family: var(--font-heading);
    color: var(--text-color);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 .fas {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* fuel select */
.controls-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.control-group {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background-color: var(--secondary-background);
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.control-label {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.control-label .fas {
    color: var(--primary-color);
    margin-right: 5px;
}

.custom-select-wrapper {
    position: relative;
    display: inline-block;
}

.custom-select {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-background);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    min-width: 150px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.select-arrow {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-color);
    pointer-events: none;
}

/* price grid */
.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.8rem;
}

/* card base */
.card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    /*transform: translateY(-5px);*/
    /*box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);*/
}

/* price card */
.price-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.price-card.cheapest {
    border: 2px solid var(--accent-success);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.2);
}

.price-card h3 {
    font-family: var(--font-heading);
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.price-card .station-name {
    font-size: 1rem;
    color: var(--light-text-color);
    margin-bottom: 1rem;
}

.price-card .price {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0.5rem 0 1.5rem;
    line-height: 1;
}

.price-card .price sup {
    font-size: 1.8rem;
    vertical-align: super;
}

.price-card .address {
    font-size: 0.95rem;
    color: var(--light-text-color);
    margin-bottom: 1.5rem;
}

.price-card .maps-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.price-card .maps-link:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    text-decoration: none;
}

.price-card .maps-link .fas {
    font-size: 1rem;
}

/* recommendation box */
.recommendation-box {
    text-align: center;
    font-size: 1.3rem;
    line-height: 1.5;
    margin-bottom: 2.5rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recommendation-box strong {
    font-weight: 700;
}

.recommendation-box strong.tanken {
    color: var(--accent-success);
}

.recommendation-box strong.wait {
    color: var(--accent-danger);
}

.recommendation-box strong.neutral {
    color: var(--accent-warning);
}

/* chart */
.chart-container {
    position: relative;
    height: 450px;
    width: 93%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* loader */
.loader {
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* footer */
footer {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.9rem;
    color: var(--light-text-color);
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* responsive */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }

    header h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .control-group {
        flex-direction: column;
        gap: 10px;
        padding: 1rem;
    }

    .price-grid {
        grid-template-columns: 1fr;
    }

    .price-card .price {
        font-size: 3rem;
    }

    .recommendation-box {
        font-size: 1.1rem;
    }

    .chart-container {
        height: 350px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .price-card .price {
        font-size: 2.8rem;
    }

    .price-card .price sup {
        font-size: 1.5rem;
    }
}