/* Threadlinqs Intelligence - Feedly-inspired Dark Theme */
:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-card: #1e1e1e;
    --bg-hover: #252525;
    --bg-active: #2a2a2a;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    
    --border-color: #2a2a2a;
    --border-light: #333333;
    
    --accent-primary: #ffffff;
    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --highlight-bg: rgba(234, 179, 8, 0.3);
    --highlight-text: #fbbf24;
    
    --severity-critical: #ef4444;
    --severity-high: #f97316;
    --severity-medium: #eab308;
    --severity-low: #22c55e;
    
    --sidebar-width: 260px;
    --detail-width: 700px;
    --header-height: 64px;
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.mobile-menu-btn,
.mobile-filter-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 200;
}

.sidebar-close {
    display: none;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-icon {
    font-size: 24px;
}

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

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-label {
    flex: 1;
}

.nav-count {
    font-size: 12px;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-muted);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

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

.stats-mini .dot {
    margin: 0 6px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 150;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-primary);
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-container {
    position: relative;
}

.search-input {
    width: 220px;
    padding: 10px 16px 10px 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.15s ease;
}

.search-input:focus {
    border-color: var(--border-light);
    background: var(--bg-card);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-muted);
}

.advanced-search-btn {
    padding: 10px 16px;
    background: var(--accent-blue);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.advanced-search-btn:hover {
    background: #2563eb;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.15s ease;
}

.stat-card:hover {
    border-color: var(--border-light);
}

.stat-card.critical {
    border-left: 3px solid var(--severity-critical);
}

.stat-card.high {
    border-left: 3px solid var(--severity-high);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Filters Section */
.filters-section {
    padding: 0 32px;
    margin-bottom: 16px;
}

.filters-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filters-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filters-toggle-icon {
    font-size: 16px;
}

.filters-toggle-text {
    flex: 1;
    text-align: left;
}

.filters-toggle-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.filters-toggle-arrow.open {
    transform: rotate(180deg);
}

.filters-panel {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 20px;
}

.filters-panel.open {
    display: block;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

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

.filter-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.filter-select {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.filter-select:focus {
    border-color: var(--accent-blue);
}

.filters-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.filter-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.filter-btn-clear:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.filter-results {
    font-size: 13px;
    color: var(--text-muted);
}

/* Threats Section */
.threats-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 32px 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
}

.sort-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.threats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Threat Card */
.threat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.threat-card:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.threat-card.active {
    border-color: var(--accent-blue);
}

.threat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.threat-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.threat-id {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: 'SF Mono', monospace;
}

.severity-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--severity-critical);
}

.severity-badge.high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--severity-high);
}

.severity-badge.medium {
    background: rgba(234, 179, 8, 0.15);
    color: var(--severity-medium);
}

.severity-badge.low {
    background: rgba(34, 197, 94, 0.15);
    color: var(--severity-low);
}

.threat-card-date {
    font-size: 12px;
    color: var(--text-muted);
}

.threat-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.threat-card-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.threat-card-footer {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.threat-tag {
    font-size: 11px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-secondary);
}

.threat-tag.mitre {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.detection-count {
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    border-radius: 4px;
    margin-left: auto;
}

.view-count {
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border-radius: 4px;
}

.popularity-badge {
    font-size: 14px;
    margin-left: 4px;
}

/* Research Lab Tag - for threats created via Research Lab */
.research-lab-tag {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Advanced Search Modal */
.search-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 400;
}

.search-modal.open {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10vh;
}

.search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.search-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.search-modal-input-wrap {
    position: relative;
    padding: 16px 24px;
}

.search-modal-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: all 0.15s ease;
}

.search-modal-input:focus {
    border-color: var(--accent-blue);
}

.search-modal-input::placeholder {
    color: var(--text-muted);
}

.search-modal-icon {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
}

.search-modal-hint {
    padding: 0 24px 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.search-modal-results {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
}

.search-result-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-result-item:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
}

.search-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.search-result-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.search-result-snippet {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.search-result-snippet mark {
    background: var(--highlight-bg);
    color: var(--highlight-text);
    padding: 1px 4px;
    border-radius: 2px;
}

.search-result-count {
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.search-no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Detail Modal */
.detail-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
}

.detail-modal.open {
    display: flex;
    justify-content: center;
    align-items: center;
}

.detail-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
}

.detail-panel {
    position: relative;
    width: 90%;
    max-width: var(--detail-width);
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.detail-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.detail-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-id {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-blue);
    font-family: 'SF Mono', monospace;
}

.share-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.share-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.detail-title {
    font-size: 22px;
    font-weight: 600;
    margin-top: 8px;
    padding-right: 50px;
    line-height: 1.4;
}

.detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.detail-section {
    margin-bottom: 28px;
}

.detail-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.detail-section-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-meta-item {
    background: var(--bg-tertiary);
    padding: 14px;
    border-radius: var(--radius-sm);
}

.detail-meta-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-meta-value {
    font-size: 14px;
    font-weight: 500;
}

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

.mitre-tag {
    font-size: 12px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-blue);
}

.detection-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 14px;
}

.detection-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.detection-item-name {
    font-size: 15px;
    font-weight: 600;
}

.detection-item-severity {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
}

.detection-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.6;
}

.detection-query-wrap {
    position: relative;
}

