/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --bg-primary: #071221;
    --bg-secondary: #0D1F38;
    --bg-card: #0f2540;
    --accent: #D97706;
    --accent-hover: #B45309;
    --sky: #38BDF8;
    --text-primary: #fff;
    --text-muted: rgba(255,255,255,0.5);
    --border: rgba(255,255,255,0.08);
    --radius: 12px;
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
html, body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; padding-top: 0; }

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.kritik-nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.navbar-brand.brand {
    color: var(--accent) !important;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.kritik-nav .nav-link {
    color: rgba(255,255,255,0.7) !important;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.kritik-nav .nav-link:hover,
.kritik-nav .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.06);
}

.nav-credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(217,119,6,0.15);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(217,119,6,0.3);
}

.btn-outline-accent {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-outline-accent:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.btn-accent:hover, .btn-accent:focus {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-accent:disabled {
    background: var(--accent);
    opacity: 0.6;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card-dark {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-control-dark, .form-select-dark {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
}

.form-control-dark:focus, .form-select-dark:focus {
    background: rgba(255,255,255,0.06);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.15);
}

.form-control-dark::placeholder { color: var(--text-muted); }

.form-select-dark option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-label {
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

/* ── Auth pages ────────────────────────────────────────────────────────────── */
.auth-container {
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
}

.brand-large {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -1px;
}

.divider {
    border-color: var(--border);
    margin: 1.5rem 0;
}

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert-danger-dark {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    color: #FCA5A5;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.alert-success-dark {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: #86EFAC;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

/* ── Upload zone ───────────────────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.upload-zone:hover, .upload-zone.dragging {
    border-color: var(--accent);
    background: rgba(217,119,6,0.05);
}

.upload-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
}

.file-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.selected-file {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.selected-file-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.preview-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius);
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero { padding: 4rem 0 2rem; }

.hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--sky);
    max-width: 600px;
    margin: 1rem auto 0;
    line-height: 1.6;
}

/* ── Feature cards ─────────────────────────────────────────────────────────── */
.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: 100%;
    transition: border-color 0.2s;
}

.feature-card:hover { border-color: rgba(255,255,255,0.18); }

.feature-icon { margin-bottom: 1rem; }

.feature-card h5 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* ── Analysis result ───────────────────────────────────────────────────────── */
.analysis-result {
    max-width: 860px;
}

.analysis-image {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius);
    background: var(--bg-secondary);
}

.score-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    padding: 4px 14px;
    border-radius: 20px;
}

.score-badge-sm {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 20px;
}

/* ── Markdown body ─────────────────────────────────────────────────────────── */
.markdown-body { line-height: 1.75; }
.markdown-body h2 { color: var(--sky); font-size: 1.1rem; margin-top: 1.75rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 1rem; color: rgba(255,255,255,0.9); }
.markdown-body strong { color: #fff; }
.markdown-body blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; color: var(--text-muted); margin: 1rem 0; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5rem; }
.markdown-body li { margin-bottom: 0.4rem; }
.markdown-body code { background: rgba(255,255,255,0.08); border-radius: 4px; padding: 1px 6px; }
.markdown-body p:last-child { margin-bottom: 0; }

/* ── Historique cards ──────────────────────────────────────────────────────── */
.card-analysis-link { display: block; text-decoration: none; color: inherit; }
.card-analysis-link:hover .card-analysis { border-color: rgba(255,255,255,0.18); }

.card-analysis {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
}

.analysis-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.card-analysis-body { padding: 0.875rem; }

.badge-genre {
    display: inline-block;
    background: rgba(56,189,248,0.12);
    color: var(--sky);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(56,189,248,0.25);
}

/* ── Admin table ───────────────────────────────────────────────────────────── */
.table-dark-custom {
    color: var(--text-primary);
    --bs-table-color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border);
    --bs-table-striped-color: var(--text-primary);
    --bs-table-hover-color: var(--text-primary);
}

.table-dark-custom thead th {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.table-dark-custom tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ── Stat cards ────────────────────────────────────────────────────────────── */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 2px;
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.text-muted-custom { color: var(--text-muted) !important; }
.text-accent { color: var(--accent) !important; }
.link-accent { color: var(--accent); }
.link-accent:hover { color: var(--accent-hover); }
.page-title { font-weight: 800; font-size: 1.6rem; }

.tips-list li {
    padding: 0.3rem 0;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

/* ── Spinner accent ────────────────────────────────────────────────────────── */
.text-accent.spinner-border { color: var(--accent) !important; }
.spinner-border.text-accent { color: var(--accent) !important; }

/* ── Blazor error UI ───────────────────────────────────────────────────────── */
#blazor-error-ui {
    background: rgba(239,68,68,0.9);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #fff;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
