/* ═══════════════════════════════════════════════════════
   CONTRABAND — Classified Resource Index
   ═══════════════════════════════════════════════════════ */

/* ─── Stats Bar ──────────────────────────────────────── */
.crt-stats-bar {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(16, 16, 16, 0.8);
    border: 1px solid var(--border);
    border-left: 3px solid var(--mil-red);
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 1px;
    flex-wrap: wrap;
}

.crt-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.crt-stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-transform: uppercase;
}

.crt-stat-value {
    color: var(--status-green);
    font-weight: 700;
    font-size: 1rem;
}

.crt-stat-value.amber { color: var(--status-amber); }
.crt-stat-value.red { color: var(--mil-red); }

/* ─── Search ─────────────────────────────────────────── */
.crt-search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.crt-search-input {
    width: 100%;
    padding: 0.85rem 1.25rem 0.85rem 2.75rem;
    background: rgba(16, 16, 16, 0.9);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    letter-spacing: 1px;
    outline: none;
    transition: all 0.3s ease;
}

.crt-search-input::placeholder {
    color: var(--text-muted);
    letter-spacing: 2px;
}

.crt-search-input:focus {
    border-color: var(--mil-red);
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.15);
}

.crt-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.crt-search-count {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 1px;
}

/* ─── Filter Toggles ─────────────────────────────────── */
.crt-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.crt-filter-btn {
    padding: 0.4rem 0.85rem;
    background: rgba(16, 16, 16, 0.8);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.crt-filter-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.crt-filter-btn.active {
    border-color: var(--mil-red);
    color: #fff;
    background: rgba(139, 0, 0, 0.15);
}

/* ─── Category Grid ──────────────────────────────────── */
.crt-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.crt-card {
    background: rgba(16, 16, 16, 0.6);
    border: 1px solid var(--border);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.crt-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--mil-red);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.crt-card:hover {
    border-color: var(--text-muted);
    background: rgba(20, 20, 20, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.crt-card:hover::before { opacity: 1; }

.crt-card-code {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--mil-red);
    letter-spacing: 2px;
    margin-bottom: 0.35rem;
    opacity: 0.8;
}

.crt-card-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
}

.crt-card-icon {
    float: right;
    font-size: 1.8rem;
    opacity: 0.5;
    margin-top: -0.25rem;
}

.crt-card-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.crt-card-count {
    color: var(--status-green);
}

.crt-card-stars {
    color: var(--status-amber);
}

.crt-card-status {
    font-size: 0.9rem;
    color: var(--status-green);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ─── Back Button ────────────────────────────────────── */
.crt-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 16, 16, 0.8);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.crt-back:hover {
    border-color: var(--mil-red);
    color: #fff;
}

/* ─── Category Detail Header ─────────────────────────── */
.crt-detail-header {
    padding: 1.5rem;
    background: rgba(16, 16, 16, 0.8);
    border: 1px solid var(--border);
    border-left: 3px solid var(--mil-red);
    margin-bottom: 1.5rem;
}

.crt-detail-code {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--mil-red);
    letter-spacing: 3px;
    margin-bottom: 0.25rem;
}

.crt-detail-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.crt-detail-meta {
    display: flex;
    gap: 1.5rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ─── Subcategory Grid (4-col cards) ─────────────────── */
.crt-sub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.crt-sub-card {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid var(--border);
    border-left: 3px solid var(--status-amber);
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.crt-sub-card:hover {
    background: rgba(30, 30, 30, 0.95);
    border-left-color: var(--mil-red);
    transform: translateY(-1px);
}

.crt-sub-card.active {
    background: rgba(35, 35, 35, 0.95);
    border-color: var(--status-amber);
    border-left-color: var(--status-amber);
    box-shadow: 0 0 12px rgba(201, 162, 39, 0.15);
}

.crt-sub-card-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.crt-sub-card-stats {
    display: flex;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.crt-sub-card-stats .amber {
    color: var(--warning);
}

/* ─── Subcategory Detail Panel ───────────────────────── */
.crt-sub-detail {
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    border-top: 2px solid var(--status-amber);
    background: rgba(16, 16, 16, 0.95);
}

.crt-sub-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.2rem;
    background: rgba(20, 20, 20, 0.9);
    border-bottom: 1px solid var(--border);
}

.crt-sub-detail-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
    flex: 1;
}

.crt-sub-toggle {
    color: var(--text-muted);
    font-size: 1rem;
}

.crt-sub-count {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.crt-sub-detail-notes {
    padding: 0.6rem 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--status-amber);
    line-height: 1.5;
    border-bottom: 1px solid var(--border);
    background: rgba(201, 162, 39, 0.05);
}

.crt-sub-detail-entries {
    /* entries rendered inside here */
}

/* ─── Responsive subcategory grid ────────────────────── */
@media (max-width: 768px) {
    .crt-sub-grid { grid-template-columns: 1fr; }
}


/* ─── Entry List ─────────────────────────────────────── */
.crt-entries {
    border: 1px solid var(--border);
    border-top: none;
}

.crt-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
    font-family: var(--font-mono);
}