.detection-query {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 14px;
    padding-right: 60px;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 12px;
    color: var(--accent-green);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

/* Detection query type-specific backgrounds (threat detail panel) */
.detection-query.spl {
    background: linear-gradient(135deg, #0d1f0d 0%, var(--bg-primary) 100%);
    border-left: 3px solid #4ade80;
    color: #4ade80;
}

.detection-query.kql {
    background: linear-gradient(135deg, #1a0d2e 0%, var(--bg-primary) 100%);
    border-left: 3px solid #a78bfa;
    color: #e0b0ff;
}

.detection-query.sigma {
    background: linear-gradient(135deg, #0d1a2e 0%, var(--bg-primary) 100%);
    border-left: 3px solid #60a5fa;
    color: #93c5fd;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.copy-btn.copied {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 500;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
}

.loading-state .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 14px;
}

/* ==================== RESPONSIVE / MOBILE ==================== */

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

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 56px;
    }
    
    .main-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
        flex-direction: column;
    }
    
    .search-input {
        width: 100%;
    }
    
    .advanced-search-btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .filters-section {
        padding: 0 16px;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .threats-section {
        padding: 0 16px 24px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .sort-select {
        width: 100%;
    }
    
    .threat-card {
        padding: 16px;
    }
    
    .threat-card-title {
        font-size: 15px;
    }
    
    .detail-panel {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
    
    .detail-header {
        padding: 20px 16px;
    }
    
    .detail-title {
        font-size: 18px;
        padding-right: 40px;
    }
    
    .detail-content {
        padding: 16px;
    }
    
    .detail-meta-grid {
        grid-template-columns: 1fr;
    }
    
    .detection-item {
        padding: 14px;
    }
    
    .detection-query {
        font-size: 11px;
        padding: 12px;
    }
    
    .search-modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
    
    .search-modal.open {
        padding-top: 0;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .threat-card-footer {
        gap: 6px;
    }
    
    .threat-tag {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Query Language Tabs */
.query-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

.query-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.query-tab:hover {
    color: var(--text-secondary);
}

.query-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* Query tab type-specific active colors */
.query-tab[data-tab="spl"].active {
    color: #4ade80;
    border-bottom-color: #4ade80;
}

.query-tab[data-tab="kql"].active {
    color: #a78bfa;
    border-bottom-color: #a78bfa;
}

.query-tab[data-tab="sigma"].active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

/* Triple Query Tabs - SPL, KQL, Sigma with colors */
.query-tabs.triple-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 6px 6px 0 0;
}

.query-tabs.triple-tabs .query-tab {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

/* SPL Tab - Green */
.query-tab.spl-tab {
    color: var(--text-muted);
}

.query-tab.spl-tab:hover {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.query-tab.spl-tab.active {
    color: #4ade80 !important;
    border-bottom-color: #4ade80 !important;
    background: rgba(74, 222, 128, 0.15);
}

/* KQL Tab - Purple */
.query-tab.kql-tab {
    color: var(--text-muted);
}

.query-tab.kql-tab:hover {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
}

.query-tab.kql-tab.active {
    color: #a78bfa !important;
    border-bottom-color: #a78bfa !important;
    background: rgba(167, 139, 250, 0.15);
}

/* Sigma Tab - Blue */
.query-tab.sigma-tab {
    color: var(--text-muted);
}

.query-tab.sigma-tab:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.query-tab.sigma-tab.active {
    color: #60a5fa !important;
    border-bottom-color: #60a5fa !important;
    background: rgba(96, 165, 250, 0.15);
}

/* Detection Query Code Colors */
.detection-query.spl {
    border-left: 3px solid #4ade80;
}

.detection-query.kql {
    border-left: 3px solid #a78bfa;
}

.detection-query.sigma {
    border-left: 3px solid #60a5fa;
}

/* Detection Library Specific Tabs */
.det-lib-query-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 4px 4px 0 0;
}

.det-lib-tab {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
    margin-bottom: -2px;
}

.det-lib-tab.spl-tab:hover {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.det-lib-tab.spl-tab.active {
    color: #4ade80;
    border-bottom-color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
}

.det-lib-tab.kql-tab:hover {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
}

.det-lib-tab.kql-tab.active {
    color: #a78bfa;
    border-bottom-color: #a78bfa;
    background: rgba(167, 139, 250, 0.15);
}

.det-lib-tab.sigma-tab:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.det-lib-tab.sigma-tab.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
}

/* Detection Library Query Panels */
.det-lib-query-panel {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 0 0 4px 4px;
}

.det-lib-query-panel .det-query-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.det-lib-query-panel .query-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.det-lib-query-panel .query-label.spl-label {
    color: #4ade80;
}

.det-lib-query-panel .query-label.kql-label {
    color: #a78bfa;
}

.det-lib-query-panel .query-label.sigma-label {
    color: #60a5fa;
}

/* Query code blocks with colored borders */
.det-query-code.spl {
    border-left: 3px solid #4ade80;
}

.det-query-code.kql {
    border-left: 3px solid #a78bfa;
}

.det-query-code.sigma {
    border-left: 3px solid #60a5fa;
}

/* Multi-format badge for detection cards */
.det-multi-badge {
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.2), rgba(167, 139, 250, 0.2), rgba(251, 146, 60, 0.2));
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

/* ===== TRENDING SECTION ===== */
.trending-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.trending-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.trending-icon {
    font-size: 16px;
}

.trending-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.trending-item {
    flex: 1;
    min-width: 200px;
    max-width: 280px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trending-item:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.trending-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.trending-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.trending-badge.new {
    background: #22c55e;
    color: white;
}

.trending-badge.urgent {
    background: #ef4444;
    color: white;
    animation: pulse 1.5s infinite;
}

.trending-badge.active {
    background: #f59e0b;
    color: white;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.trending-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trending-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trending-id {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

/* ===== TIMELINE ===== */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 16px;
}

.timeline-event {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding-bottom: 24px;
}

.timeline-event:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 1;
    flex-shrink: 0;
}

.timeline-event.past .timeline-dot {
    border-color: var(--accent-blue);
    background: var(--bg-primary);
}

.timeline-event.future .timeline-dot {
    border-color: var(--border-color);
    opacity: 0.6;
}

.timeline-line {
    position: absolute;
    left: 15px;
    top: 32px;
    width: 2px;
    height: calc(100% - 8px);
    background: var(--border-color);
}

.timeline-event.past .timeline-line {
    background: var(--accent-blue);
}

.timeline-content {
    margin-left: 16px;
    padding-top: 4px;
}

.timeline-date {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.timeline-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 2px;
}

/* ===== RELATED THREATS ===== */
.related-threats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.related-threat-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.related-threat-item:hover {
    border-color: var(--accent-blue);
    background: var(--bg-secondary);
}

.related-threat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.related-threat-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-threat-actor {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===== MOBILE RESPONSIVE FOR NEW SECTIONS ===== */
@media (max-width: 768px) {
    .trending-section {
        padding: 12px;
    }
    
    .trending-list {
        flex-direction: column;
    }
    
    .trending-item {
        max-width: 100%;
    }
    
    .timeline-container {
        padding-left: 8px;
    }
    
    .related-threats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== HEADER STATS (COMPACT) ===== */
.header-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.header-stat {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-stat strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-stat.critical strong {
    color: #ef4444;
}

.header-stat.high strong {
    color: #f59e0b;
}

/* Remove old stats grid since we moved to header */
.stats-grid {
    display: none;
}

@media (max-width: 768px) {
    .header-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-stat {
        font-size: 12px;
    }
    
    .header-stat strong {
        font-size: 14px;
    }
}

/* ===== CHANGELOG PAGE ===== */
.changelog-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.changelog-intro {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.changelog-entry {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid var(--accent-blue);
}

.changelog-entry.changelog-major {
    border-left-color: #22c55e;
}

.changelog-entry.changelog-milestone {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(245, 158, 11, 0.1) 100%);
}

.changelog-entry.changelog-feature {
    border-left-color: #3b82f6;
}

.changelog-entry.changelog-improvement {
    border-left-color: #8b5cf6;
}

.changelog-entry.changelog-fix {
    border-left-color: #ef4444;
}

.changelog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.changelog-version {
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.changelog-type {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    text-transform: uppercase;
}

.changelog-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.changelog-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.changelog-changes {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.changelog-changes li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 0 4px 20px;
    position: relative;
}

.changelog-changes li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
}

.changelog-author {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== ABOUT PAGE ===== */
.about-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.about-hero {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 24px;
}

.about-avatar {
    font-size: 64px;
    margin-bottom: 16px;
}

.about-hero h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.about-tagline {
    font-size: 16px;
    color: var(--text-muted);
    font-style: italic;
}

.about-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.about-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.about-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.about-section li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.about-section li:last-child {
    border-bottom: none;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.about-stat {
    text-align: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.about-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-blue);
    display: block;
}

.about-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.about-section blockquote {
    font-size: 16px;
    color: var(--text-primary);
    font-style: italic;
    border-left: 3px solid var(--accent-blue);
    padding-left: 16px;
    margin: 0;
}

.about-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

@media (max-width: 768px) {
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .changelog-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .changelog-date {
        margin-left: 0;
    }
}

/* ===== API DOCUMENTATION PAGE ===== */
.api-docs-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.api-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.api-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.api-code {
    display: block;
    background: var(--bg-primary);
    padding: 12px 16px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    color: var(--accent-blue);
    word-break: break-all;
}

.api-endpoint {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
}

.api-method {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

.api-method.get {
    background: #22c55e;
    color: white;
}

.api-method.post {
    background: #3b82f6;
    color: white;
}

.api-endpoint code {
    font-family: monospace;
    font-size: 14px;
    color: var(--text-primary);
}

.api-endpoint p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0 0 0;
}

.api-params {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.api-params strong {
    font-size: 12px;
    color: var(--text-muted);
}

.api-params ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.api-params li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.api-params code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.api-example {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-secondary);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.api-notice {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.api-notice h3 {
    color: #f59e0b;
}

/* ===== IOC CORRELATION PAGE ===== */
.correlation-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.correlation-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.correlation-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.correlation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.correlation-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
}

.correlation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.actor-name, .ioc-value {
    font-weight: 600;
    color: var(--text-primary);
}

.threat-count {
    font-size: 12px;
    background: var(--accent-blue);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.correlated-threats {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.correlated-threats li {
    padding: 4px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.correlated-threats li:last-child {
    border-bottom: none;
}

.correlated-threats a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.correlated-threats a:hover {
    text-decoration: underline;
}

.technique-card .correlation-header {
    flex-direction: column;
    align-items: flex-start;
}

.technique-id {
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.technique-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.technique-threats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.threat-chip {
    font-size: 11px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.threat-chip:hover {
    background: var(--accent-blue);
    color: white;
}

.more-threats {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 8px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tag-item {
    color: var(--accent-blue);
    cursor: pointer;
    transition: color 0.2s;
}

.tag-item:hover {
    color: var(--text-primary);
}

.no-data {
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

@media (max-width: 768px) {
    .correlation-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== ROADMAP PANEL ===== */
.changelog-page-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.changelog-main {
    min-width: 0;
}

.roadmap-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.roadmap-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.roadmap-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.roadmap-header p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.roadmap-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roadmap-idea {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.roadmap-priority {
    font-size: 12px;
    flex-shrink: 0;
}

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

.roadmap-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.roadmap-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.roadmap-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.roadmap-footer p {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
}

.roadmap-empty {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    padding: 20px;
}

@media (max-width: 900px) {
    .changelog-page-layout {
        grid-template-columns: 1fr;
    }
    
    .roadmap-panel {
        position: static;
        order: -1;
    }
}

/* ===== ANALYTICS & POPULARITY ===== */
.popularity-badge {
    display: inline-block;
    font-size: 11px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
}

.copy-btn.copied,
.detection-copy-btn.copied {
    background: #22c55e !important;
    color: white !important;
}

.stats-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-blue);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.engagement-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.engagement-indicator span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== KEYBOARD SHORTCUTS MODAL ===== */
.shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcuts-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.shortcuts-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
}

.shortcuts-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    text-align: center;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--bg-primary);
    border-radius: 6px;
}

.shortcut kbd {
    display: inline-block;
    min-width: 32px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

.shortcut span {
    font-size: 13px;
    color: var(--text-secondary);
}

.shortcuts-footer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin: 16px 0 0 0;
}

/* ===== DAILY DEBRIEF PAGE ===== */
.debrief-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.debrief-loading,
.debrief-empty,
.debrief-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.debrief-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.debrief-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.debrief-date {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.debrief-stats {
    display: flex;
    gap: 16px;
}

.debrief-stat {
    background: var(--bg-tertiary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
}

.debrief-themes {
    margin-bottom: 24px;
}

.debrief-themes h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.debrief-themes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.debrief-themes li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
}

.debrief-themes li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
}

.debrief-threats {
    margin-bottom: 20px;
}

.debrief-severity {
    margin-bottom: 20px;
}

.debrief-severity h4 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.debrief-severity.critical h4 { color: var(--severity-critical); }
.debrief-severity.high h4 { color: var(--severity-high); }
.debrief-severity.medium h4 { color: var(--severity-medium); }
.debrief-severity.low h4 { color: var(--severity-low); }

.debrief-severity ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.debrief-severity li {
    padding: 6px 0;
    font-size: 14px;
}

.debrief-severity a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.debrief-severity a:hover {
    text-decoration: underline;
}

.debrief-footer {
    text-align: right;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== WILD C2 CHANNELS PAGE ===== */

.c2-loading, .c2-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.c2-error {
    color: var(--severity-critical);
}

.c2-page-content {
    padding: 20px;
    display: grid;
    gap: 24px;
}

.c2-info-panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.c2-info-panel h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.c2-info-panel p {
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.c2-info-panel a {
    color: var(--accent-blue);
    text-decoration: none;
}

.c2-info-panel a:hover {
    text-decoration: underline;
}

.c2-api-endpoints {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.c2-api-endpoints h4 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.c2-api-endpoints ul {
    margin: 0;
    padding-left: 20px;
}

.c2-api-endpoints li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 4px 0;
}

.c2-api-endpoints code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

.c2-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface-color);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

.c2-empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
}

.c2-empty-state h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.c2-empty-state p {
    color: var(--text-secondary);
    margin: 0;
}

.c2-last-updated {
    margin-top: 12px !important;
    font-size: 0.85rem;
}

.c2-header-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}

.c2-total {
    background: var(--accent-blue);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.c2-updated {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.c2-correlations-list {
    display: grid;
    gap: 16px;
}

.c2-correlation-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.c2-correlation-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.c2-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.c2-correlation-id {
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent-blue);
}

.c2-correlation-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.c2-threat-link {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s;
}

.c2-threat-link:hover {
    color: var(--accent-blue);
}

.c2-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.c2-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.c2-iocs-container {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.c2-ioc-match {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
}

.c2-ioc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.c2-ioc-type {
    background: var(--severity-critical);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.c2-ioc-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.c2-beacon-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.c2-beacon-version {
    color: var(--accent-purple);
    font-weight: 500;
}

.c2-beacon-port, .c2-beacon-watermark {
    font-family: monospace;
}

/* Responsive adjustments for C2 page */
@media (max-width: 768px) {
    .c2-header-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .c2-stats {
        flex-wrap: wrap;
    }
    
    .c2-beacon-info {
        flex-direction: column;
        gap: 6px;
    }
}

/* ===== WILD C2 EXPLORER STYLES ===== */
.wild-c2-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.wild-c2-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.wild-c2-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
    justify-content: space-between;
}

.search-box {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.search-box input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.btn-search {
    padding: 10px 20px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-search:hover {
    background: #2563eb;
}

.view-tabs {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
}

.tab-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.header-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-badge {
    background: var(--bg-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-badge.correlation {
    background: var(--severity-critical);
    color: white;
}

/* Beacon Grid */
.beacon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.beacon-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.beacon-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.beacon-card.correlated {
    border-color: var(--severity-critical);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(239, 68, 68, 0.05));
}

.beacon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.beacon-ip {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.beacon-country {
    font-size: 1.5rem;
}

.beacon-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.beacon-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.beacon-row .label {
    color: var(--text-secondary);
}

.beacon-row .value {
    color: var(--text-primary);
    font-family: monospace;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.correlation-badge {
    margin-top: 12px;
    padding: 6px 12px;
    background: var(--severity-critical);
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}

.btn-details {
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-details:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Config Table */
.config-table-wrapper {
    overflow-x: auto;
}

.config-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.config-table th,
.config-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.config-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 500;
    position: sticky;
    top: 0;
}

.config-table tbody tr:hover {
    background: var(--bg-secondary);
}

.config-table code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.arch-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.arch-badge.x64 {
    background: var(--accent-blue);
    color: white;
}

.arch-badge.x86 {
    background: var(--accent-purple);
    color: white;
}

.btn-mini {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-mini:hover {
    background: var(--accent-blue);
    color: white;
}

/* Correlations View */
.correlations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.correlation-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--severity-critical);
    border-radius: 8px;
    padding: 20px;
}

.correlation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.correlation-id {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.threat-link a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.threat-link a:hover {
    text-decoration: underline;
}

.correlation-title {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.correlation-matches {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ioc-match {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.ioc-type {
    background: var(--severity-high);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ioc-value {
    font-family: monospace;
    color: var(--text-primary);
}

.beacon-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.correlation-time {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.no-correlations {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-correlations h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.no-correlations .hint {
    margin-top: 16px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.page-btn {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Config Modal */
.config-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.config-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.config-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.config-modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.config-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.config-section {
    margin-bottom: 24px;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-section h3 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.config-item {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
}

.config-item.full-width {
    grid-column: span 2;
}

.config-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.config-value {
    color: var(--text-primary);
    font-size: 0.95rem;
    word-break: break-all;
}

.config-value code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.detection-tips {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-blue);
}

.detection-tips p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.detection-tips p:last-child {
    margin-bottom: 0;
}

.detection-tips code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.config-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.btn-copy-config {
    padding: 10px 20px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-copy-config:hover {
    background: #2563eb;
}

.wild-c2-error {
    text-align: center;
    padding: 60px 20px;
}

.wild-c2-error h3 {
    color: var(--severity-high);
    margin-bottom: 12px;
}

.wild-c2-error button {
    margin-top: 16px;
    padding: 10px 24px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Responsive Wild C2 */
@media (max-width: 768px) {
    .wild-c2-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: none;
    }
    
    .view-tabs {
        justify-content: center;
    }
    
    .beacon-grid {
        grid-template-columns: 1fr;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .config-item.full-width {
        grid-column: span 1;
    }
    
    .config-modal {
        max-height: 95vh;
    }
}

/* ===== WILD C2 COMPACT UI REDESIGN ===== */

/* Compact header with stats as badges */
.c2-header-compact {
    padding: 16px 24px !important;
    flex-wrap: wrap;
    gap: 8px;
}

.c2-header-compact .page-title {
    font-size: 20px;
    margin-bottom: 4px;
}

.c2-compact-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.c2-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.c2-stat-badge.beacon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.3);
}

.c2-stat-badge.config {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.3);
}

.c2-stat-badge.corr {
    background: rgba(239, 68, 68, 0.15);
    color: var(--severity-critical);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Compact controls */
.wild-c2-container {
    padding: 16px;
}

.wild-c2-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}

.c2-search-live {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
    position: relative;
}

.c2-search-live input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.c2-search-live .search-hint {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-row.compact {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.c2-filter-mini {
    padding: 6px 10px;
    font-size: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: auto;
}

.btn-refresh-mini {
    padding: 6px 10px;
    font-size: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

.btn-refresh-mini:hover {
    background: var(--accent-blue);
}

.view-tabs.compact {
    display: flex;
    gap: 4px;
}

.tab-btn-mini {
    padding: 6px 12px;
    font-size: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
}

.tab-btn-mini.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Compact beacon cards */
.beacon-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.beacon-card-compact {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.15s ease;
}

.beacon-card-compact:hover {
    border-color: var(--accent-blue);
    transform: translateY(-1px);
}

.beacon-card-compact.correlated {
    border-color: var(--severity-critical);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(239, 68, 68, 0.05));
}

.beacon-header-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.beacon-header-compact .beacon-ip {
    font-family: monospace;
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

.beacon-header-compact .beacon-country {
    font-size: 16px;
}

.corr-dot {
    font-size: 12px;
}

.beacon-meta-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.beacon-meta-item {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

.beacon-time-row {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.btn-details-compact {
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-details-compact:hover:not(.loading) {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.btn-details-compact.loading {
    opacity: 0.7;
    cursor: wait;
}

/* Search highlighting */
.c2-highlight {
    background: var(--highlight-bg);
    color: var(--highlight-text);
    padding: 0 2px;
    border-radius: 2px;
}

.c2-filter-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .c2-header-compact {
        padding: 12px 16px !important;
    }
    
    .c2-header-compact .page-title {
        font-size: 18px;
    }
    
    .c2-compact-stats {
        gap: 4px;
    }
    
    .c2-stat-badge {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    .wild-c2-container {
        padding: 12px;
    }
    
    .wild-c2-controls {
        gap: 8px;
    }
    
    .c2-search-live {
        max-width: none;
        width: 100%;
    }
    
    .filter-row.compact {
        width: 100%;
        justify-content: space-between;
    }
    
    .c2-filter-mini {
        flex: 1;
        min-width: 60px;
        padding: 5px 6px;
        font-size: 11px;
    }
    
    .view-tabs.compact {
        width: 100%;
        justify-content: center;
    }
    
    .tab-btn-mini {
        flex: 1;
        text-align: center;
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .beacon-grid-compact {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .beacon-card-compact {
        padding: 10px;
    }
    
    .beacon-header-compact .beacon-ip {
        font-size: 12px;
    }
    
    .beacon-meta-item {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .c2-stat-badge {
        padding: 2px 5px;
        font-size: 9px;
    }
    
    .c2-filter-mini {
        font-size: 10px;
        padding: 4px 5px;
    }
    
    .tab-btn-mini {
        font-size: 10px;
        padding: 5px 6px;
    }
}

/* Wild C2 Explorer Enhanced Styles (keeping for backwards compat) */
.c2-stats-dashboard {
    display: none; /* Hide old stats dashboard, using compact badges now */
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.c2-filter {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 160px;
}

.c2-filter:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.btn-refresh {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.beacon-count {
    background: var(--accent-blue) !important;
    color: white !important;
}

.config-count {
    background: var(--accent-purple) !important;
    color: white !important;
}

/* Enhanced beacon cards */
.beacon-card {
    cursor: pointer;
}

.beacon-card:hover .beacon-ip {
    color: var(--accent-blue);
}

/* Responsive stats */
@media (max-width: 900px) {
    .c2-stats-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .c2-stats-dashboard {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .c2-filter {
        width: 100%;
    }
}

/* Wild C2 Explorer - Responsive Fixes v3.6.1 */
.c2-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.c2-filter-mini {
    min-width: 80px;
    max-width: 120px;
    flex: 1 1 auto;
    padding: 6px 8px;
    font-size: 0.75rem;
}

.tab-btn-mini {
    padding: 6px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-refresh-mini {
    padding: 6px 10px;
    flex-shrink: 0;
}

/* Compact stats - single row that wraps */
.c2-compact-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.c2-stat-badge {
    padding: 4px 8px;
    font-size: 0.7rem;
    border-radius: 4px;
    background: var(--bg-tertiary);
    white-space: nowrap;
}

/* Mobile-specific Wild C2 */
@media (max-width: 600px) {
    .c2-header-compact h2 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .c2-compact-stats {
        gap: 4px;
    }
    
    .c2-stat-badge {
        padding: 3px 6px;
        font-size: 0.65rem;
    }
    
    .c2-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .c2-filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }
    
    .c2-filter-mini {
        flex: 1 1 calc(50% - 3px);
        min-width: 0;
        max-width: none;
    }
    
    .c2-tabs-row {
        display: flex;
        gap: 4px;
        width: 100%;
        overflow-x: auto;
    }
    
    .tab-btn-mini {
        flex: 1;
        padding: 8px 6px;
    }
    
    .beacon-grid-compact {
        grid-template-columns: 1fr;
    }
}

/* Loading state for buttons */
.btn-details-compact.loading,
.btn-details.loading {
    opacity: 0.7;
    cursor: wait;
}

.btn-loading {
    display: none;
}

.loading .btn-loading {
    display: inline;
}

.loading .btn-text {
    display: none;
}

/* ===== ADHOC RESEARCH STYLES ===== */

.nav-badge.new {
    background: #10b981;
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: 600;
}

.adhoc-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.adhoc-intro {
    text-align: center;
    margin-bottom: 32px;
}

.adhoc-intro h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.adhoc-intro p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.adhoc-input-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.adhoc-input-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.adhoc-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
}

.adhoc-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.adhoc-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

.adhoc-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Login */
.adhoc-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 24px;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.login-card h2 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 16px;
    text-align: center;
}

.login-error {
    color: #ef4444;
    margin-top: 12px;
    font-size: 0.9rem;
}

/* Progress */
.adhoc-progress {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.progress-icon {
    font-size: 1.5rem;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.progress-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.progress-steps {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.progress-step {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.progress-step.active {
    background: var(--accent-blue);
    color: white;
}

.progress-step.complete {
    opacity: 0.7;
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    width: 0%;
    transition: width 0.5s ease;
}

/* Results */
.adhoc-results {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header h3 {
    font-size: 1.2rem;
}

.results-actions {
    display: flex;
    gap: 8px;
}

.threat-preview-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.preview-id {
    font-family: monospace;
    color: var(--text-muted);
}

.confidence-badge {
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.preview-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.preview-summary {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.preview-section {
    margin-bottom: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.preview-section h4 {
    margin-bottom: 12px;
    font-size: 1rem;
}

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

.mitre-tag {
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.ioc-list code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.ioc-group {
    margin-bottom: 8px;
}

.detection-list {
    display: grid;
    gap: 12px;
}

.detection-item {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 6px;
}

.detection-item strong {
    display: block;
    margin-bottom: 6px;
}

.det-severity {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.det-severity.high {
    background: #fef3c7;
    color: #92400e;
}

.det-severity.critical {
    background: #fee2e2;
    color: #991b1b;
}

.det-severity.medium {
    background: #fef9c3;
    color: #854d0e;
}

.detection-item details {
    margin-top: 8px;
}

.detection-item summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--accent-blue);
}

.detection-item pre {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.8rem;
}

.json-preview {
    max-height: 400px;
    overflow: auto;
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Mobile */
@media (max-width: 600px) {
    .adhoc-container {
        padding: 16px;
    }
    
    .adhoc-input-section,
    .login-card,
    .adhoc-progress,
    .adhoc-results {
        padding: 16px;
    }
    
    .adhoc-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-actions {
        justify-content: stretch;
    }
    
    .results-actions button {
        flex: 1;
    }
}
/* Build trigger 20260203205102 */

/* Enrichment styles */
.enrichment-list {
    display: grid;
    gap: 12px;
}

.enrichment-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
}

.enrichment-item strong {
    display: block;
    margin-bottom: 8px;
}

.enrichment-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9rem;
}

.enrichment-details span {
    background: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 4px;
}

.threatfox-match {
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
}

.threatfox-match:last-child {
    border-bottom: none;
}

/* ===== ADHOC RESEARCH LAB - REDESIGNED ===== */
.adhoc-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .adhoc-layout {
        grid-template-columns: 1fr;
    }
}

.adhoc-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.panel-content {
    padding: 20px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.adhoc-textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 180px;
}

.adhoc-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-full {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon {
    font-size: 1.2rem;
}

.research-hint {
    margin-top: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Progress */
.research-progress {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-weight: 500;
}

.progress-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.progress-steps .step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-steps .step.active {
    color: var(--accent-color);
}

.progress-steps .step.done .step-icon {
    color: #10b981;
}

.progress-bar {
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #8b5cf6);
    width: 0%;
    transition: width 0.3s ease;
}

/* Panel Tabs */
.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.panel-tab {
    flex: 1;
    padding: 14px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.panel-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.panel-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-count {
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-left: 6px;
}

.panel-tab-content {
    padding: 20px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 8px;
    color: var(--text-primary);
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* Result Card */
.result-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    flex-wrap: wrap;
}

.result-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.result-title-section h3 {
    margin: 0;
    font-size: 1.1rem;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-only {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
}

.btn-icon-only:hover {
    background: var(--bg-primary);
}

.result-body {
    padding: 20px;
}

.result-section {
    margin-bottom: 24px;
}

.result-section:last-child {
    margin-bottom: 0;
}

.result-section h4 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

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

.mitre-tag {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.85rem;
}

.mitre-tag .tactic {
    color: var(--accent-color);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.iocs-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ioc-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ioc-label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 80px;
}

.ioc-value {
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

.detections-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detection-item {
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
}

.detection-item summary {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detection-item summary:hover {
    background: var(--bg-primary);
}

.det-name {
    font-weight: 500;
}

.det-type {
    font-size: 0.8rem;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-secondary);
}

.det-query {
    margin: 0;
    padding: 16px;
    background: var(--bg-primary);
    overflow-x: auto;
    font-size: 0.85rem;
}

.json-section summary {
    cursor: pointer;
    padding: 8px 0;
}

.json-preview {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.8rem;
    max-height: 400px;
}

.no-data {
    color: var(--text-secondary);
    font-style: italic;
}

/* Lab Threats */
.lab-threats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lab-threat-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.lab-threat-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.threat-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.threat-category {
    background: #8b5cf6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.threat-title {
    margin: 0 0 8px;
    font-size: 1rem;
}

.threat-summary {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.threat-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Research count badge */
.research-count {
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Attribution info */
.attribution-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.actor-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent-color);
}

.nation-state, .motivation {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ===== ENHANCED RESEARCH RESULTS ===== */
.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.meta-item {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.meta-item strong {
    color: var(--text-primary);
}

.description-text {
    line-height: 1.7;
    white-space: pre-wrap;
}

.analysis-summary {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
}

/* Attribution Card */
.attribution-card {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 8px;
}

.actor-main {
    margin-bottom: 12px;
}

.actor-aliases {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.actor-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--bg-secondary);
}

.detail-badge.nation { background: #1e3a5f; }
.detail-badge.motivation { background: #3d1e5f; }

/* Targets */
.targets-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.target-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.target-label {
    min-width: 80px;
    font-weight: 500;
    color: var(--text-secondary);
}

.target-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.target-tag {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.85rem;
}

/* MITRE Grid */
.mitre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
}

.mitre-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
}

.mitre-tactic {
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 500;
}

.mitre-technique {
    font-size: 0.9rem;
    margin: 4px 0;
}

.mitre-id {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* IOCs Container */
.iocs-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ioc-category h5 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.ioc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ioc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.ioc-type {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.ioc-value {
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.ioc-hash {
    font-size: 0.75rem;
}

.ioc-context {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.behavioral-list {
    margin: 0;
    padding-left: 20px;
}

.behavioral-list li {
    margin-bottom: 6px;
}

/* Detections Section - THE STAR */
.detections-section {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.detection-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.det-stat {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.det-stat.splunk { background: #1a472a; color: #4ade80; }
.det-stat.kql { background: #1e3a5f; color: #60a5fa; }

.detection-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    border-left: 4px solid #10b981;
}

.detection-card.kql {
    border-left-color: #3b82f6;
}

.detection-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-primary);
}

.det-number {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.det-name {
    flex: 1;
    font-weight: 500;
}

.det-type-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.det-type-badge.spl { background: #166534; color: #4ade80; }
.det-type-badge.kql { background: #1d4ed8; color: #93c5fd; }

.det-description {
    padding: 8px 16px;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.det-query-container {
    position: relative;
    margin: 0 16px 12px;
}

.copy-query-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 0.8rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    z-index: 1;
}

.copy-query-btn:hover {
    background: var(--accent-color);
}

.det-query {
    margin: 0;
    padding: 12px;
    background: #0d1117;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.det-query code {
    color: #c9d1d9;
    white-space: pre-wrap;
    word-break: break-word;
}

.det-meta {
    display: flex;
    gap: 12px;
    padding: 8px 16px;
}

.det-severity {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: capitalize;
}

.det-severity.critical { background: #7f1d1d; color: #fca5a5; }
.det-severity.high { background: #7c2d12; color: #fdba74; }
.det-severity.medium { background: #713f12; color: #fcd34d; }
.det-severity.low { background: #14532d; color: #86efac; }

.det-confidence {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Remediation */
.remediation-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.remediation-group h5 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.remediation-group ul {
    margin: 0;
    padding-left: 20px;
}

.remediation-group li {
    margin-bottom: 6px;
    line-height: 1.5;
}

/* References */
.references-list {
    margin: 0;
    padding-left: 20px;
}

.references-list a {
    color: var(--accent-color);
    text-decoration: none;
}

.references-list a:hover {
    text-decoration: underline;
}

.references-list li {
    margin-bottom: 6px;
}

/* ===== RESEARCH RESULT COMPACT CARD ===== */
.research-result-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.result-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-id {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-card-actions {
    display: flex;
    gap: 8px;
}

.result-card-name {
    margin: 0;
    padding: 16px 20px 8px;
    font-size: 1.3rem;
}

.result-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 20px 16px;
    font-size: 0.9rem;
}

.stat-item {
    color: var(--text-secondary);
}

.stat-item strong {
    color: var(--text-primary);
}

.result-card-summary {
    padding: 0 20px 16px;
    line-height: 1.6;
}

.result-card-summary p {
    margin: 0;
    color: var(--text-secondary);
}

.result-card-attribution {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 20px 16px;
}

.attr-actor {
    font-weight: 600;
    color: var(--accent-color);
}

.attr-nation, .attr-motivation {
    padding: 3px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.85rem;
}

.result-card-mitre {
    padding: 0 20px 16px;
    font-size: 0.9rem;
}

.mitre-chip {
    display: inline-block;
    padding: 3px 8px;
    margin: 2px 4px 2px 0;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
}

.mitre-more {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.result-card-detections-preview {
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.detection-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.det-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.det-badge.spl { background: #166534; color: #4ade80; }
.det-badge.kql { background: #1d4ed8; color: #93c5fd; }

.det-preview-name {
    color: var(--text-primary);
}

.det-more {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.result-card-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Detection item type badge */
.detection-item-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.detection-item-type.spl { background: #166534; color: #4ade80; }
.detection-item-type.kql { background: #1d4ed8; color: #93c5fd; }

/* ===== DETECTION LIBRARY PAGE ===== */

/* Main Container */
.detection-library-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Header Stats */
.detection-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.detection-stats .stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detection-stats .stat-badge strong {
    color: var(--text-primary);
    font-weight: 600;
}

.detection-stats .stat-badge.total {
    background: var(--bg-tertiary);
    border-color: var(--accent-blue);
}

.detection-stats .stat-badge.total strong {
    color: var(--accent-blue);
}

.detection-stats .stat-badge.spl {
    background: rgba(22, 101, 52, 0.2);
    border-color: rgba(74, 222, 128, 0.3);
}

.detection-stats .stat-badge.spl strong {
    color: #4ade80;
}

.detection-stats .stat-badge.kql {
    background: rgba(29, 78, 216, 0.2);
    border-color: rgba(147, 197, 253, 0.3);
}

.detection-stats .stat-badge.kql strong {
    color: #93c5fd;
}

/* Filters Section */
.detection-filters {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
}

.detection-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s ease;
}

.detection-filters-header:hover {
    background: var(--bg-hover);
}

.detection-filters-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detection-filters-header .toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.detection-filters-header.open .toggle-icon {
    transform: rotate(180deg);
}

.detection-filters-body {
    display: none;
    padding: 20px;
}

.detection-filters-body.open {
    display: block;
}

.detection-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

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

.detection-filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detection-filter-select {
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease;
}

.detection-filter-select:focus {
    border-color: var(--accent-blue);
}

.detection-filter-select:hover {
    border-color: var(--border-light);
}

/* Multi-select dropdown styling */
.detection-filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

/* Search within filters */
.detection-search-input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.detection-search-input:focus {
    border-color: var(--accent-blue);
}

.detection-search-wrapper {
    position: relative;
}

.detection-search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Filter Actions */
.detection-filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.filter-results-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.filter-results-count strong {
    color: var(--text-primary);
}

.btn-clear-filters {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-clear-filters:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Active Filter Chips */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.filter-chip .chip-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.filter-chip .chip-value {
    font-weight: 500;
}

.filter-chip .chip-remove {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-chip .chip-remove:hover {
    background: var(--severity-critical);
    color: white;
}

/* Detection Grid */
.detection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

/* Detection Card */
.detection-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
}

.detection-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.detection-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 18px 12px;
    gap: 12px;
}

.detection-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Type Badge - SPL/KQL */
.detection-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detection-type-badge.spl {
    background: rgba(22, 101, 52, 0.25);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.detection-type-badge.kql {
    background: rgba(88, 28, 135, 0.25);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.3);
}

/* Severity Badge - Reusing existing severity colors */
.detection-severity-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detection-severity-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--severity-critical);
}

.detection-severity-badge.high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--severity-high);
}

.detection-severity-badge.medium {
    background: rgba(234, 179, 8, 0.15);
    color: var(--severity-medium);
}

.detection-severity-badge.low {
    background: rgba(34, 197, 94, 0.15);
    color: var(--severity-low);
}

.detection-card-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'SF Mono', monospace;
}

.detection-card-title {
    padding: 0 18px 12px;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.detection-card-description {
    padding: 0 18px 14px;
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* MITRE Chips in Card */
.detection-card-mitre {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 18px 14px;
}

.mitre-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--accent-blue);
    font-family: 'SF Mono', monospace;
}

.mitre-chip .tactic {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.mitre-chip-more {
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Expandable Query Section */
.detection-card-query-section {
    border-top: 1px solid var(--border-color);
}

.detection-query-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.detection-query-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.detection-query-toggle .toggle-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detection-query-toggle .toggle-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.detection-query-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

/* Detection Query Code Block */
.detection-query {
    display: none;
    position: relative;
    margin: 0;
    padding: 0;
}

.detection-query.open {
    display: block;
}

.detection-query-code {
    margin: 0;
    padding: 16px 18px;
    padding-right: 70px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--accent-green);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* SPL vs KQL vs Sigma different background tints */
.detection-query.spl .detection-query-code,
.detection-query.spl {
    background: linear-gradient(135deg, #0d1f0d 0%, #0d0d0d 100%);
    border-left: 3px solid #4ade80;
}

.detection-query.kql .detection-query-code,
.detection-query.kql {
    background: linear-gradient(135deg, #1a0d2e 0%, #0d0d0d 100%);
    border-left: 3px solid #c084fc;
    color: #e0b0ff;
}

.detection-query.sigma .detection-query-code,
.detection-query.sigma {
    background: linear-gradient(135deg, #0d1a2e 0%, #0d0d0d 100%);
    border-left: 3px solid #60a5fa;
    color: #93c5fd;
}

/* Copy Button in Query Block */
.detection-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 1;
}

.detection-copy-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.detection-copy-btn.copied {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

/* Card Footer */
.detection-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: var(--bg-tertiary);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.detection-card-source {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detection-card-date {
    font-family: 'SF Mono', monospace;
}

/* Loading State */
.detection-library-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.detection-library-loading .loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

/* Empty State */
.detection-library-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.detection-library-empty .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.detection-library-empty h3 {
    margin: 0 0 8px;
    color: var(--text-primary);
}

.detection-library-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* Pagination */
.detection-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.detection-pagination .page-btn {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.detection-pagination .page-btn:hover:not(:disabled) {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.detection-pagination .page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.detection-pagination .page-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* View Toggle (Grid/List) */
.detection-view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
}

.detection-view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.detection-view-btn:hover {
    color: var(--text-primary);
}

.detection-view-btn.active {
    background: var(--accent-blue);
    color: white;
}

/* List View Alternative */
.detection-grid.list-view {
    grid-template-columns: 1fr;
}

.detection-grid.list-view .detection-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 16px 20px;
    gap: 20px;
}

.detection-grid.list-view .detection-card-header,
.detection-grid.list-view .detection-card-title,
.detection-grid.list-view .detection-card-description,
.detection-grid.list-view .detection-card-mitre,
.detection-grid.list-view .detection-card-query-section,
.detection-grid.list-view .detection-card-footer {
    padding: 0;
    border: none;
    background: none;
}

/* ===== DETECTION LIBRARY RESPONSIVE ===== */

@media (max-width: 1200px) {
    .detection-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }
    
    .detection-filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .detection-library-container {
        padding: 16px;
    }
    
    .detection-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detection-grid {
        grid-template-columns: 1fr;
    }
    
    .detection-stats {
        gap: 8px;
    }
    
    .detection-stats .stat-badge {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .detection-filter-grid {
        grid-template-columns: 1fr;
    }
    
    .detection-filters-header {
        padding: 12px 16px;
    }
    
    .detection-filters-body {
        padding: 16px;
    }
    
    .detection-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 16px 10px;
    }
    
    .detection-card-title {
        padding: 0 16px 10px;
        font-size: 0.95rem;
    }
    
    .detection-card-description {
        padding: 0 16px 12px;
        font-size: 0.8rem;
    }
    
    .detection-card-mitre {
        padding: 0 16px 12px;
    }
    
    .detection-query-toggle {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .detection-query-code {
        padding: 14px 16px;
        padding-right: 60px;
        font-size: 0.75rem;
    }
    
    .detection-card-footer {
        padding: 8px 16px;
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .filter-chip {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .detection-filter-actions {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .filter-results-count {
        text-align: center;
    }
    
    .btn-clear-filters {
        width: 100%;
    }
    
    .detection-pagination {
        flex-direction: column;
        gap: 12px;
    }
    
    .detection-pagination .page-btn {
        width: 100%;
    }
}

/* Mobile filter collapse */
@media (max-width: 768px) {
    .detection-filters-body {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* ===== DETECTION LIBRARY PAGE ===== */
.det-lib-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.det-lib-stats {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.det-stat {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.det-stat.total {
    background: var(--surface-elevated, #2a2a2a);
    color: var(--text-primary, #fff);
}

.det-stat.spl {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.det-stat.kql {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.det-stat.sigma {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.keyboard-hint {
    color: var(--text-muted, #888);
    font-size: 0.8rem;
    padding: 4px 8px;
    background: var(--surface-elevated, #2a2a2a);
    border-radius: 6px;
}

.det-lib-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-top: 20px;
}

/* Filter Panel */
.det-lib-filters {
    background: var(--surface, #1e1e1e);
    border: 1px solid var(--border, #333);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #aaa);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-elevated, #2a2a2a);
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-blue, #3b82f6);
}

.filter-input::placeholder {
    color: var(--text-muted, #666);
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-elevated, #2a2a2a);
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-select[multiple] {
    padding: 8px;
}

.filter-select option {
    padding: 6px 8px;
}

.filter-toggles {
    display: flex;
    gap: 8px;
}

.filter-toggle {
    flex: 1;
    padding: 8px 12px;
    background: var(--surface-elevated, #2a2a2a);
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    color: var(--text-secondary, #aaa);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-toggle:hover {
    border-color: var(--accent-blue, #3b82f6);
    color: var(--text-primary, #fff);
}

.filter-toggle.active {
    background: var(--accent-blue, #3b82f6);
    border-color: var(--accent-blue, #3b82f6);
    color: #fff;
}

.btn-clear-filters {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    color: var(--text-secondary, #aaa);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-clear-filters:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Results Panel */
.det-lib-results {
    min-height: 400px;
}

.det-lib-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-count {
    color: var(--text-secondary, #aaa);
    font-size: 0.9rem;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-controls label {
    color: var(--text-secondary, #aaa);
    font-size: 0.85rem;
}

.sort-select {
    padding: 6px 10px;
    background: var(--surface-elevated, #2a2a2a);
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    color: var(--text-primary, #fff);
    font-size: 0.85rem;
}

.sort-order-btn {
    padding: 6px 10px;
    background: var(--surface-elevated, #2a2a2a);
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-order-btn:hover {
    background: var(--accent-blue, #3b82f6);
    border-color: var(--accent-blue, #3b82f6);
}

/* Detection Cards Grid */
.det-lib-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

.det-card {
    background: var(--surface, #1e1e1e);
    border: 1px solid var(--border, #333);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.det-card:hover {
    border-color: var(--border-hover, #444);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.det-card-header {
    padding: 16px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.det-card-badges {
    display: flex;
    gap: 8px;
}

.det-type-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.det-type-badge.spl {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.det-type-badge.kql {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.det-type-badge.sigma {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.det-severity-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.det-severity-badge.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.det-severity-badge.high {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

.det-severity-badge.medium {
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
}

.det-severity-badge.low {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.det-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0;
    line-height: 1.4;
}

.det-card-threat {
    padding: 0 16px 12px;
}

.det-threat-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary, #aaa);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.det-threat-link:hover {
    color: var(--accent-blue, #3b82f6);
}

.det-threat-link .threat-id {
    color: var(--accent-blue, #3b82f6);
    font-family: monospace;
    font-size: 0.8rem;
}

.det-card-mitre {
    padding: 0 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mitre-chip {
    padding: 3px 8px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    color: #a78bfa;
    font-size: 0.75rem;
    font-family: monospace;
}

.mitre-more {
    padding: 3px 8px;
    color: var(--text-muted, #666);
    font-size: 0.75rem;
}

.det-card-sources {
    padding: 0 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.source-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: monospace;
}

.source-tag.index {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.source-tag.sourcetype {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

.source-tag.table {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}

/* Query Section */
.det-card-query-section {
    display: none;
    border-top: 1px solid var(--border, #333);
}

.det-card-query-section.show {
    display: block;
}

.det-query-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--surface-elevated, #252525);
}

.query-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.det-copy-btn {
    padding: 4px 10px;
    background: var(--surface, #1e1e1e);
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    color: var(--text-secondary, #aaa);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.det-copy-btn:hover {
    background: var(--accent-blue, #3b82f6);
    border-color: var(--accent-blue, #3b82f6);
    color: #fff;
}

.det-copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #4ade80;
}

.det-query-code {
    margin: 0;
    padding: 12px 16px;
    background: var(--surface-elevated, #1a1a1a);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-primary, #e0e0e0);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* Detection query type-specific styling */
.det-query-code.spl {
    background: linear-gradient(135deg, #0d1f0d 0%, #1a1a1a 100%);
    border-left: 3px solid #4ade80;
    color: #4ade80;
}

.det-query-code.kql {
    background: linear-gradient(135deg, #1a0d2e 0%, #1a1a1a 100%);
    border-left: 3px solid #a78bfa;
    color: #e0b0ff;
}

.det-query-code.sigma {
    background: linear-gradient(135deg, #0d1a2e 0%, #1a1a1a 100%);
    border-left: 3px solid #60a5fa;
    color: #93c5fd;
}

/* Syntax highlighting */
.spl-keyword {
    color: #f97316;
    font-weight: 600;
}

.spl-pipe {
    color: #22c55e;
    font-weight: 700;
}

.spl-string {
    color: #fbbf24;
}

.kql-keyword {
    color: #60a5fa;
    font-weight: 600;
}

.kql-table {
    color: #a78bfa;
    font-weight: 600;
}

.kql-string {
    color: #fbbf24;
}

/* Sigma (YAML) syntax highlighting */
.sigma-keyword {
    color: #60a5fa;
    font-weight: 600;
}

.sigma-key {
    color: #93c5fd;
    font-weight: 500;
}

.sigma-status {
    color: #22c55e;
    font-style: italic;
}

.sigma-level {
    color: #fbbf24;
    font-weight: 600;
}

.sigma-string {
    color: #a78bfa;
}

/* Card Footer */
.det-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--border, #333);
    background: var(--surface-elevated, #252525);
}

.det-expand-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    color: var(--text-secondary, #aaa);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.det-expand-btn:hover {
    border-color: var(--accent-blue, #3b82f6);
    color: var(--accent-blue, #3b82f6);
}

.det-view-threat-btn {
    color: var(--accent-blue, #3b82f6);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.det-view-threat-btn:hover {
    opacity: 0.8;
}

/* Empty State */
.det-lib-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--surface, #1e1e1e);
    border: 1px solid var(--border, #333);
    border-radius: 12px;
}

.det-lib-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.det-lib-empty h3 {
    color: var(--text-primary, #fff);
    margin: 0 0 8px 0;
}

.det-lib-empty p {
    color: var(--text-muted, #888);
    margin: 0;
}

/* Pagination */
.det-lib-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border, #333);
}

.det-lib-pagination .page-btn {
    padding: 8px 16px;
    background: var(--surface, #1e1e1e);
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.det-lib-pagination .page-btn:hover:not(:disabled) {
    background: var(--accent-blue, #3b82f6);
    border-color: var(--accent-blue, #3b82f6);
}

.det-lib-pagination .page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.det-lib-pagination .page-info {
    color: var(--text-secondary, #aaa);
    font-size: 0.9rem;
}

/* Loading state */
.detection-library-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted, #888);
}

.detection-library-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border, #333);
    border-top-color: var(--accent-blue, #3b82f6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .det-lib-layout {
        grid-template-columns: 1fr;
    }
    
    .det-lib-filters {
        position: static;
        max-height: none;
    }
    
    .det-lib-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .det-lib-stats {
        flex-wrap: wrap;
    }
    
    .filter-toggles {
        flex-direction: column;
    }
    
    .det-lib-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-controls {
        justify-content: space-between;
    }
    
    .det-card-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .det-expand-btn, .det-view-threat-btn {
        width: 100%;
        text-align: center;
    }
}
