/* ==========================================================================
   37chtt Search & Filter - Modern Dark Mode Design System
   ========================================================================== */

:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --bg-input: #1e293b;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(168, 85, 247, 0.4);

    --primary: #a855f7;
    --primary-hover: #9333ea;
    --secondary: #38bdf8;
    --accent: #10b981;
    --danger: #ef4444;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(168, 85, 247, 0.25);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 15% 15%, rgba(168, 85, 247, 0.12) 0px, transparent 50%),
        radial-gradient(at 85% 85%, rgba(56, 189, 248, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Helper Utilities */
.hidden { display: none !important; }
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* ==========================================================================
   Header & Crawler Status Widget
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text h1 span {
    color: var(--secondary);
    font-weight: 400;
    font-size: 14px;
    margin-left: 6px;
}

.logo-text .subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Clean Header Badges (Normal Portal Style) */
.header-badges {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-muted);
}

.stat-badge strong {
    color: var(--secondary);
    font-weight: 700;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 7px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: #10b981;
}

.status-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.45);
}

.btn-secondary {
    background: #334155;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #475569;
}

.btn-accent {
    background: linear-gradient(135deg, var(--secondary), #0284c7);
    color: #fff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(56, 189, 248, 0.45);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* ==========================================================================
   Main Container & Filter Panel
   ========================================================================== */
.app-container {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 24px;
}

.filter-panel {
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Search Box */
.search-row {
    display: flex;
    gap: 16px;
}

.search-box {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-dim);
    font-size: 16px;
}

.search-box input {
    width: 100%;
    padding: 14px 44px 14px 46px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 15px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.search-clear-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
}

.search-clear-btn:hover {
    color: var(--text-main);
}

.btn-search {
    padding: 0 28px;
    border-radius: var(--radius-md);
}

/* Filter Controls Grid */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
    transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-group select:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.filter-hint {
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.35;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-sep {
    color: var(--text-dim);
}

.price-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.chip-btn:hover,
.chip-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Filter Subbar */
.filter-subbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    font-size: 14px;
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark::after {
    display: block;
}

.results-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
}

.results-summary strong {
    color: var(--secondary);
}

.view-switchers {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.view-btn.active,
.view-btn:hover {
    background: #334155;
    color: var(--text-main);
}

/* ==========================================================================
   Loading & Empty States
   ========================================================================== */
.loading-container {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

.empty-icon {
    font-size: 54px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 20px;
}

/* ==========================================================================
   Card Grid & List Views
   ========================================================================== */
.threads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.thread-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.thread-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-card);
}

/* Card Cover Image */
.card-cover {
    width: 100%;
    height: 180px;
    background: #090d16;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thread-card:hover .card-cover img {
    transform: scale(1.05);
}

.card-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    gap: 8px;
    font-size: 13px;
    background: rgba(15, 23, 42, 0.6);
}

.card-cover-placeholder i {
    font-size: 32px;
    color: #475569;
}

.cover-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* Card Body & Contact Row */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-contact-row {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card-contact-row.no-contact {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.card-contact-main {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    font-size: 12px;
    color: var(--secondary);
    min-width: 0;
}

.card-contact-val {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #38bdf8;
}

.card-no-contact {
    font-size: 12px;
    color: var(--text-dim);
}

.card-copy-btn {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    flex-shrink: 0;
    transition: var(--transition);
}

.card-copy-btn:hover {
    background: #38bdf8;
    color: #fff;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.badge-province {
    background: rgba(168, 85, 247, 0.15);
    color: var(--primary);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-district {
    background: rgba(56, 189, 248, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-area {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.32);
}

.badge-price {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-left: auto;
    font-weight: 700;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-snippet {
    font-size: 13px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    font-size: 12px;
    color: var(--text-dim);
}

.contact-pill {
    color: var(--secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* List Table Mode */
.threads-table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin-bottom: 30px;
}

.threads-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.threads-table th {
    background: rgba(30, 41, 59, 0.8);
    padding: 14px 18px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.threads-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.threads-table tr:hover td {
    background: var(--bg-card-hover);
    cursor: pointer;
}

/* ==========================================================================
   Interactive Hotspot Map
   ========================================================================== */
.hotspot-map-view {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 36px;
}

.hotspot-map-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(120deg, rgba(168, 85, 247, 0.13), rgba(56, 189, 248, 0.06));
}

.hotspot-map-header .eyebrow {
    display: block;
    color: #fbbf24;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 5px;
}

.hotspot-map-header h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.hotspot-map-header p {
    color: var(--text-muted);
    font-size: 13px;
}

.map-legend {
    display: flex;
    gap: 14px;
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.map-legend span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.low { background: #38bdf8; }
.legend-dot.medium { background: #f59e0b; }
.legend-dot.high { background: #ef4444; }

.hotspot-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    min-height: 590px;
}

.hotspot-map-canvas-wrap {
    position: relative;
    min-width: 0;
    border-right: 1px solid var(--border-color);
    background: #17212b;
}

.hotspot-map-canvas {
    width: 100%;
    height: 590px;
    background: #17212b;
}

.map-library-error {
    position: absolute;
    inset: 0;
    z-index: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    background: #17212b;
}

.map-library-error i {
    color: var(--secondary);
    font-size: 38px;
}

.hotspot-side-panel {
    max-height: 590px;
    overflow-y: auto;
    background: rgba(11, 15, 25, 0.75);
}

.hotspot-empty-panel {
    height: 100%;
    min-height: 360px;
    padding: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-dim);
}

.hotspot-empty-panel i {
    font-size: 42px;
    color: var(--secondary);
    opacity: 0.7;
    margin-bottom: 14px;
}

.hotspot-empty-panel h3 {
    color: var(--text-main);
    margin-bottom: 6px;
}

.hotspot-panel-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.hotspot-panel-heading h3 {
    font-size: 18px;
}

.hotspot-panel-heading p {
    color: var(--text-dim);
    font-size: 12px;
}

.hotspot-panel-count {
    min-width: 58px;
    height: 58px;
    padding: 0 8px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(239, 68, 68, 0.25);
}

.nearest-note {
    margin: 14px 18px 0;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.09);
    border: 1px solid rgba(56, 189, 248, 0.2);
    font-size: 12px;
}

.hotspot-panel-caption {
    padding: 15px 18px 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.hotspot-result-list {
    padding: 0 12px 16px;
}

.hotspot-result-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    color: var(--text-main);
    background: transparent;
    border: 1px solid transparent;
    border-bottom-color: var(--border-color);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.hotspot-result-item:hover {
    background: rgba(56, 189, 248, 0.07);
    border-color: rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-sm);
}

.hotspot-result-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hotspot-result-main strong,
.hotspot-result-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hotspot-result-main strong {
    max-width: 215px;
    font-size: 13px;
}

.hotspot-result-main small,
.hotspot-result-meta small {
    color: var(--text-dim);
    font-size: 11px;
}

.hotspot-result-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.hotspot-result-meta b {
    color: var(--accent);
    font-size: 12px;
}

.hotspot-no-results {
    color: var(--text-dim);
    padding: 30px;
    text-align: center;
}

.hotspot-map-tooltip {
    color: #0f172a;
    font-weight: 700;
    border: 0;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.25);
}

.leaflet-container {
    font-family: inherit;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 30px 0 50px;
}

.page-btn {
    padding: 8px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn:not(:disabled):hover {
    background: var(--primary);
    border-color: var(--primary);
}

.page-info {
    color: var(--text-muted);
    font-size: 14px;
}

.page-info strong {
    color: var(--secondary);
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

.modal-header h2 {
    font-size: 22px;
    margin: 10px 0 6px;
    line-height: 1.3;
}

.modal-meta {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

/* Key Value Grid */
.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.kv-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.kv-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.kv-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.price-highlight .kv-value {
    color: var(--accent);
    font-size: 18px;
}

.contact-highlight {
    grid-column: span 2;
}

.contact-val {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--secondary);
}

.copy-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.copy-btn:hover {
    background: var(--secondary);
    color: #fff;
}

/* Detail Boxes */
.detail-box {
    margin-bottom: 20px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.detail-box h3 {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-content {
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    color: #cbd5e1;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.gallery-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.gallery-img:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 20px;
}

/* Logs Console */
.logs-modal-content {
    max-width: 900px;
}

.logs-console {
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #4ade80;
    height: 380px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.5;
    margin: 16px 0;
}

/* Lightbox */
#lightboxModal {
    z-index: 2000;
}

#lightboxImg {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

@media (max-width: 720px) {
    .app-header,
    .app-container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .header-badges,
    .logo-text .subtitle {
        display: none;
    }

    .filter-panel,
    .modal-content {
        padding: 18px;
    }

    .search-row,
    .filter-subbar,
    .results-summary,
    .hotspot-map-header {
        align-items: stretch;
        flex-direction: column;
    }

    .btn-search {
        min-height: 44px;
        justify-content: center;
    }

    .threads-grid {
        grid-template-columns: 1fr;
    }

    .contact-highlight {
        grid-column: span 1;
    }

    .hotspot-map-layout {
        grid-template-columns: 1fr;
    }

    .hotspot-map-canvas-wrap {
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .hotspot-map-canvas {
        height: 420px;
    }

    .hotspot-side-panel {
        max-height: 430px;
    }

    .map-legend {
        flex-wrap: wrap;
    }
}
