/* ---------------------------------------------------------
   PAGE LAYOUT
--------------------------------------------------------- */

.cases-main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 100px 24px 60px;
}

.cases-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.cases-title {
    font-family: 'Special Elite', system-ui, sans-serif;
    font-size: 26px;
    letter-spacing: 0.04em;
    margin: 0 0 4px;
    color: #f9fafb;
}

.cases-subtitle {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
}

/* ---------------------------------------------------------
   SEARCH BAR
--------------------------------------------------------- */

.cases-search {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cases-search-input {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(148,163,184,0.3);
    background: #020617;
    color: #e5e7eb;
    min-width: 260px;
    font-size: 14px;
}

.cases-search-input::placeholder {
    color: rgba(148,163,184,0.6);
}

.cases-search-button {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid rgba(148,163,184,0.3);
    background: #111827;
    color: #e5e7eb;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.cases-search-button:hover {
    background: #1f2937;
}

/* ---------------------------------------------------------
   GRID LAYOUT
--------------------------------------------------------- */

.cases-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

/* ---------------------------------------------------------
   CASEFILE PANEL (FULL DUPLICATION FROM HOMEPAGE)
--------------------------------------------------------- */

.casefile-panel {
    position: relative;
    background: #020617;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow:
        0 18px 40px rgba(0,0,0,0.85),
        0 0 0 1px rgba(15,23,42,0.9);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.casefile-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 3px;
    background: linear-gradient(to bottom, #b91c1c, #f97373);
    opacity: 0.9;
}

/* TAB */

.casefile-tab {
    position: relative;
    background: linear-gradient(90deg, #020617, #111827);
    padding: 6px 12px 6px 18px;
    border-bottom: 1px solid rgba(148,163,184,0.3);
    font-family: 'Special Elite', system-ui, sans-serif;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e5e7eb;
}

/* BODY */

.casefile-body {
    position: relative;
    padding: 14px 16px 10px 22px;
    background-image: linear-gradient(
        to bottom,
        rgba(15,23,42,0.9),
        rgba(15,23,42,0.98)
    );
}

/* NEW: FLEX LAYOUT FOR THUMB + TEXT */

.casefile-body-flex {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

/* THUMBNAIL */

.casefile-thumb {
    width: 120px;
    height: 120px;
    border-radius: 6px;
    overflow: hidden;
    background: #111;
    flex-shrink: 0;
}

.casefile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* TEXT BLOCK */

.casefile-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.casefile-title {
    font-family: 'Special Elite', system-ui, sans-serif;
    font-size: 16px;
    margin: 0;
    color: #f9fafb;
}

.casefile-title a {
    color: inherit;
    text-decoration: none;
}

.casefile-title a:hover {
    text-decoration: underline;
}

.casefile-meta {
    font-size: 13px;
    color: #e5e7eb;
    margin: 0;
}

.casefile-meta span {
    color: #f97373;
}

.casefile-location {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

/* FOOTER */

.casefile-footer {
    padding: 10px 0 0;
    margin-top: auto;
}

.casefile-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 999px;
    border: 1px solid rgba(248,113,113,0.8);
    color: #fecaca;
    background: radial-gradient(circle at top, rgba(248,113,113,0.18), rgba(127,29,29,0.9));
    text-decoration: none;
    box-shadow: 0 0 12px rgba(248,113,113,0.5);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.casefile-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(248,113,113,0.8);
    background: radial-gradient(circle at top, rgba(248,113,113,0.25), rgba(127,29,29,1));
}

/* ---------------------------------------------------------
   PAGINATION
--------------------------------------------------------- */

.cases-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 32px;
}

.page-link {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(148,163,184,0.3);
    background: #111827;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 13px;
}

.page-link:hover {
    background: #1f2937;
}

.page-numbers {
    display: flex;
    gap: 6px;
}

.page-number {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(148,163,184,0.3);
    background: #020617;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 13px;
}

.page-number.current {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

/* ---------------------------------------------------------
   EMPTY STATE
--------------------------------------------------------- */

.cases-empty {
    margin-top: 40px;
    text-align: center;
    color: #9ca3af;
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */

@media (max-width: 1100px) {
    .cases-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .cases-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .casefile-body-flex {
        flex-direction: row;
    }

    .casefile-thumb {
        width: 100px;
        height: 100px;
    }
}

        /* Active filter badges */
        .active-filters {
            margin: 10px 0 20px;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
        }
        .filter-badge {
            background: #111827;
            border: 1px solid rgba(248,113,113,0.4);
            padding: 6px 10px;
            border-radius: 6px;
            color: #fca5a5;
            font-size: 13px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .filter-badge--category {
            border-color: rgba(96,165,250,0.6);
            color: #bfdbfe;
        }
        .filter-badge a {
            color: #f87171;
            text-decoration: none;
            font-weight: bold;
        }
        .clear-filters {
            margin-left: 6px;
            color: #9ca3af;
            font-size: 13px;
            text-decoration: underline;
        }

        /* TAG FILTER MODAL */
        .tag-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.85);
            backdrop-filter: blur(2px);
            display: none;
            justify-content: center;
            align-items: flex-start;
            z-index: 9999;
        }
        .tag-modal-overlay.active {
            display: flex;
        }
        .tag-modal {
            width: 100%;
            max-width: 900px;
            margin-top: -100%;
            background: #0a0f1c;
            border: 1px solid rgba(248,113,113,0.4);
            border-radius: 10px;
            box-shadow: 0 0 25px rgba(248,113,113,0.4);
            animation: slideDown 0.45s ease forwards;
            position: relative;
            overflow: hidden;
        }
        .tag-modal-alert-bar {
            height: 6px;
            background: linear-gradient(90deg, #b91c1c, #f87171);
            animation: pulseEdge 2s infinite ease-in-out;
        }
        .tag-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 18px 22px;
            border-bottom: 1px solid rgba(148,163,184,0.25);
        }
        .tag-modal-title {
            font-family: 'Special Elite', system-ui, sans-serif;
            font-size: 22px;
            color: #f9fafb;
            margin: 0;
        }
        .tag-modal-close {
            background: none;
            border: none;
            font-size: 26px;
            color: #fca5a5;
            cursor: pointer;
        }
        .tag-modal-body {
            padding: 20px 22px 10px;
            max-height: 60vh;
            overflow-y: auto;
        }
        .filter-section {
            margin-bottom: 18px;
        }
        .filter-section-title {
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: #9ca3af;
            margin: 0 0 8px;
        }
        .tag-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }
        .tag-pill {
            padding: 8px 14px;
            border-radius: 20px;
            background: #111827;
            border: 1px solid rgba(248,113,113,0.4);
            color: #fca5a5;
            font-size: 14px;
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease;
        }
        .tag-pill:hover {
            background: #1f2937;
        }
        .tag-pill.active {
            background: #b91c1c;
            border-color: #b91c1c;
            color: #fff;
        }
        .tag-pill--category {
            border-color: rgba(96,165,250,0.6);
            color: #bfdbfe;
        }
        .tag-pill--category.active {
            background: #1d4ed8;
            border-color: #1d4ed8;
            color: #fff;
        }
        .tag-modal-footer {
            padding: 18px 22px;
            border-top: 1px solid rgba(148,163,184,0.25);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .tag-modal-apply {
            padding: 8px 16px;
            background: #b91c1c;
            border: 1px solid #b91c1c;
            color: #fff;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
        }
        .tag-modal-clear {
            color: #9ca3af;
            font-size: 14px;
            text-decoration: underline;
        }
        .open-tag-modal-btn {
            margin-bottom: 12px;
            padding: 8px 14px;
            border-radius: 6px;
            border: 1px solid rgba(148,163,184,0.3);
            background: #111827;
            color: #e5e7eb;
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            cursor: pointer;
        }
        .open-tag-modal-btn:hover {
            background: #1f2937;
        }
        @keyframes slideDown {
            from { margin-top: -100%; }
            to { margin-top: 40px; }
        }
        @keyframes pulseEdge {
            0%, 100% { box-shadow: 0 0 10px rgba(248,113,113,0.4); }
            50% { box-shadow: 0 0 20px rgba(248,113,113,0.8); }
        }
        @media (max-width: 700px) {
            .tag-modal {
                margin-top: 20px;
                width: calc(100% - 24px);
            }
        }
