/* assets/css/style.css */
:root {
    --bg-color: #0f1115; /* Sehr dunkles Blau/Grau */
    --card-bg: rgba(20, 20, 30, 0.85); /* Glas-Effekt */
    --gold: #c5a059;
    --gold-hover: #e6c67e;
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    background-image: url('../img/background.jpg'); /* Dein Hintergrundbild */
    background-size: cover;
    background-position: center;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(197, 160, 89, 0.3); /* Zarter Goldrand */
    backdrop-filter: blur(8px);
    text-align: center;
}

.logo-area h1 {
    color: var(--gold);
    font-family: 'Georgia', serif; /* Wirkt seriöser */
    margin-bottom: 5px;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo-area p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-size: 12px;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    color: var(--text-color);
    border-radius: 4px;
    box-sizing: border-box; /* Wichtig damit Padding nicht die Breite sprengt */
    transition: 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.1);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, var(--gold), #b08d45);
    border: none;
    color: #000;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
}

.btn-login:hover {
    background: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(197, 160, 89, 0.3);
}

.error-msg {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid red;
    color: #ffcccc;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* --- DASHBOARD LAYOUT --- */
.dashboard-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar Links */
.sidebar {
    width: 260px;
    background: #0a0b0e;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar-header {
    text-align: center;
    color: var(--gold);
    font-family: 'Georgia', serif;
    margin-bottom: 30px;
    font-size: 1.2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #b0b0b0;
    text-decoration: none;
    transition: 0.3s;
    border-left: 3px solid transparent;
}

.nav-links li a:hover, .nav-links li a.active {
    background: rgba(197, 160, 89, 0.1);
    color: var(--gold);
    border-left: 3px solid var(--gold);
}

.nav-links li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

/* Hauptbereich */
.main-content {
    flex-grow: 1;
    background: #14161b;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 60px;
    background: #0f1115;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    color: white;
}

.user-info span {
    color: var(--gold);
    font-weight: bold;
}

.content-area {
    padding: 30px;
    overflow-y: auto;
    color: #ddd;
}

/* Kacheln (Widgets) für Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #1e2129;
    padding: 20px;
    border-radius: 8px;
    border-top: 2px solid var(--gold);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.stat-card h3 { margin: 0; font-size: 14px; color: #888; text-transform: uppercase; }
.stat-card .value { font-size: 28px; font-weight: bold; color: #fff; margin-top: 10px; }

/* --- TABELLEN DESIGN --- */
.table-container {
    background: #1e2129;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    color: #ccc;
}

.custom-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid var(--gold);
    color: var(--gold);
    text-transform: uppercase;
    font-size: 12px;
}

.custom-table td {
    padding: 15px;
    border-bottom: 1px solid #333;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges für Ränge */
.badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}
.badge-admin { background: rgba(197, 160, 89, 0.2); color: var(--gold); border: 1px solid var(--gold); }
.badge-lawyer { background: rgba(0, 123, 255, 0.2); color: #4da3ff; border: 1px solid #007bff; }
.badge-staff { background: rgba(108, 117, 125, 0.2); color: #ccc; border: 1px solid #6c757d; }

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-right: 5px;
}
.btn-small:hover { background: var(--gold); color: black; }

/* --- FIX FÜR DROPDOWNS (SELECT) --- */

select.form-control {
    /* Hintergrund dunkel machen, damit es nicht weiß ist */
    background-color: #14161b !important; 
    color: var(--text-color);
    cursor: pointer;
}

/* Die eigentlichen Optionen in der Liste */
select.form-control option {
    background-color: #14161b;
    color: white;
    padding: 10px;
}

/* Wenn man mit der Maus über eine Option fährt (Hover) - funktioniert nicht in allen Browsern, aber Versuch wert */
select.form-control option:hover {
    background-color: var(--gold);
    color: black;
}

/* --- GESETZBUCH & RECHNER MODUL --- */

.laws-wrapper {
    display: flex;
    gap: 20px;
    height: calc(100vh - 140px); /* Höhe anpassen damit es nicht scrollt */
    overflow: hidden;
}

/* Linke Seite: Liste */
.col-list {
    flex: 2;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
}

/* Rechte Seite: Rechner */
.col-calc {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #151515;
    border-left: 3px solid var(--gold);
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
}

/* Tabs */
.law-tabs {
    display: flex;
    background: #252525;
    border-bottom: 1px solid #333;
    padding: 10px;
    gap: 10px;
}

.law-tab {
    padding: 8px 20px;
    cursor: pointer;
    color: #888;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    transition: 0.3s;
    text-transform: uppercase;
}

.law-tab:hover { background: #333; color: white; }
.law-tab.active { background: var(--gold); color: black; }

/* Inhalt */
.law-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Scrollbar Design */
.law-content::-webkit-scrollbar, #calcList::-webkit-scrollbar {
    width: 6px;
}
.law-content::-webkit-scrollbar-thumb, #calcList::-webkit-scrollbar-thumb {
    background: #444; 
    border-radius: 3px;
}

/* Einzelnes Item */
.law-item {
    background: #252525;
    margin-bottom: 8px;
    border-radius: 4px;
    border: 1px solid #333;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.law-item:hover {
    background: #2a2a2a;
    border-color: var(--gold);
    transform: translateX(5px);
}

