/* ===== MOONNIGHT BEWEIS SICHERUNG — STYLESHEET ===== */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Exo+2:wght@300;400;500;600;700;800;900&family=Share+Tech+Mono&display=swap');

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

:root {
    --bg-deep: #05020e;
    --bg-dark: #0a0618;
    --bg-card: #0f0b22;
    --bg-card-hover: #14102e;
    --bg-input: #0c0820;
    --border: #1e1548;
    --border-hover: #3b2d6e;
    --purple: #8b5cf6;
    --purple-bright: #a78bfa;
    --purple-dim: #5b3db0;
    --cyan: #22d3ee;
    --cyan-dim: #0e7490;
    --blue: #3b82f6;
    --magenta: #d946ef;
    --gold: #f5c842;
    --text: #e2dff0;
    --text-dim: #8b85a6;
    --text-muted: #5a5477;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, .08);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, .08);
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-glow: 0 0 40px rgba(139, 92, 246, .12);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, .3);
    --transition: .25s ease;
}

html { height: 100%; }
body {
    font-family: 'Exo 2', sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ===== STARS ===== */
#stars-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}

/* ===== LOGIN ===== */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1; padding: 20px;
}
.login-card {
    background: linear-gradient(160deg, rgba(15, 11, 34, .96), rgba(10, 6, 24, .99));
    border: 1px solid var(--border); border-radius: 20px;
    padding: 48px 40px; width: 420px; max-width: 95vw;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 80px rgba(139, 92, 246, .1), 0 30px 60px rgba(0, 0, 0, .5);
    animation: cardIn .6s ease-out;
    position: relative; overflow: hidden;
}
.login-card::before {
    content: ''; position: absolute; top: -1px; left: -1px; right: -1px; bottom: -1px;
    border-radius: 21px; z-index: -1; opacity: .35;
    background: linear-gradient(135deg, var(--purple), var(--cyan), var(--magenta), var(--purple));
    background-size: 300% 300%; animation: borderShift 6s ease infinite;
}
@keyframes borderShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }

.login-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.login-logo img {
    width: 150px; height: 150px; object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, .5));
    animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(139, 92, 246, .4)); }
    50% { filter: drop-shadow(0 0 40px rgba(34, 211, 238, .5)); }
}
.login-title {
    text-align: center; font-family: 'Rajdhani', sans-serif; font-weight: 700;
    font-size: 24px; letter-spacing: 2px;
    background: linear-gradient(135deg, var(--cyan), var(--purple-bright), var(--magenta));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; text-transform: uppercase; margin-bottom: 4px;
}
.login-sub {
    text-align: center; color: var(--text-muted); font-size: 12px;
    margin-bottom: 36px; letter-spacing: 1.5px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; font-size: 11px; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px; font-weight: 600;
}
.form-input {
    width: 100%; padding: 13px 16px; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-size: 14px; font-family: 'Exo 2', sans-serif;
    outline: none; transition: all var(--transition);
}
.form-input:focus { border-color: var(--purple); box-shadow: 0 0 20px rgba(139, 92, 246, .2); }
.form-input::placeholder { color: var(--text-muted); }
.form-input:disabled { opacity: .5; cursor: not-allowed; }

.error-msg {
    color: var(--danger); font-size: 12px; margin-top: 12px; padding: 12px 16px;
    background: var(--danger-bg); border: 1px solid rgba(239, 68, 68, .2);
    border-radius: var(--radius); display: none;
}
.error-msg.show { display: block; animation: fadeUp .3s ease-out; }

.login-footer {
    color: var(--text-muted); font-size: 11px; margin-top: 28px;
    text-align: center; letter-spacing: .5px;
}

/* ===== BUTTONS ===== */
.btn-login {
    width: 100%; padding: 14px; margin-top: 10px; border: none; border-radius: var(--radius);
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 16px;
    letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
    background: linear-gradient(135deg, var(--purple), var(--blue), var(--cyan));
    background-size: 200% 200%; animation: btnShift 4s ease infinite;
    color: #fff; transition: all .3s;
    box-shadow: 0 4px 24px rgba(139, 92, 246, .3);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(139, 92, 246, .5); }
