/* ============================================
   localcop.dev — Anti-Design Law Enforcement
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f0f0e8;
    --sidebar-dark: #1a1a2a;
    --aurora-start: #1a7a4a;
    --aurora-mid: #4a2a8a;
    --aurora-end: #1a5a8a;
    --alert-red: #e03030;
    --alert-amber: #e0a030;
    --text-primary: #0a0a0a;
    --text-on-dark: #e0e0e8;
    --siren-blue: #2040e0;
}

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

body {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Sidebar: Precinct Filing Cabinet --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--sidebar-dark);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow:
        4px 0 8px rgba(0, 0, 0, 0.3),
        8px 0 24px rgba(0, 0, 0, 0.2),
        12px 0 48px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(224, 224, 232, 0.1);
}

/* CSS Police Badge */
.police-badge {
    position: relative;
    width: 42px;
    height: 50px;
    flex-shrink: 0;
}

.badge-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 42px;
    height: 50px;
    background: linear-gradient(135deg, var(--aurora-start), var(--aurora-mid), var(--aurora-end));
    clip-path: polygon(50% 0%, 100% 20%, 100% 70%, 50% 100%, 0% 70%, 0% 20%);
}

.badge-star {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    background: var(--text-on-dark);
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%, 68% 57%,
        79% 91%, 50% 70%, 21% 91%, 32% 57%,
        2% 35%, 39% 35%
    );
}

.sidebar-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 22px;
    letter-spacing: 3px;
}

/* Case File Tabs */
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.case-tab {
    display: flex;
    align-items: center;
    padding: 14px 24px 14px 20px;
    color: var(--text-on-dark);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1.5px;
    position: relative;
    clip-path: polygon(0 0, 92% 0, 100% 50%, 92% 100%, 0 100%);
    transition: background 0.2s ease;
    cursor: pointer;
}

.case-tab:hover {
    background: rgba(224, 224, 232, 0.08);
}

.case-tab.active {
    background: rgba(224, 224, 232, 0.06);
}

.tab-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: background 0.3s ease;
}

.case-tab.active .tab-indicator {
    background: linear-gradient(180deg, var(--aurora-start), var(--aurora-mid), var(--aurora-end));
}

.tab-label {
    flex: 1;
}

.tab-count {
    background: rgba(224, 224, 232, 0.12);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
}

.case-tab.active .tab-count {
    background: rgba(224, 160, 48, 0.3);
    color: var(--alert-amber);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(224, 224, 232, 0.1);
}

.precinct-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.precinct-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    opacity: 0.5;
}

.precinct-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--aurora-end);
}

/* --- Main Content: Investigation Board --- */
.investigation-board {
    margin-left: 260px;
    flex: 1;
    position: relative;
    min-height: 100vh;
    padding: 0;
}

/* Crime-scene tape overlay */
.crime-tape-overlay {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 40px,
        rgba(26, 122, 74, 0.04) 40px,
        rgba(74, 42, 138, 0.03) 42px,
        transparent 42px,
        transparent 80px,
        rgba(26, 90, 138, 0.04) 80px,
        rgba(224, 160, 48, 0.03) 82px
    );
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    animation: tapeIn 400ms 200ms forwards;
}

@keyframes tapeIn {
    to { opacity: 1; }
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    padding: 100px 60px 60px;
    overflow: visible;
    z-index: 2;
}

.hero-brand {
    position: relative;
    display: inline-block;
}

.hero-title {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(48px, 8vw, 120px);
    line-height: 0.9;
    color: var(--text-primary);
    letter-spacing: -2px;
    margin-left: -8px;
    margin-right: -20%;
    overflow: visible;
    opacity: 0;
    animation: heroIn 600ms 400ms forwards;
}

@keyframes heroIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hero-dev {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(14px, 2vw, 20px);
    font-weight: 400;
    color: var(--aurora-end);
    letter-spacing: 2px;
    position: absolute;
    top: 8px;
    right: -60px;
    transform: rotate(90deg);
    transform-origin: left center;
    opacity: 0;
    animation: devRotateIn 500ms 800ms forwards;
}

@keyframes devRotateIn {
    0% { opacity: 0; transform: rotate(0deg); }
    100% { opacity: 1; transform: rotate(90deg); }
}

.hero-tagline {
    margin-top: 40px;
    font-family: 'Inter', sans-serif;
    font-size: clamp(15px, 1.5vw, 18px);
    font-weight: 400;
    color: var(--text-primary);
    opacity: 0.7;
    max-width: 480px;
    line-height: 1.7;
}

/* --- Violations Section --- */
.violations-section {
    position: relative;
    padding: 20px 60px 60px;
    z-index: 2;
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 48px);
    color: var(--text-primary);
    margin-bottom: 40px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--alert-red);
    display: inline-block;
    letter-spacing: 2px;
}

/* Violation Cards — Mugshot Style */
.violation-card {
    position: relative;
    background: #fff;
    border: 2px solid var(--text-primary);
    margin-top: var(--card-margin-top, 0);
    margin-left: var(--card-margin-left, 0);
    margin-bottom: 28px;
    max-width: 640px;
    transform: rotate(var(--card-rotate, 0deg));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    box-shadow: 4px 4px 0 var(--text-primary);
}