.crt-entry:last-child { border-bottom: none; }

.crt-entry:hover {
    background: rgba(255, 255, 255, 0.02);
}

.crt-entry-star {
    color: var(--status-amber);
    font-size: 0.9rem;
    min-width: 1rem;
    text-align: center;
    padding-top: 0.1rem;
}

.crt-entry-content {
    flex: 1;
    min-width: 0;
}

.crt-entry-name {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.crt-entry-name a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.crt-entry-name a:hover {
    color: var(--mil-red);
}

.crt-entry.starred .crt-entry-name a {
    color: #fff;
}

.crt-entry-desc {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 0.15rem;
}

.crt-entry-extra {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.2rem;
}

.crt-entry-extra a {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.1rem 0.3rem;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.crt-entry-extra a:hover {
    border-color: var(--mil-red);
    color: var(--text-secondary);
}

/* ─── Search Results ─────────────────────────────────── */
.crt-search-results {
    margin-top: 1rem;
}

.crt-search-result {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-bottom: none;
    background: rgba(16, 16, 16, 0.6);
    transition: all 0.2s ease;
}

.crt-search-result:last-child { border-bottom: 1px solid var(--border); }
.crt-search-result:hover { background: rgba(20, 20, 20, 0.9); }

.crt-result-breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--mil-red);
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.crt-result-name {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
}

.crt-result-name a {
    color: var(--text-primary);
    text-decoration: none;
}

.crt-result-name a:hover { color: var(--mil-red); }

.crt-result-desc {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* ─── Loading State ──────────────────────────────────── */
.crt-loading {
    text-align: center;
    padding: 3rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.crt-loading::after {
    content: '';
    animation: crt-blink 0.8s infinite;
}

@keyframes crt-blink {
    0%, 100% { content: '█'; }
    50% { content: ' '; }
}

/* ─── Empty State ────────────────────────────────────── */
.crt-empty {
    text-align: center;
    padding: 3rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    border: 1px dashed var(--border);
}

/* ─── Attribution ───────────────────────────────── */
.crt-attribution {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: rgba(16, 16, 16, 0.5);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-align: center;
}

.crt-attribution a {
    color: var(--status-amber);
    text-decoration: none;
}

.crt-attribution a:hover {
    color: #fff;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 1200px) {
    .crt-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .crt-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .crt-stats-bar {
        gap: 1rem;
        padding: 0.75rem 1rem;
    }
    .crt-grid {
        grid-template-columns: 1fr;
    }
    .crt-detail-title {
        font-size: 1rem;
    }
    .crt-entry {
        padding: 0.5rem 0.75rem;
    }
    .crt-filters {
        gap: 0.4rem;
    }
}

/* ─── Subcategory Group Headings (Awesomelist) ─────────── */
.crt-subcat-group {
    margin-bottom: 0.5rem;
}
.crt-subcat-heading {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    color: rgba(255, 170, 0, 0.8);
    letter-spacing: 2px;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(255, 170, 0, 0.15);
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.2s;
}
.crt-subcat-heading:hover {
    background: rgba(255, 170, 0, 0.06);
    color: rgba(255, 170, 0, 1);
}
.crt-subcat-heading.expanded {
    background: rgba(255, 170, 0, 0.08);
    border-bottom-color: rgba(255, 170, 0, 0.3);
}
.crt-subcat-arrow {
    display: inline-block;
    width: 1rem;
    font-size: 0.7rem;
    color: rgba(255, 170, 0, 0.6);
    transition: transform 0.2s;
}
.crt-subcat-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #666;
    margin-left: 0.5rem;
}
.crt-subcat-entries {
    padding-left: 0.5rem;
    border-left: 1px solid rgba(255, 170, 0, 0.1);
    margin-left: 0.4rem;
}