@keyframes btnShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.btn-accent {
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 24px;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    border: none; border-radius: var(--radius); color: #fff;
    font-family: 'Exo 2', sans-serif; font-weight: 600; font-size: 13px;
    cursor: pointer; transition: all var(--transition);
    box-shadow: 0 4px 16px rgba(139, 92, 246, .25);
    text-decoration: none;
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(139, 92, 246, .4); }

.btn-small {
    display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px;
    background: rgba(139, 92, 246, .06); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-dim); font-size: 12px;
    font-family: 'Exo 2', sans-serif; cursor: pointer; transition: all .2s;
    text-decoration: none;
}
.btn-small:hover { border-color: var(--purple); color: var(--text); background: rgba(139, 92, 246, .12); }
.btn-danger { color: var(--danger) !important; }
.btn-danger:hover { border-color: var(--danger) !important; background: var(--danger-bg) !important; }
.btn-gold { color: var(--gold) !important; }

/* ===== APP LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: 230px; min-width: 230px; background: rgba(10, 6, 24, .94);
    border-right: 1px solid var(--border); display: flex; flex-direction: column;
    justify-content: space-between; position: fixed; top: 0; left: 0; bottom: 0; z-index: 10;
    backdrop-filter: blur(12px);
}
.sidebar-brand {
    padding: 22px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 14px;
}
.sidebar-brand img {
    width: 50px; height: 50px; object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, .4));
}
.sidebar-brand-text {
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 13px;
    letter-spacing: 1.5px; line-height: 1.3;
    background: linear-gradient(135deg, var(--cyan), var(--purple-bright));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; text-transform: uppercase;
}
.sidebar-nav { padding: 16px 0; }
.nav-btn {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 22px;
    border: none; background: transparent; color: var(--text-dim); font-size: 13px;
    font-family: 'Exo 2', sans-serif; font-weight: 500; cursor: pointer;
    transition: all .2s; border-left: 3px solid transparent; text-decoration: none;
}
.nav-btn:hover { background: rgba(139, 92, 246, .06); color: var(--text); }
.nav-btn.active {
    background: rgba(139, 92, 246, .1); color: var(--cyan);
    border-left-color: var(--cyan);
}

.sidebar-footer { border-top: 1px solid var(--border); padding: 16px 22px; }
.sidebar-user { font-size: 14px; font-weight: 600; color: var(--purple-bright); margin-bottom: 2px; }
.sidebar-role {
    font-size: 10px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 1.5px; font-family: 'Share Tech Mono', monospace;
}
.btn-logout {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 0; margin-top: 10px;
    border: none; background: transparent; color: var(--text-muted); font-size: 12px;
    font-family: 'Exo 2', sans-serif; cursor: pointer; transition: color .2s;
    border-top: 1px solid var(--border); padding-top: 12px;
}
.btn-logout:hover { color: var(--danger); }

/* ===== MAIN ===== */
.main-content { flex: 1; margin-left: 230px; min-height: 100vh; padding: 36px; }
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 16px; margin-bottom: 32px;
}
.page-title {
    font-family: 'Rajdhani', sans-serif; font-size: 30px; font-weight: 700; letter-spacing: 1px;
    background: linear-gradient(135deg, var(--text), var(--purple-bright));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.filter-select {
    padding: 10px 16px; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 12px;
    font-family: 'Exo 2', sans-serif; cursor: pointer; outline: none;
}
.filter-select option { background: var(--bg-dark); }

/* ===== EVIDENCE GRID ===== */
.evidence-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;
}
.evidence-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden; transition: all .3s;
    animation: fadeUp .4s ease-out both;
}
.evidence-card:hover {
    border-color: rgba(139, 92, 246, .4); transform: translateY(-4px);
    box-shadow: 0 0 30px rgba(139, 92, 246, .15), var(--shadow-card);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.card-thumb {
    height: 170px; background: var(--bg-deep); position: relative;
    cursor: pointer; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card-thumb:hover img { transform: scale(1.08); }
.card-thumb-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(5, 2, 14, .6); opacity: 0; transition: opacity .3s; color: var(--cyan);
}
.card-thumb:hover .card-thumb-overlay { opacity: 1; }
.card-video-icon {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; color: var(--purple-bright);
}
.card-video-icon span { font-size: 10px; margin-top: 6px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.card-badge {
    position: absolute; top: 10px; right: 10px; padding: 4px 12px;
    background: rgba(217, 70, 239, .85); border-radius: 6px;
    font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #fff;
}
.card-body { padding: 16px; }
.card-filename {
    font-size: 13px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px;
}
.card-meta {
    font-size: 11px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.card-ttl {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
    font-size: 11px; padding: 5px 12px; border-radius: 20px; font-weight: 500;
}
.card-ttl.safe { background: rgba(34, 211, 238, .06); color: var(--cyan); border: 1px solid rgba(34, 211, 238, .15); }
.card-ttl.warn { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, .2); }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    padding: 70px 20px; text-align: center; border: 1px dashed var(--border);
    border-radius: var(--radius-lg); display: flex; flex-direction: column; align-items: center;
}
.empty-state svg { opacity: .15; margin-bottom: 16px; }
.empty-state p { color: var(--text-muted); font-size: 14px; }
.empty-state .sub { font-size: 12px; margin-top: 6px; }

/* ===== ACCOUNTS ===== */
.account-row {
    display: flex; justify-content: space-between; align-items: center; padding: 18px 22px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 10px; transition: all .2s;
}
.account-row:hover { border-color: var(--border-hover); }
.account-name { font-weight: 600; color: var(--text); font-size: 15px; }
.account-handle {
    font-size: 12px; color: var(--text-muted); margin-top: 3px;
    font-family: 'Share Tech Mono', monospace;
}
.form-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px; margin-bottom: 24px;
    animation: fadeUp .3s ease-out;
}
.form-card-title {
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 18px;
    color: var(--cyan); margin-bottom: 24px; letter-spacing: 1px;
}