.violation-card:hover {
    transform: rotate(0deg) perspective(600px) rotateX(-2deg) rotateY(2deg) translateY(-4px);
    box-shadow: 8px 8px 0 var(--text-primary), 12px 12px 24px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--sidebar-dark);
    color: var(--text-on-dark);
    border-bottom: 2px solid var(--text-primary);
}

.violation-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1px;
    flex: 1;
}

.severity-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1.5px;
    padding: 3px 10px;
    border-radius: 2px;
}

.severity-error {
    background: var(--alert-red);
    color: #fff;
}

.severity-warning {
    background: var(--alert-amber);
    color: var(--text-primary);
}

.severity-info {
    background: var(--siren-blue);
    color: #fff;
}

.magnifier {
    font-size: 18px;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.violation-card:hover .magnifier {
    opacity: 1;
    transform: scale(1);
}

.card-code {
    padding: 0;
    background: var(--sidebar-dark);
    overflow-x: auto;
}

.card-code pre {
    margin: 0;
    padding: 12px 16px;
}

.card-code code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-on-dark);
    line-height: 1.7;
}

.code-line {
    display: block;
}

.error-line {
    background: rgba(224, 48, 48, 0.15);
    margin: 0 -16px;
    padding: 0 16px;
}

.error-highlight {
    color: var(--alert-red);
    transition: background 0.3s ease;
    border-radius: 2px;
    padding: 0 2px;
}

.violation-card:hover .error-highlight {
    background: rgba(224, 48, 48, 0.3);
}

.card-description {
    padding: 14px 16px;
    border-top: 1px solid rgba(10, 10, 10, 0.1);
}

.violation-text {
    font-family: 'Inter', sans-serif;
    font-size: clamp(15px, 1.5vw, 18px);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.violation-text code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    background: rgba(26, 26, 42, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
}

.file-ref {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--aurora-end);
    opacity: 0.8;
}

/* --- Case Footer --- */
.case-footer {
    position: relative;
    z-index: 2;
    padding: 60px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-top: 40px;
    border-top: 3px solid var(--text-primary);
}

.siren {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 8px;
}

.siren-light {
    width: 100%;
    height: 100%;
    background: conic-gradient(
        var(--siren-blue) 0deg,
        var(--alert-red) 120deg,
        var(--siren-blue) 240deg,
        var(--alert-red) 360deg
    );
    animation: sirenSpin 2s linear infinite;
    border-radius: 50%;
}

@keyframes sirenSpin {
    to { transform: rotate(360deg); }
}

.siren.resolved .siren-light {
    animation: none;
    background: var(--aurora-start);
}

.footer-status {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(20px, 3vw, 32px);
    color: var(--alert-red);
    letter-spacing: 2px;
}

.footer-status.resolved {
    color: var(--aurora-start);
}

.footer-sub {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0.5;
}

/* --- Card Entrance Animations --- */
@keyframes slideFromLeft {
    0% { opacity: 0; transform: translateX(-60px) rotate(var(--card-rotate, 0deg)); }
    100% { opacity: 1; transform: translateX(0) rotate(var(--card-rotate, 0deg)); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes scaleUp {
    0% { opacity: 0; transform: scale(0.8) rotate(var(--card-rotate, 0deg)); }
    100% { opacity: 1; transform: scale(1) rotate(var(--card-rotate, 0deg)); }
}

@keyframes slideFromRight {
    0% { opacity: 0; transform: translateX(60px) rotate(var(--card-rotate, 0deg)); }
    100% { opacity: 1; transform: translateX(0) rotate(var(--card-rotate, 0deg)); }
}

.violation-card.anim-slide-left {
    animation: slideFromLeft 0.5s ease forwards;
}

.violation-card.anim-fade {
    animation: fadeIn 0.5s ease forwards;
}

.violation-card.anim-scale {
    animation: scaleUp 0.5s ease forwards;
}

.violation-card.anim-slide-right {
    animation: slideFromRight 0.5s ease forwards;
}

/* --- Category Filtering --- */
.violation-card.hidden {
    display: none;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .sidebar {
        width: 200px;
    }
    .investigation-board {
        margin-left: 200px;
    }
    .crime-tape-overlay {
        left: 200px;
    }
    .hero-section {
        padding: 60px 30px 40px;
    }
    .violations-section {
        padding: 20px 30px 40px;
    }
    .case-footer {
        padding: 40px 30px;
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }
    .sidebar-header {
        padding: 20px 10px;
        justify-content: center;
    }
    .sidebar-brand,
    .tab-label,
    .tab-count,
    .precinct-info {
        display: none;
    }
    .case-tab {
        clip-path: none;
        padding: 14px 10px;
        justify-content: center;
    }
    .tab-indicator {
        width: 3px;
    }
    .investigation-board {
        margin-left: 60px;
    }
    .crime-tape-overlay {
        left: 60px;
    }
    .hero-section {
        padding: 40px 20px 30px;
    }
    .violations-section {
        padding: 10px 20px 30px;
    }
    .case-footer {
        padding: 30px 20px;
    }
    .violation-card {
        max-width: 100%;
        margin-left: 0 !important;
    }
}
