/* --- Basis & Layout --- */
body { font-family: sans-serif; background: #f4f7f6; padding: 20px; line-height: 1.5; color: #333; }
.container { max-width: 950px; margin: 0 auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* --- Login Seite (index.php) --- */
.login-body { display: flex; justify-content: center; align-items: center; height: 100vh; background: #f0f2f5; margin: 0; padding: 0; }
.login-card { background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); width: 300px; }
.error { color: red; font-size: 0.9rem; margin-bottom: 1rem; }

/* --- Dashboard Spezifisch (dashboard.php) --- */
.status-box { background: #e7f3ff; padding: 1rem; border-radius: 5px; border: 1px solid #b6d4fe; margin-bottom: 20px; }
.admin-actions { margin-top: 20px; display: flex; gap: 10px; }
.footer-links { margin-top: 30px; border-top: 1px solid #eee; padding-top: 15px; }
.logout { color: #dc3545; text-decoration: none; font-weight: bold; }
.logout:hover { text-decoration: underline; }
code { background: #f8f9fa; padding: 2px 4px; border-radius: 4px; border: 1px solid #dee2e6; font-family: monospace; }

/* --- Formulare & Inputs --- */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; }
input { width: 100%; padding: 8px; margin: 5px 0 15px 0; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; }
.hidden { display: none; }
.error-msg { color: #dc3545; background: #f8d7da; padding: 10px; border-radius: 4px; margin-bottom: 10px; }

/* --- Buttons --- */
.btn { padding: 10px 20px; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; transition: background 0.3s; display: inline-block; text-decoration: none; text-align: center; }
.btn-manage, .btn-save { background-color: #007bff; color: white; }
.btn-manage:hover:not(:disabled), .btn-save:hover:not(:disabled) { background-color: #0056b3; }
.btn-add { background: #28a745; color: white; margin-bottom: 15px; }
.btn-add:hover { background: #218838; }
.btn-cancel { background: #6c757d; color: white; }
.btn-cancel:hover { background: #5a6268; }
.btn:disabled { background-color: #ccc; color: #666; cursor: not-allowed; }

/* --- Tabellen (manage.php) --- */
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px; border-bottom: 1px solid #ddd; text-align: left; }
tbody tr:hover { background-color: #f9f9f9; }
.clickable-cell { cursor: pointer; }

/* --- Icons --- */
.action-cell { text-align: center; width: 60px; }
.btn-delete { color: #dc3545; cursor: pointer; font-size: 1.2rem; padding: 5px; border-radius: 4px; transition: background 0.2s; display: inline-block; }
.btn-delete:hover { background-color: #f8d7da; }

/* Zusätzliche Styles für die Statistik-Tabelle */
#statistik-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
#statistik-table thead th {
    background-color: #007bff;
    color: white;
    padding: 10px 12px;
    text-align: left;
    font-weight: bold;
}
#statistik-table tbody tr:hover {
    background-color: #f9f9f9;
}
#statistik-table .btn-stat {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 16px;
    padding: 5px 10px;
    text-align: left;
    width: 100%;
}
#statistik-table .btn-stat:hover {
    color: #0056b3;
    text-decoration: underline;
}
.action-icon {
    cursor: pointer;
    margin: 0 5px;
    font-size: 1.2em;
}
.btn-edit { color: #28a745; }
.btn-delete { color: #dc3545; }
.btn-edit:hover { color: #1e7e34; }
.btn-delete:hover { color: #bd2130; }

/* ============================================================
   TOP3 CONTAINER (ZIELORTE + POI NEBENEINANDER)
   ============================================================ */
.top3-container {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
    align-items: stretch;
}
.top3-box {
    flex: 1;
    min-width: 280px;
    max-width: 500px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px 20px;
    border: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
}
.top3-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #0056b3;
    font-size: 18px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
    flex-shrink: 0;
}
.top3-box table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    flex: 1;
}
.top3-box th {
    background: #e9ecef;
    color: #333;
    padding: 8px 10px;
    text-align: left;
    font-weight: bold;
    font-size: 13px;
}
.top3-box td {
    padding: 8px 10px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}
.top3-box .rang {
    font-weight: bold;
    color: #007bff;
    width: 30px;
    text-align: center;
}
.top3-box .zahl {
    text-align: right;
    font-weight: bold;
}
.top3-box .ort {
    font-weight: 500;
}
.top3-box .platz1 .rang { color: #ffd700; font-size: 1.2em; }
.top3-box .platz2 .rang { color: #c0c0c0; font-size: 1.1em; }
.top3-box .platz3 .rang { color: #cd7f32; font-size: 1.0em; }
.top3-box .keine-daten {
    color: #6c757d;
    text-align: center;
    padding: 20px 0;
    font-style: italic;
}

@media (max-width: 768px) {
    .top3-container {
        flex-direction: column;
    }
    .top3-box {
        max-width: 100%;
        min-width: auto;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .statistik-filter {
        flex-direction: column;
        align-items: stretch;
    }
    .statistik-filter .filter-group {
        flex-wrap: wrap;
    }
    .statistik-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .top3-container {
        flex-direction: column;
    }
    .top3-box {
        max-width: 100%;
        min-width: auto;
    }
}

/* ============================================================
   CHARTS
   ============================================================ */
.chart-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px 20px 10px 20px;
    margin-top: 30px;
    border: 1px solid #dee2e6;
    max-width: 900px;
}
.chart-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #0056b3;
    font-size: 18px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}
.chart-container canvas {
    max-height: 450px;
    width: 100% !important;
    height: auto !important;
}

@media (max-width: 768px) {
    .chart-container {
        max-width: 100%;
        padding: 15px;
    }
    .chart-container canvas {
        max-height: 350px;
    }
}
/* Uhrzeit-Chart - etwas breiter für 13 Balken */
.chart-container {
    max-width: 950px;  /* Etwas breiter als Standard (900px) */
}