/* Variablen und Bootstrap-Override */
:root {
    --bs-primary: #1a237e;
    --bs-primary-text: #fff;
    --bs-success-bg: #c8e6c9;
    --bs-success-text: #1b5e20;
    --bs-danger-bg: #ffcdd2;
    --bs-danger-text: #b71c1c;
    --font-family-base: Arial, Helvetica, sans-serif;
}

/* Grundlayout */
html {
    font-family: var(--font-family-base);
    background: #f7f7f7;
    color: #222;
}

/* Body Reset */
body {
    margin: 0;
    padding: 0;
    background: #f7f7f7;
}

/* Header / Navbar (Bootstrap 5 Navbar) */
.sticky-header {
    position: sticky;
    top: 0;
    background-color: var(--bs-primary);
    color: var(--bs-primary-text);
    padding: 0.5rem 1rem;
    z-index: 1030 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sticky-header h1,
.sticky-header .navbar-brand {
    color: var(--bs-primary-text);
    font-size: 1.5rem;
    margin-bottom: 0;
    font-weight: 600;
}

/* Menü als flex / Bootstrap Nav */
.menu {
    display: flex;
    gap: 1rem;
}

.menu a,
.menu a:visited {
    color: var(--bs-primary-text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    display: inline-block;
    transition: background 0.2s ease-in-out;
    border-radius: 0.25rem;
}

.menu a:hover,
.menu a:focus {
    background: rgba(255, 255, 255, 0.15);
    color: var(--bs-primary-text);
}

/* Burger Menü Toggle - Bootstrap 5 zeigt standardmäßig */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--bs-primary-text);
    cursor: pointer;
}

/* Main Content Container (Bootstrap Card Alternative) */
main {
    max-width: 680px;
    margin: 2rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Formulare - Bootstrap 5 */
form.tank-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 1rem;
}

form.tank-form input,
form.tank-form select,
form.tank-form button {
    width: 100%;
    padding: 0.45rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

form.tank-form input:focus,
form.tank-form select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 35, 126, 0.25);
    outline: none;
}

form.tank-form button {
    margin-top: 1.5rem;
    background-color: var(--bs-primary);
    border: none;
    color: var(--bs-primary-text);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

form.tank-form button:hover,
form.tank-form button:focus {
    background-color: #121858;
}

/* Verbrauchswerte */
.verbrauchswert {
    font-weight: 700;
    font-size: 1.1rem;
}

.verbrauchswert.red {
    color: #d32f2f;
}

.verbrauchswert.green {
    color: #388e3c;
}

/* Alerts (Bootstrap Alerts integriert) */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-error {
    background-color: var(--bs-danger-bg);
    color: var(--bs-danger-text);
    border: 1px solid #f44336;
}

.alert-success {
    background-color: var(--bs-success-bg);
    color: var(--bs-success-text);
    border: 1px solid #4caf50;
}

/* Tabellen responsive und Bootstrap 5 style */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
}

.table-responsive table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    background: #fff;
    font-size: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

.table-responsive th,
.table-responsive td {
    padding: 0.6rem 0.8rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.table-responsive th {
    background-color: var(--bs-primary);
    color: var(--bs-primary-text);
    font-weight: 700;
}

.table-responsive tr:nth-child(even) td {
    background-color: #f4f6fb;
}

/* Kleinere Schrift für kleinere Devices */
@media (max-width: 700px) {
    .table-responsive table,
    .table-responsive th,
    .table-responsive td {
        font-size: 0.95rem;
    }
}

@media (max-width: 500px) {
    .table-responsive table,
    .table-responsive th,
    .table-responsive td {
        font-size: 2.8vw;
    }
}

/* Responsive padding & margin auf small Devices */
@media (max-width: 600px) {
    main {
        padding: 1rem;
        margin: 1rem;
    }

    /* Menü wird zum Burger */
    .menu {
        display: none;
        flex-direction: column;
        background-color: var(--bs-primary);
        position: absolute;
        top: 56px; /* Anpassung wg. Navbar Höhe */
        left: 0;
        right: 0;
        z-index: 1050;
        border-radius: 0 0 0.375rem 0.375rem;
    }

    .menu.open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

/* Sonstige kleine Hilfen */
p {
    font-size: 0.95rem;
    line-height: 1.4;
}

p.hinweis {
    color: #888;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* Vergleichswerte Styling dashboard */
.vergleichswert {
    font-weight: 700;
}

.vergleichswert.red {
    color: #d32f2f;
}

.vergleichswert.green {
    color: #388e3c;
}

.vergleichswert.gray {
    color: #888;
}

/* Kartendarstellungen / Dashboard-spezifisch */
.chart-container,
.verbrauch-vergleich {
    max-width: 680px;
    margin: 1.5rem auto 2rem auto;
    background: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 2rem;
}

@media (max-width: 700px) {
    .chart-container,
    .verbrauch-vergleich {
        padding: 1rem;
    }
}
