/* NOCENS - Dark Theme Stylesheet */
/* Trestni spis KRPA-345793-310 */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --accent: #e94560;
    --accent-hover: #ff6b81;
    --text-primary: #eeeeee;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --border: #2a2a4a;
    --sidebar-width: 260px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --radius: 8px;
    --transition: 0.3s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    display: flex;
    min-height: 100vh;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-card); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* Sidebar */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width); height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto; z-index: 100;
    transition: transform var(--transition);
    padding-bottom: 2rem;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--accent);
    text-align: center;
}

.sidebar-header h2 { font-size: 1.6rem; letter-spacing: 4px; font-weight: 700; }
.sidebar-header h2 a { color: var(--accent); text-decoration: none; }
.case-number { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; font-family: 'Courier New', monospace; }

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

.nav-links > li > a {
    display: block; padding: 0.6rem 1.5rem;
    color: var(--text-secondary); font-size: 0.9rem;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.nav-links > li > a:hover, .nav-links > li > a.active {
    color: var(--text-primary);
    background: rgba(233, 69, 96, 0.1);
    border-left-color: var(--accent);
}

.nav-group > span {
    display: block; padding: 0.6rem 1.5rem;
    color: var(--text-muted); font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 1px;
    font-weight: 600; cursor: pointer; user-select: none;
}
.nav-group > span:hover { color: var(--text-secondary); }
.nav-group > ul { list-style: none; padding: 0; }
.nav-group > ul > li > a {
    display: block; padding: 0.35rem 1.5rem 0.35rem 2.2rem;
    color: var(--text-secondary); font-size: 0.85rem;
    transition: all var(--transition); border-left: 3px solid transparent;
}
.nav-group > ul > li > a:hover, .nav-group > ul > li > a.active {
    color: var(--text-primary);
    background: rgba(233, 69, 96, 0.08);
    border-left-color: var(--accent);
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem; flex: 1;
    max-width: 1100px; min-height: 100vh;
}

.sidebar-toggle {
    display: none; position: fixed; top: 1rem; left: 1rem; z-index: 200;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-primary); font-size: 1.5rem;
    padding: 0.3rem 0.7rem; border-radius: var(--radius);
    cursor: pointer; transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--accent); }

.breadcrumb {
    font-size: 0.85rem; color: var(--text-muted);
    margin-bottom: 2rem; padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* Typography */
h1 { font-size: 2rem; color: var(--accent); margin-bottom: 0.5rem; font-weight: 700; letter-spacing: 1px; }
h2 { font-size: 1.5rem; color: var(--text-primary); margin: 2rem 0 1rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.2rem; color: var(--accent-hover); margin: 1.5rem 0 0.75rem; }
h4 { font-size: 1rem; color: var(--text-secondary); margin: 1rem 0 0.5rem; text-transform: uppercase; letter-spacing: 1px; }
p { margin-bottom: 1rem; }

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem; margin: 2rem 0;
}

.card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 1.5rem; border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative; overflow: hidden;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; background: var(--accent);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 { margin-top: 0; color: var(--text-primary); }
.card p { color: var(--text-secondary); font-size: 0.9rem; }
.card a.card-link { display: inline-block; margin-top: 0.5rem; color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.card-icon { font-size: 2rem; margin-bottom: 0.5rem; }

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem; margin: 1.5rem 0;
}
.stat-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 1.2rem; text-align: center; border: 1px solid var(--border);
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; }
thead { background: var(--bg-card); }
th { padding: 0.8rem 1rem; text-align: left; color: var(--accent); font-weight: 600; border-bottom: 2px solid var(--accent); white-space: nowrap; }
td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
tr:hover td { background: rgba(15, 52, 96, 0.5); }

