/* --- ZMIENNE I RESET --- */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --accent: #00adb5;
    --text: #eeeeee;
    --text-dim: #bbbbbb;
    --border: #333333;
    --danger: #ff4d4d;
    --edit: #444444;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* --- NAWIGACJA --- */
nav {
    background: #000000;
    padding: 0 20px;
    display: flex;
    gap: 25px;
    border-bottom: 2px solid var(--accent);
    height: 60px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--accent);
}

/* --- KONTENER GŁÓWNY --- */
.container {
    max-width: 1300px;
    margin: 30px auto;
    padding: 0 20px;
}

h2, h4 {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- SEKCOJA FILTRÓW (UKŁAD POZIOMY) --- */
.filter-toggle-btn {
    background: var(--card-bg);
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: bold;
    transition: 0.3s;
}

.filter-toggle-btn:hover {
    background: #252525;
    border-color: var(--accent);
}

.filter-row {
    display: flex;
    flex-direction: row; /* Wymusza układ poziomy */
    align-items: flex-end;
    gap: 15px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    margin-bottom: 25px;
    overflow-x: auto; /* Pasek przewijania jeśli pola się nie mieszczą */
    white-space: nowrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0; /* Zapobiega ściskaniu pól */
}

.filter-group label {
    font-size: 10px;
    font-weight: bold;
    color: var(--accent);
    text-transform: uppercase;
}

.filter-group input, 
.filter-group select {
    background: #2a2a2a;
    border: 1px solid var(--border);
    color: white;
    padding: 8px;
    width: 180px; /* Stała szerokość dla równego wyglądu */
    height: 38px;
    border-radius: 4px;
}

.filter-group button {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0 20px;
    height: 38px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
}

.filter-group button:hover {
    background: #00ced1;
}

/* --- LISTA WYJAZDÓW (ACCORDION) --- */
.trip-item {
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.3s;
}

.trip-item:hover {
    border-color: #444;
}

.trip-header {
    padding: 18px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #252525;
    user-select: none;
}

.trip-header strong {
    font-size: 16px;
}

/* UKRYTA TREŚĆ */
.trip-content {
    display: none; /* Domyślnie schowane */
    padding: 25px;
    border-top: 1px solid var(--border);
    background: #1a1a1a;
}

/* POKAZYWANIE TREŚCI PRZY KLASIE ACTIVE */
.trip-item.active .trip-content {
    display: block;
}

.trip-item.active {
    border-color: var(--accent);
}

/* --- DETALE W ŚRODKU --- */
.time-box {
    background: #111111;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent);
    font-size: 14px;
}

.route-detail {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2a2a;
}

.route-detail:last-child {
    border-bottom: none;
}

.cat-badge {
    color: var(--accent);
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    display: block;
    margin-bottom: 3px;
}

/* --- PRZYCISKI AKCJI --- */
.actions {
    display: flex;
    gap: 10px;
}

.btn-edit {
    background: var(--edit);
    color: white;
    padding: 6px 14px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    transition: 0.3s;
}

.btn-edit:hover {
    background: #555;
}

.btn-delete {
    background: #600;
    color: white;
    padding: 6px 14px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    transition: 0.3s;
}

.btn-delete:hover {
    background: var(--danger);
}

/* --- TABELE (dla list kierowców/samochodów) --- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #252525;
    color: var(--accent);
    font-size: 12px;
    text-transform: uppercase;
}

tr:hover {
    background: #252525;
}

/* --- FORMULARZE (Dodawanie/Edycja) --- */
form label {
    display: block;
    margin: 15px 0 5px 0;
    color: var(--accent);
    font-size: 13px;
    font-weight: bold;
}

form input[type="text"],
form input[type="number"],
form input[type="password"],
form select,
form textarea {
    width: 100%;
    padding: 12px;
    background: #252525;
    border: 1px solid var(--border);
    color: white;
    border-radius: 4px;
}

form button {
    margin-top: 20px;
    background: var(--accent);
    color: black;
    border: none;
    padding: 12px 25px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
}

/* Stylizacja sekcji kategorii w historii */
.kategoria-sekcja {
    margin-top: 15px;
    border-left: 3px solid var(--accent);
    padding: 12px;
    margin-bottom: 25px;
    background: rgba(255,255,255,0.02);
    border-radius: 0 5px 5px 0;
}

.kategoria-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #444;
    padding-bottom: 6px;
}

.kategoria-tytul {
    color: var(--accent);
    font-size: 13px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.kategoria-suma {
    font-size: 15px;
    color: #ccc;
    background: #333;
    padding: 3px 10px;
    border-radius: 4px;
}

.trasa-blok {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #333;
}

.trasa-blok:last-child { border-bottom: none; margin-bottom: 0; }

.trasa-nazwa {
    font-size: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.trasa-szczegoly {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
    font-style: italic;
    line-height: 1.4;
}

.stats-mini {
    font-size: 12px;
    color: var(--accent);
    font-weight: normal;
}

.btn-mapa {
    background: #28a745 !important;
    color: white !important;
    font-weight: bold;
}


/* Styl dla tła strony logowania */
.login-body {
    background: #121212;
    /* Bardzo ciemne tło */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

/* Karta logowania */
.login-form {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    width: 100%;
    max-width: 350px;
    text-align: center;
}

.login-form h2 {
    color: var(--accent);
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Styl pola hasła */
.login-form input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: #252525;
    border: 1px solid #444;
    border-radius: 6px;
    color: white;
    font-size: 16px;
    box-sizing: border-box;
    /* Ważne, żeby padding nie rozpychał inputa */
}

.login-form input[type="password"]:focus {
    border-color: var(--accent);
    outline: none;
}

/* Przycisk wejścia */
.login-form button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: black;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.login-form button:hover {
    background: #fff;
    transform: translateY(-2px);
}

/* Komunikat o błędzie */
.error-msg {
    color: #ff4d4d;
    font-size: 14px;
    margin-top: 15px;
    background: rgba(255, 77, 77, 0.1);
    padding: 10px;
    border-radius: 4px;
}