.law-badges { margin-bottom: 5px; }
.badge-cat { font-size: 9px; background: var(--gold); color: black; padding: 2px 6px; border-radius: 2px; font-weight: bold; margin-right: 5px; }
.badge-nr { font-size: 9px; background: #333; color: #aaa; padding: 2px 6px; border-radius: 2px; margin-right: 5px; }

.law-title { font-weight: bold; color: white; font-size: 14px; margin-bottom: 5px; }
.law-meta { display: flex; gap: 15px; border-top: 1px solid #333; padding-top: 8px; margin-top: 8px; font-size: 12px; }
.law-desc { font-size: 11px; color: #777; margin-top: 5px; font-style: italic; }

/* Gesetzestext (aufklappbar) */
.law-text-body { display: none; margin-top: 10px; font-size: 13px; color: #ccc; line-height: 1.5; border-top: 1px dashed #444; padding-top: 10px;}

/* Rechner Items */
.calc-item {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; margin-bottom: 8px; 
    border-bottom: 1px dashed #333; padding-bottom: 8px;
    animation: fadeIn 0.3s;
}
.calc-remove { color: #ff4444; cursor: pointer; font-weight: bold; padding: 0 5px; }
.calc-remove:hover { color: red; }

.total-area { margin-top: auto; padding-top: 20px; border-top: 2px solid var(--gold); }
.total-row { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 14px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }


/* --- GESETZBUCH & RECHNER NEUES DESIGN --- */

/* Badge Styles wie im Screenshot */
.badge-law-cat {
    background-color: #f1c40f; /* Gelb/Gold */
    color: #000;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-right: 5px;
    text-transform: uppercase;
}

.badge-law-nr {
    background-color: #34495e;
    color: #ecf0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-family: monospace;
}

.law-item {
    background: #1e1e1e;
    border: 1px solid #333;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.law-item:hover {
    border-color: var(--gold);
    background: #252525;
}

/* Das Plus Icon rechts */
.law-add-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #6c5ce7; /* Lila wie im Screenshot */
    font-size: 18px;
    font-weight: bold;
}

.law-title {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    margin: 8px 0;
}

.law-meta-row {
    display: flex;
    gap: 15px;
    font-size: 13px;
    align-items: center;
}

.meta-jail { color: #e74c3c; font-weight: bold; } /* Rot */
.meta-fine { color: #2ecc71; font-weight: bold; } /* Grün */
.meta-info { color: #95a5a6; font-size: 11px; font-style: italic; margin-top: 5px; display: block;}

/* Gesetzestexte Formatierung */
.law-text-content {
    color: #ccc;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 10px;
    border-top: 1px dashed #444;
    padding-top: 10px;
    white-space: pre-wrap; /* WICHTIG: Erhält Zeilenumbrüche! */
    display: none; /* Standardmäßig zu */
}

/* --- NEUES LAW-CARD DESIGN (Wie Screenshots) --- */

/* Der Container für ein Gesetz */
.law-card {
    background: #1e1e1e;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden; /* Damit der gelbe Balken nicht übersteht */
    border: 1px solid #333;
    transition: transform 0.2s;
}

.law-card:hover {
    transform: translateY(-2px);
    border-color: #555;
}

/* Der Gelbe Balken oben (STPO, WAFFG) */
.law-card-header {
    background-color: #d4af37; /* Dein Gold/Gelb */
    color: #000;
    padding: 5px 10px;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.law-card-header i {
    font-size: 10px;
    opacity: 0.7;
}

/* Der Titel Bereich (§ 24.1 Bewährung) */
.law-card-title-area {
    padding: 10px 15px 5px 15px;
    border-bottom: 1px dashed #333;
}

.law-card-title {
    color: #fff;
    font-weight: bold;
    font-size: 15px;
}

/* Der Inhalt (Text) */
.law-card-body {
    padding: 10px 15px 15px 15px;
    color: #ccc;
    font-size: 13px;
    line-height: 1.6;
    display: none; /* Standardmäßig zugeklappt */
}

/* Hervorhebung für Absatz-Nummern wie (1), (2) */
.law-absatz {
    color: #d4af37;
    font-weight: bold;
    margin-right: 3px;
}

/* --- TABS DESIGN --- */
.tab-header {
    display: flex;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
    background: #1e2129;
    padding: 0 10px;
    border-radius: 4px 4px 0 0;
}

.tab-btn {
    padding: 15px 20px;
    cursor: pointer;
    color: #888;
    font-weight: bold;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
    text-transform: uppercase;
    font-size: 12px;
}

.tab-btn:hover { color: white; }
.tab-btn.active {
    color: var(--gold);
    border-bottom: 3px solid var(--gold);
}

.tab-content { display: none; animation: fadeIn 0.3s; }
.tab-content.active { display: block; }

/* Bilder Grid */
.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.evidence-item {
    background: #000;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1; /* Quadratisch */
}

.evidence-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    cursor: pointer;
}

.evidence-item:hover img { transform: scale(1.1); }

.evidence-delete {
    position: absolute; top: 5px; right: 5px;
    background: rgba(255,0,0,0.7); color: white;
    width: 20px; height: 20px; text-align: center;
    line-height: 20px; border-radius: 50%;
    font-size: 10px; cursor: pointer;
}