/**
 * PrüfDoku - Hauptstylesheet
 *
 * Farbschema:
 * - Primary (Blau): #1a4fa0
 * - Success (Grün): #28a745
 * - Danger (Rot): #dc3545
 * - Warning (Gelb): #f0ad4e
 * - Orange: #ff9800
 */

/* ─── CSS Custom Properties ─────────────────────────────────────────────── */

:root {
    --primary: #1a4fa0;
    --primary-light: #2563b8;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #f0ad4e;
    --gray: #6c757d;
    --light: #f8f9fa;
    --border: #dee2e6;
    --orange: #ff9800;
}

/* ─── Reset & Basis ─────────────────────────────────────────────────────── */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    background: var(--light);
}

a {
    color: var(--primary);
}

/* ─── Header / Navigation ───────────────────────────────────────────────── */

.header {
    background: var(--primary);
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
}

.header .subtitle {
    font-size: 12px;
    opacity: 0.85;
}

.header .logo {
    height: 36px;
    border-radius: 6px;
}

.nav {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
    align-items: center;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    opacity: 0.85;
}

.nav a:hover,
.nav a.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.nav-sep {
    color: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    padding: 0 2px;
}

/* ─── Layout ────────────────────────────────────────────────────────────── */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-size: 12px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

/* ─── Cards ─────────────────────────────────────────────────────────────── */

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header-orange {
    background: var(--orange);
}

.card-body {
    padding: 16px;
}

/* ─── Info-Grid ─────────────────────────────────────────────────────────── */

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
}

/* ─── Badges ────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.badge-success { background: var(--success); }
.badge-danger  { background: var(--danger); }
.badge-warning { background: var(--warning); color: #333; }
.badge-gray    { background: var(--gray); }
.badge-orange  { background: var(--orange); }

/* ─── Ergebnis-Banner ───────────────────────────────────────────────────── */

.result-banner {
    padding: 16px;
    text-align: center;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.result-ok   { background: var(--success); }
.result-fail { background: var(--danger); }

/* ─── Tabellen ──────────────────────────────────────────────────────────── */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
}

.table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.table tr:nth-child(even) { background: var(--light); }
.table tr:hover            { background: #e8f0fe; }
.table-orange th           { background: var(--orange); }

/* ─── Buttons ───────────────────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary       { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-success       { background: var(--success); color: white; }
.btn-danger        { background: var(--danger); color: white; }
.btn-orange        { background: var(--orange); color: white; }
.btn-outline       { background: white; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm            { padding: 4px 10px; font-size: 12px; }

/* ─── Status-Dots ───────────────────────────────────────────────────────── */

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-green  { background: var(--success); }
.status-yellow { background: var(--warning); }
.status-red    { background: var(--danger); }
.status-gray   { background: var(--gray); }

/* ─── Suche ─────────────────────────────────────────────────────────────── */

.search-box {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-box:focus {
    border-color: var(--primary);
}

/* ─── Statistik-Kacheln ─────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--gray);
    margin-top: 4px;
}

/* ─── Formulare ─────────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: #f0f5ff;
}

/* ─── Messwerte ─────────────────────────────────────────────────────────── */

.messwerte-group {
    margin-bottom: 12px;
}

.messwerte-group h4 {
    color: var(--primary);
    font-size: 13px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}

.messwerte-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
}

.messwerte-item .label { color: var(--gray); }
.messwerte-item .value { font-weight: 600; }

/* ─── Alerts ────────────────────────────────────────────────────────────── */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ─── Foto-Grid / Lightbox ──────────────────────────────────────────────── */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.photo-grid img {
    width: 100%;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-grid img:hover {
    transform: scale(1.05);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

/* ─── Tabs ──────────────────────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--gray);
    transition: all 0.2s;
}

.tab:hover           { color: var(--primary); }
.tab.active          { color: var(--primary); border-bottom-color: var(--primary); }
.tab.active-orange   { color: var(--orange); border-bottom-color: var(--orange); }
.tab-content         { display: none; }
.tab-content.active  { display: block; }

/* ─── Sonstiges ─────────────────────────────────────────────────────────── */

.deaktiviert {
    opacity: 0.5;
    text-decoration: line-through;
}

.toggle-btn {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    border: none;
    font-weight: 600;
}

.toggle-active   { background: #d4edda; color: #155724; }
.toggle-inactive { background: #f8d7da; color: #721c24; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    opacity: 0.85;
    padding: 6px 12px;
    border-radius: 6px;
}

.back-link:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .info-grid   { grid-template-columns: 1fr; }
    .stats-grid  { grid-template-columns: 1fr 1fr; }
    .header      { padding: 10px 14px; flex-wrap: wrap; }
    .container   { padding: 12px; }
    .nav         { gap: 4px; }
    .nav a       { padding: 4px 8px; font-size: 12px; }
    .tabs        { overflow-x: auto; }
    .tab         { padding: 8px 12px; font-size: 12px; white-space: nowrap; }
}