/* ===== MODAL ===== */
.modal-bg {
    position: fixed; inset: 0; background: rgba(5, 2, 14, .92);
    display: none; align-items: center; justify-content: center;
    z-index: 100; padding: 20px; backdrop-filter: blur(10px);
}
.modal-bg.open { display: flex; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
    max-width: 90vw; max-height: 90vh; overflow: hidden; min-width: 360px;
    box-shadow: 0 0 60px rgba(139, 92, 246, .15), 0 40px 80px rgba(0, 0, 0, .6);
    animation: modalIn .3s ease-out;
}
@keyframes modalIn { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
    display: flex; justify-content: space-between; align-items: center; padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header span { font-weight: 600; font-size: 14px; color: var(--text); }
.modal-content {
    padding: 24px; display: flex; align-items: center; justify-content: center;
    max-height: 75vh; overflow: auto; background: var(--bg-deep);
}
.modal-content img, .modal-content video { max-width: 100%; max-height: 68vh; border-radius: 6px; }
.modal-footer {
    padding: 14px 24px; font-size: 12px; color: var(--text-muted);
    display: flex; gap: 20px; border-top: 1px solid var(--border); flex-wrap: wrap;
}

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; }
.toast {
    padding: 14px 24px; border-radius: var(--radius); font-size: 13px; font-weight: 500;
    margin-top: 8px; animation: toastIn .3s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.toast.success { background: var(--success-bg); border: 1px solid rgba(52, 211, 153, .25); color: var(--success); }
.toast.error { background: var(--danger-bg); border: 1px solid rgba(239, 68, 68, .25); color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* ===== UPLOAD OVERLAY ===== */
.upload-overlay {
    position: fixed; inset: 0; background: rgba(5, 2, 14, .88);
    display: none; align-items: center; justify-content: center;
    z-index: 150; backdrop-filter: blur(6px);
}
.upload-overlay.show { display: flex; }
.upload-spinner {
    width: 52px; height: 52px; border: 3px solid var(--border); border-top-color: var(--cyan);
    border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-dim); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { width: 64px; min-width: 64px; }
    .sidebar-brand-text, .nav-btn span, .sidebar-user, .sidebar-role, .btn-logout span { display: none; }
    .sidebar-brand { justify-content: center; padding: 16px 10px; }
    .sidebar-brand img { width: 38px; height: 38px; }
    .nav-btn { justify-content: center; padding: 16px 0; }
    .main-content { margin-left: 64px; padding: 20px 16px; }
    .evidence-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
    .page-title { font-size: 24px; }
    .login-card { padding: 36px 24px; }
}