/* Tags */
.tag { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.5px; }
.tag-danger { background: rgba(233, 69, 96, 0.2); color: var(--accent); border: 1px solid var(--accent); }
.tag-warning { background: rgba(255, 183, 77, 0.2); color: #ffb74d; border: 1px solid #ffb74d; }
.tag-info { background: rgba(79, 195, 247, 0.2); color: #4fc3f7; border: 1px solid #4fc3f7; }
.tag-success { background: rgba(129, 199, 132, 0.2); color: #81c784; border: 1px solid #81c784; }

/* Timeline */
.timeline { position: relative; padding-left: 2rem; margin: 2rem 0; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }

.timeline-item {
    position: relative; margin-bottom: 2rem;
    padding: 1rem 1.5rem; background: var(--bg-card);
    border-radius: var(--radius); border: 1px solid var(--border);
}
.timeline-item::before {
    content: ''; position: absolute; left: -2.35rem; top: 1.2rem;
    width: 12px; height: 12px; background: var(--accent);
    border-radius: 50%; border: 2px solid var(--bg-primary);
}
.timeline-item.critical::before { background: #ff1744; box-shadow: 0 0 8px rgba(255, 23, 68, 0.6); }

.timeline-date { font-size: 0.85rem; color: var(--accent); font-weight: 600; font-family: 'Courier New', monospace; }
.timeline-title { font-size: 1.05rem; color: var(--text-primary); margin: 0.3rem 0; font-weight: 600; }
.timeline-desc { font-size: 0.9rem; color: var(--text-secondary); }

/* Person Profile */
.person-header {
    display: flex; align-items: center; gap: 2rem; margin-bottom: 2rem;
    padding: 2rem; background: var(--bg-card);
    border-radius: var(--radius); border: 1px solid var(--border);
}
.person-avatar {
    width: 100px; height: 100px; border-radius: 50%;
    background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; color: var(--accent);
    border: 3px solid var(--accent); flex-shrink: 0;
}
.person-info h1 { margin-bottom: 0.2rem; }
.person-role { color: var(--text-muted); font-size: 0.95rem; }

/* Company Profile */
.company-header { padding: 2rem; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 2rem; }
.company-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.meta-item { padding: 0.5rem 0; }
.meta-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.meta-value { font-size: 1rem; color: var(--text-primary); font-weight: 600; }

/* Document */
.document-header { background: var(--bg-card); padding: 2rem; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 2rem; }
.document-meta { display: flex; gap: 2rem; margin-top: 1rem; flex-wrap: wrap; }
.document-meta span { font-size: 0.85rem; color: var(--text-muted); }
.document-body { padding: 1.5rem 0; line-height: 1.8; }

/* Quotes */
blockquote, .witness-quote {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.5rem; margin: 1.5rem 0;
    background: rgba(15, 52, 96, 0.3);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic; color: var(--text-secondary);
}
blockquote cite, .witness-name {
    display: block; margin-top: 0.5rem; font-style: normal;
    color: var(--accent); font-size: 0.85rem; font-weight: 600;
}

/* Court Dialog */
.court-dialog { margin: 1.5rem 0; }
.dialog-line { padding: 0.5rem 0; border-bottom: 1px solid rgba(42, 42, 74, 0.5); }
.dialog-speaker { font-weight: 600; font-size: 0.85rem; }
.dialog-speaker.judge { color: #4fc3f7; }
.dialog-speaker.witness { color: #81c784; }
.dialog-speaker.lawyer-p { color: #ffb74d; }
.dialog-speaker.lawyer-d { color: #ce93d8; }
.dialog-text { color: var(--text-secondary); margin-left: 1rem; font-size: 0.95rem; }

/* Evidence */
.evidence-item {
    display: flex; gap: 1rem; padding: 1rem 1.5rem;
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border); margin-bottom: 1rem; align-items: flex-start;
}
.evidence-id { font-family: 'Courier New', monospace; color: var(--accent); font-weight: 700; font-size: 0.85rem; white-space: nowrap; min-width: 60px; }
.evidence-desc { flex: 1; }

/* Legal */
.legal-paragraph {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 1.2rem 1.5rem; margin: 1rem 0;
    border: 1px solid var(--border); border-left: 3px solid #4fc3f7;
}
.legal-paragraph .para-ref { font-family: 'Courier New', monospace; color: #4fc3f7; font-weight: 700; font-size: 0.9rem; }
.legal-paragraph .para-text { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.3rem; }

/* Tooltips */
.tooltip-trigger { border-bottom: 1px dashed var(--accent); cursor: help; position: relative; }
.tooltip-trigger .tooltip-content {
    display: none; position: absolute; bottom: 100%; left: 50%;
    transform: translateX(-50%); background: var(--bg-card);
    border: 1px solid var(--accent); border-radius: var(--radius);
    padding: 0.6rem 1rem; font-size: 0.8rem; color: var(--text-primary);
    white-space: nowrap; z-index: 50; box-shadow: var(--shadow); font-style: normal;
}
.tooltip-trigger:hover .tooltip-content { display: block; }

/* Search */
.search-box { position: relative; margin: 1rem 1.5rem; }
.search-input {
    width: 100%; padding: 0.5rem 0.8rem;
    background: var(--bg-primary); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary);
    font-size: 0.85rem; outline: none; transition: border-color var(--transition);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); }

.search-results {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 300px; overflow-y: auto; z-index: 150; display: none;
}
.search-results.active { display: block; }
.search-result-item { padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 0.85rem; }
.search-result-item:hover { background: rgba(233, 69, 96, 0.1); }
.search-result-item .result-title { color: var(--text-primary); font-weight: 600; }
.search-result-item .result-section { color: var(--text-muted); font-size: 0.75rem; }

mark, .highlight { background: rgba(233, 69, 96, 0.3); color: var(--text-primary); padding: 0 0.2rem; border-radius: 2px; }

/* Alerts */
.alert { padding: 1rem 1.5rem; border-radius: var(--radius); margin: 1rem 0; border: 1px solid; }
.alert-danger { background: rgba(233, 69, 96, 0.1); border-color: var(--accent); color: var(--accent-hover); }
.alert-warning { background: rgba(255, 183, 77, 0.1); border-color: #ffb74d; color: #ffcc80; }
.alert-info { background: rgba(79, 195, 247, 0.1); border-color: #4fc3f7; color: #81d4fa; }

/* KV List */
.kv-list { list-style: none; }
.kv-list li { display: flex; padding: 0.5rem 0; border-bottom: 1px solid rgba(42, 42, 74, 0.5); }
.kv-key { min-width: 160px; color: var(--text-muted); font-size: 0.85rem; }
.kv-value { color: var(--text-primary); font-size: 0.9rem; }

.section-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); margin: 3rem 0; }

.page-hero {
    text-align: center; padding: 3rem 2rem; margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border-radius: var(--radius); border: 1px solid var(--border);
}
.page-hero h1 { font-size: 2.5rem; letter-spacing: 6px; margin-bottom: 0.5rem; }
.page-hero .subtitle { color: var(--text-muted); font-size: 1rem; }

.structure-tree {
    font-family: 'Courier New', monospace; background: var(--bg-card);
    padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border);
    overflow-x: auto; white-space: pre; font-size: 0.85rem;
    color: var(--text-secondary); line-height: 1.6;
}

.amount { font-family: 'Courier New', monospace; color: var(--accent); font-weight: 700; }
.amount-negative { color: #ff5252; }
.amount-positive { color: #69f0ae; }

.pdf-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.8rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text-secondary); font-size: 0.85rem;
    transition: all var(--transition);
}
.pdf-link:hover { border-color: var(--accent); color: var(--accent); }

/* Responsive */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .content { margin-left: 0; padding: 1rem 1.5rem; padding-top: 3.5rem; }
    .cards-grid { grid-template-columns: 1fr; }
    .person-header { flex-direction: column; text-align: center; }
    .page-hero h1 { font-size: 1.8rem; letter-spacing: 3px; }
    table { font-size: 0.8rem; }
    th, td { padding: 0.5rem; }
    .document-meta { flex-direction: column; gap: 0.5rem; }
    .kv-list li { flex-direction: column; }
    .kv-key { min-width: auto; margin-bottom: 0.2rem; }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .company-meta { grid-template-columns: 1fr; }
}

/* Print */
@media print {
    body { background: white; color: black; }
    .sidebar, .sidebar-toggle { display: none !important; }
    .content { margin-left: 0; padding: 0; max-width: 100%; }
    a { color: black; text-decoration: underline; }
    .card, .timeline-item, .evidence-item, .legal-paragraph,
    .document-header, .person-header, .company-header {
        border: 1px solid #ccc; background: white; box-shadow: none; break-inside: avoid;
    }
    .card::before { background: #333; }
    h1, h2, h3 { color: #333; }
    .tag { border: 1px solid #333; color: #333; background: transparent; }
    .breadcrumb { display: none; }
    .page-hero { background: #f5f5f5; border: 1px solid #ccc; }
}
