/* ===================================

   Dark Theme - Blue
   =================================== */

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

:root {
    /* Blaue Farbpalette */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #1e40af;
    --accent: #06b6d4;

    /* Dark Theme Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #151b2e;
    --bg-tertiary: #1f2937;
    --bg-card: #1a1f35;

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;

    /* Border */
    --border: #2d3748;
    --border-light: #475569;

    /* Status */
    --success: #10b981;
    --success-bg: #064e3b;
    --danger: #ef4444;
    --danger-bg: #7f1d1d;
    --warning: #f59e0b;
    --warning-bg: #78350f;
    --info: #3b82f6;
    --info-bg: #1e3a8a;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* ===================================
   Base Styles
   =================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ===================================
   Navbar
   =================================== */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand i {
    color: var(--primary);
    font-size: 24px;
}

.navbar-nav {
    list-style: none;
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--primary-light);
}

.nav-link i {
    font-size: 16px;
}

/* ===================================
   Containers & Layout
   =================================== */
.container, .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col-md-3, .col-md-4, .col-md-6, .col-md-12 {
    padding: 0 12px;
    margin-bottom: 24px;
}

.col-md-12 { width: 100%; }
.col-md-6 { width: 100%; }
.col-md-4 { width: 100%; }
.col-md-3 { width: 100%; }

@media (min-width: 768px) {
    .col-md-6 { width: 50%; }
    .col-md-4 { width: 33.333%; }
    .col-md-3 { width: 25%; }
}

/* ===================================
   Cards
   =================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.card-body {
    padding: 24px;
}

.card-title {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    font-size: 24px;
}

.card.border-primary { border-left: 3px solid var(--primary); }
.card.border-success { border-left: 3px solid var(--success); }
.card.border-warning { border-left: 3px solid var(--warning); }
.card.border-danger { border-left: 3px solid var(--danger); }

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn i { font-size: 14px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline-secondary:hover {
    background: var(--bg-secondary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

/* ===================================
   Forms
   =================================== */
.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control, .form-select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.mb-3 { margin-bottom: 20px; }

.p-2 { padding: 10px }

/* ===================================
   Tables
   =================================== */
.table-responsive {
    overflow-x: auto;
    margin: -1px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
}

.table thead {
    background: var(--bg-secondary);
}

.table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 14px 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

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

/* ===================================
   Badges
   =================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge i { font-size: 12px; }

.bg-success {
    background: var(--success-bg);
    color: #6ee7b7;
}

.bg-secondary {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.bg-warning {
    background: var(--warning-bg);
    color: #fcd34d;
}

.bg-danger {
    background: var(--danger-bg);
    color: #fca5a5;
}

.bg-info {
    background: var(--info-bg);
    color: #93c5fd;
}

/* ===================================
   Alerts
   =================================== */
.alert {
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    margin-bottom: 20px;
    border-left: 3px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

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

.alert i {
    font-size: 18px;
}

.alert-danger {
    background: var(--danger-bg);
    border-left-color: var(--danger);
    color: #fca5a5;
}

.alert-success {
    background: var(--success-bg);
    border-left-color: var(--success);
    color: #6ee7b7;
}

.alert-warning {
    background: var(--warning-bg);
    border-left-color: var(--warning);
    color: #fcd34d;
}

.alert-dismissible {
    position: relative;
    padding-right: 50px;
}

.btn-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.btn-close:hover {
    opacity: 1;
}

.btn-close::before {
    content: "×";
}

/* ===================================
   Auth Container (Login/Register)
   =================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    animation: fadeIn 0.4s ease;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.auth-header h2 {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.auth-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ===================================
   Utilities
   =================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.text-success { color: #6ee7b7; }
.text-danger { color: #fca5a5; }

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.w-100 { width: 100%; }

.display-1 {
    font-size: 64px;
    font-weight: 700;
}

.display-4 {
    font-size: 48px;
    font-weight: 700;
    margin: 8px 0;
}

.lead {
    font-size: 18px;
    color: var(--text-secondary);
}

/* ===================================
   Checkboxes
   =================================== */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ===================================
   Scrollbar
   =================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    .navbar .container-fluid {
        flex-direction: column;
        gap: 16px;
    }

    .navbar-nav {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        font-size: 13px;
        padding: 6px 12px;
    }

    .container, .container-fluid {
        padding: 20px 16px;
    }

    .auth-card {
        padding: 36px 28px;
    }

    .table-responsive {
        font-size: 13px;
    }

    .table th, .table td {
        padding: 10px 12px;
    }

    .btn {
        font-size: 13px;
        padding: 8px 14px;
    }

    .display-4 {
        font-size: 36px;
    }
}

/* ===================================
   Theme Toggle Button
   =================================== */
#themeToggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

#themeToggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
}
