/**
 * Common styles for SecurityStudies.info
 * Centralized styling to maintain visual consistency
 */

/* ============================================================================
   CSS VARIABLES (Design Tokens)
   ============================================================================ */
:root {
    /* Colors */
    --color-primary: #1a2332;
    --color-secondary: #2c5aa0;
    --color-accent: #4a90d9;
    --color-success: #38a169;
    --color-warning: #d69e2e;
    --color-error: #e53e3e;
    
    /* Text */
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    
    /* Backgrounds */
    --bg-body: #f4f5f7;
    --bg-card: #ffffff;
    --bg-hover: #f7fafc;
    --bg-accent: #ebf5ff;
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-color-dark: #cbd5e0;
    --border-radius: 6px;
    --border-radius-sm: 4px;
    --border-radius-lg: 8px;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Merriweather', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.12);
}

/* ============================================================================
   COMMON CARD STYLES
   ============================================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
}

.card-body {
    line-height: 1.6;
    color: var(--text-primary);
}

/* ============================================================================
   COMMON BUTTON STYLES
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-color-dark);
}

.btn-accent {
    background: var(--color-secondary);
    color: #ffffff;
    border-color: var(--color-secondary);
}

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* ============================================================================
   DATE RANGE PICKER
   ============================================================================ */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
}

.date-range-presets {
    display: flex;
    gap: var(--spacing-xs);
}

.date-preset-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    background: #ffffff;
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.date-preset-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-color-dark);
    color: var(--text-primary);
}

.date-preset-btn.active {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: #ffffff;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.date-range-inputs label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.date-range-inputs input[type="date"] {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.date-range-inputs input[type="date"]:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.1);
}

/* ============================================================================
   LABELS & BADGES
   ============================================================================ */
.label {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-primary {
    background: var(--bg-accent);
    color: var(--color-secondary);
}

.label-success {
    background: #d4edda;
    color: var(--color-success);
}

.label-warning {
    background: #fef3cd;
    color: var(--color-warning);
}

.label-error {
    background: #f8d7da;
    color: var(--color-error);
}

/* Tag badges (for article categories) */
.tag-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    margin-right: var(--spacing-xs);
}

.tag-military { background: #fecaca; color: #991b1b; }
.tag-diplomacy { background: #bfdbfe; color: #1e40af; }
.tag-cybersecurity { background: #ddd6fe; color: #5b21b6; }
.tag-maritime { background: #a5f3fc; color: #155e75; }
.tag-economic { background: #fde68a; color: #92400e; }
.tag-political { background: #e5e7eb; color: #374151; }
.tag-terrorism { background: #fecaca; color: #991b1b; }
.tag-technology { background: #bbf7d0; color: #166534; }
.tag-intelligence { background: #e5e7eb; color: #1f2937; }
.tag-human_rights { background: #fed7aa; color: #9a3412; }
.tag-environment { background: #bbf7d0; color: #166534; }
.tag-health { background: #fecaca; color: #991b1b; }

/* ============================================================================
   PAGE HEADERS
   ============================================================================ */
.page-header {
    margin-bottom: var(--spacing-xl);
}

.page-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--color-secondary);
    margin-bottom: var(--spacing-xs);
}

.page-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--color-primary);
    margin: 0.3rem 0 0.5rem;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================================================
   SECTION DIVIDERS
   ============================================================================ */
.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: var(--spacing-xl) 0;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-left: var(--spacing-sm);
}

/* ============================================================================
   ALERTS & MESSAGES
   ============================================================================ */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border-left: 3px solid;
    margin-bottom: var(--spacing-md);
    font-size: 0.875rem;
}

.alert-info {
    background: var(--bg-accent);
    border-color: var(--color-secondary);
    color: var(--color-primary);
}

.alert-success {
    background: #d4edda;
    border-color: var(--color-success);
    color: #155724;
}

.alert-warning {
    background: #fef3cd;
    border-color: var(--color-warning);
    color: #856404;
}

.alert-error {
    background: #f8d7da;
    border-color: var(--color-error);
    color: #721c24;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--text-secondary); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

/* ============================================================================
   THREAT LEVEL BADGES  (replaces .dsb-lvl--, .cti-lvl--, .cd-threat--)
   ============================================================================ */
.threat-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border: 1px solid transparent;
}
.threat-badge--critical { background: #fff5f5; color: #c53030; border-color: #feb2b2; }
.threat-badge--high     { background: #fffaf0; color: #c05621; border-color: #fbd38d; }
.threat-badge--elevated { background: #fffff0; color: #b7791f; border-color: #f6e05e; }
.threat-badge--moderate { background: #ebf8ff; color: #2c5aa0; border-color: #bee3f8; }
.threat-badge--medium   { background: #fffff0; color: #b7791f; border-color: #fefcbf; }
.threat-badge--low      { background: #f0fff4; color: #276749; border-color: #c6f6d5; }

/* ============================================================================
   SECTION HEADERS  (replaces .dsb-sh, .cti-sh)
   ============================================================================ */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    margin-top: 0.25rem;
}
.section-header__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8896a6;
    font-weight: 700;
    white-space: nowrap;
}
.section-header__line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}
.section-header__date {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
}

/* ============================================================================
   DASHBOARD CARDS  (replaces .dsb-card, .cti-card, .cd-card)
   ============================================================================ */
.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem 1.25rem;
}
.dash-card__title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8896a6;
    font-weight: 700;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.dash-card__title-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    flex-shrink: 0;
}

/* ============================================================================
   DASHBOARD BANNER  (replaces .dsb-banner, .cti-banner)
   ============================================================================ */
.dash-banner {
    background: linear-gradient(135deg, #1C2B3A 0%, #263d52 100%);
    border-radius: 10px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(28,43,58,0.25);
}
.dash-banner h1 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.dash-banner__sub {
    font-size: 0.78rem;
    color: #8fa3b8;
    margin-top: 0.3rem;
    font-weight: 400;
}
.dash-banner__live {
    display: inline-block;
    background: rgba(56,161,105,0.2);
    color: #68d391;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
    letter-spacing: 0.03em;
}
.dash-banner__kpi {
    text-align: center;
    padding: 0.3rem 0.8rem;
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    min-width: 75px;
}
.dash-banner__kpi-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.dash-banner__kpi-lbl {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8fa3b8;
    font-weight: 600;
}

/* ============================================================================
   ACTION BUTTONS  (replaces .dsb-gen-btn and similar)
   ============================================================================ */
.btn-success {
    background: var(--color-success);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.55rem 1.1rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.15s;
}
.btn-success:hover { background: #2f855a; }
.btn-success:disabled { background: #4a6a5a; cursor: not-allowed; opacity: 0.7; }

/* ============================================================================
   THREAT TABLE  (replaces .dsb-threat-table)
   ============================================================================ */
.threat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.threat-table thead th {
    text-align: left;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8896a6;
    padding: 0 0 0.5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}
.threat-table tbody td {
    padding: 0.55rem 0.4rem;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}
.threat-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================================
   DEVELOPMENT ITEMS  (replaces .dsb-dev-item etc.)
   ============================================================================ */
.dev-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f2f5;
}
.dev-item:last-child { border-bottom: none; }
.dev-item__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.2rem;
    line-height: 1.35;
}
.dev-item__detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ============================================================================
   THEME CARDS  (replaces .dsb-theme)
   ============================================================================ */
.theme-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.theme-card:hover { box-shadow: var(--shadow-md); }
.theme-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
}
.theme-card__name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-primary);
}
.theme-card__body {
    padding: 0 1rem 1rem;
}

/* ============================================================================
   LIST CARD / POST CARD  (replaces .cf-card, .eu-card)
   ============================================================================ */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.4rem 1.6rem;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.15s;
}
.post-card:hover {
    border-color: var(--color-secondary);
    box-shadow: 0 2px 12px rgba(44,90,160,0.1);
    transform: translateY(-2px);
}

/* ============================================================================
   MUTED TEXT
   ============================================================================ */
.dash-muted {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.75rem 0;
}

/* ============================================================================
   CTI-SPECIFIC TYPE BADGES
   ============================================================================ */
.cti-type-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    background: #edf2f7;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cti-type-badge--ransomware  { background: #fed7d7; color: #9b2c2c; }
.cti-type-badge--espionage   { background: #e9d8fd; color: #553c9a; }
.cti-type-badge--ddos        { background: #feebc8; color: #7b341e; }
.cti-type-badge--apt         { background: #bee3f8; color: #2a4365; }

/* ============================================================================
   LEGACY ALIASES — map old per-page prefixed classes to shared definitions.
   Templates can use either the new or old class names.
   ============================================================================ */

/* Banners */
.dsb-banner, .cti-banner {
    background: linear-gradient(135deg, #1C2B3A 0%, #263d52 100%);
    border-radius: 10px; padding: 1.5rem 2rem; margin-bottom: 1.25rem;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
    box-shadow: 0 4px 12px rgba(28,43,58,0.25);
}
.dsb-banner h1, .cti-banner h1 {
    font-family: var(--font-serif); font-size: 1.6rem; font-weight: 900;
    color: #fff; margin: 0; line-height: 1.2; letter-spacing: -0.01em;
}
.dsb-banner-sub, .cti-banner-sub {
    font-size: 0.78rem; color: #8fa3b8; margin-top: 0.3rem; font-weight: 400;
}
.dsb-live, .cti-live {
    display: inline-block; background: rgba(56,161,105,0.2); color: #68d391;
    font-size: 0.68rem; font-weight: 600; padding: 0.15rem 0.5rem;
    border-radius: 10px; margin-left: 0.5rem; letter-spacing: 0.03em;
}
.dsb-kpi, .cti-kpi {
    text-align: center; padding: 0.3rem 0.8rem;
    background: rgba(255,255,255,0.08); border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1); min-width: 75px;
}
.dsb-kpi-val, .cti-kpi-val { font-size: 1.15rem; font-weight: 700; color: #fff; line-height: 1.2; }
.dsb-kpi-lbl, .cti-kpi-lbl { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.06em; color: #8fa3b8; font-weight: 600; }

/* Generate buttons */
.dsb-gen-btn, .cti-gen-btn {
    background: var(--color-success); color: #fff; border: none; border-radius: var(--border-radius);
    padding: 0.55rem 1.1rem; font-size: 0.75rem; font-weight: 600; cursor: pointer;
    letter-spacing: 0.03em; transition: background 0.15s;
}
.dsb-gen-btn:hover, .cti-gen-btn:hover { background: #2f855a; }
.dsb-gen-btn:disabled, .cti-gen-btn:disabled { background: #4a6a5a; cursor: not-allowed; opacity: 0.7; }

/* Section headers */
.dsb-sh, .cti-sh {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 0.75rem; margin-top: 0.25rem;
}
.dsb-sh-label, .cti-sh-label {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: #8896a6; font-weight: 700; white-space: nowrap;
}
.dsb-sh-line, .cti-sh-line { flex: 1; height: 1px; background: var(--border-color); }
.dsb-sh-date, .cti-sh-date { font-size: 0.65rem; color: var(--text-muted); font-weight: 400; white-space: nowrap; }

/* Cards */
.dsb-card, .cti-card, .cd-card {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm); padding: 1.1rem 1.25rem;
}
.dsb-card-title, .cti-card-title {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: #8896a6; font-weight: 700; margin-bottom: 0.65rem;
    display: flex; align-items: center; gap: 0.4rem;
}
.dsb-card-title-icon, .cti-card-title-icon {
    width: 18px; height: 18px; border-radius: 4px; display: inline-flex;
    align-items: center; justify-content: center; font-size: 0.6rem; flex-shrink: 0;
}

/* Threat badges (all page prefixes) */
.dsb-lvl, .cti-lvl, .cd-threat {
    display: inline-block; font-size: 0.62rem; font-weight: 700;
    padding: 0.2rem 0.5rem; border-radius: 3px;
    text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
    border: 1px solid transparent;
}
.dsb-lvl--critical, .cti-lvl--critical, .cd-threat--critical { background: #fff5f5; color: #c53030; border-color: #feb2b2; }
.dsb-lvl--high, .cti-lvl--high, .cd-threat--high             { background: #fffaf0; color: #c05621; border-color: #fbd38d; }
.dsb-lvl--elevated, .cti-lvl--elevated, .cd-threat--elevated { background: #fffff0; color: #b7791f; border-color: #f6e05e; }
.dsb-lvl--moderate, .cti-lvl--moderate, .cd-threat--moderate { background: #ebf8ff; color: #2c5aa0; border-color: #bee3f8; }
.dsb-lvl--medium, .cti-lvl--medium, .cd-threat--medium       { background: #fffff0; color: #b7791f; border-color: #fefcbf; }
.dsb-lvl--low, .cti-lvl--low, .cd-threat--low                { background: #f0fff4; color: #276749; border-color: #c6f6d5; }

/* Post list cards */
.cf-card, .eu-card {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg);
    padding: 1.4rem 1.6rem; text-decoration: none; color: inherit;
    display: block; transition: all 0.15s;
}
.cf-card:hover, .eu-card:hover {
    border-color: var(--color-secondary);
    box-shadow: 0 2px 12px rgba(44,90,160,0.1);
    transform: translateY(-2px);
}

/* Muted placeholders */
.dsb-muted, .cti-muted {
    font-size: 0.82rem; color: var(--text-muted); font-style: italic; padding: 0.75rem 0;
}

/* Threat table */
.dsb-threat-table, .cti-threat-table {
    width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.dsb-threat-table th, .cti-threat-table th {
    text-align: left; font-size: 0.62rem; text-transform: uppercase;
    letter-spacing: 0.08em; color: #8896a6; padding: 0 0 0.5rem; font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}
.dsb-threat-table td, .cti-threat-table td {
    padding: 0.55rem 0.4rem; border-bottom: 1px solid #f0f2f5; vertical-align: middle;
}
.dsb-threat-table tr:last-child td, .cti-threat-table tr:last-child td { border-bottom: none; }

/* CTI type badges */
.cti-type {
    display: inline-block; font-size: 0.58rem; font-weight: 600;
    padding: 0.15rem 0.45rem; border-radius: 3px;
    background: #edf2f7; color: #4a5568; text-transform: uppercase; letter-spacing: 0.03em;
}
.cti-type--ransomware  { background: #fed7d7; color: #9b2c2c; }
.cti-type--espionage   { background: #e9d8fd; color: #553c9a; }
.cti-type--ddos        { background: #feebc8; color: #7b341e; }
.cti-type--apt         { background: #bee3f8; color: #2a4365; }
.cti-type--malware     { background: #fed7d7; color: #9b2c2c; }
.cti-type--phishing    { background: #feebc8; color: #7b341e; }

/* ============================================================================
   RESPONSIVE UTILITIES
   ============================================================================ */
@media (max-width: 768px) {
    .date-range-picker {
        flex-direction: column;
        align-items: stretch;
    }

    .date-range-presets {
        flex-wrap: wrap;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .dash-banner {
        padding: 1.2rem 1.25rem;
    }
    .dash-banner h1 {
        font-size: 1.3rem;
    }
}

/* ============================================================================
   GLOBAL LAYOUT — Navbar, Section Bar, Footer, Content Wrapper
   ============================================================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0; padding: 0;
    background: #F5F4F0;
    color: #1C2B3A;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar ── */
.ss-nav {
    background: #1C2B3A;
    border-bottom: 1px solid #253347;
    position: sticky; top: 0; z-index: 900;
}
.ss-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    height: 52px;
    position: relative;
}

/* Brand */
.ss-brand {
    display: flex; align-items: center; gap: 0.6rem;
    text-decoration: none; color: #F5F4F0;
    font-weight: 700; font-size: 0.95rem;
    letter-spacing: -0.01em;
    font-family: 'Inter', sans-serif;
}
.ss-brand-icon { width: 26px; height: 26px; flex-shrink: 0; }
.ss-brand-icon img { width: 100%; height: 100%; }
.ss-brand-dot { color: #C49A45; }
.ss-brand-tag {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.6rem; font-weight: 600;
    color: #2AA89D; background: rgba(42,168,157,0.15);
    border: 1px solid rgba(42,168,157,0.3);
    padding: 0.1rem 0.4rem; border-radius: 3px;
    letter-spacing: 0.5px; text-transform: uppercase;
    margin-left: 0.25rem;
}

/* Nav links */
.ss-links {
    display: flex; align-items: center; gap: 0.1rem;
}
.ss-link {
    color: #8FA3B8;
    text-decoration: none;
    font-size: 0.8rem; font-weight: 500;
    padding: 0.4rem 0.7rem;
    border-radius: 5px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.ss-link:hover { color: #F5F4F0; background: rgba(255,255,255,0.07); }
.ss-link--active { color: #F5F4F0; background: rgba(255,255,255,0.1); }

/* Dropdown */
.ss-dropdown { position: relative; }
.ss-dropdown-toggle {
    cursor: pointer;
    display: flex; align-items: center; gap: 0.3rem;
}
.ss-dropdown-toggle::after {
    content: '';
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 3.5px solid #8FA3B8;
    transition: transform 0.15s;
}
.ss-dropdown.open .ss-dropdown-toggle::after { transform: rotate(180deg); }
.ss-dropdown-menu {
    display: none;
    position: absolute; top: calc(100% + 6px); right: 0;
    background: #253347;
    border: 1px solid #2E3F5A;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    min-width: 200px;
    padding: 5px 0;
    z-index: 1000;
}
.ss-dropdown.open .ss-dropdown-menu { display: block; }
.ss-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.8rem; font-weight: 500;
    color: #8FA3B8;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
}
.ss-dropdown-menu a:hover { background: rgba(255,255,255,0.06); color: #F5F4F0; }
.ss-dropdown-sep { height: 1px; background: #2E3F5A; margin: 4px 0; }

/* Auth link */
.ss-auth {
    font-size: 0.75rem; font-weight: 600;
    color: #8FA3B8;
    text-decoration: none;
    padding: 0.3rem 0.65rem;
    border: 1px solid #2E3F5A;
    border-radius: 5px;
    margin-left: 0.5rem;
    transition: all 0.15s;
    font-family: 'JetBrains Mono', monospace;
}
.ss-auth:hover { color: #F5F4F0; border-color: #8FA3B8; background: rgba(255,255,255,0.05); }

/* Hamburger */
.ss-hamburger {
    display: none;
    flex-direction: column; justify-content: center; gap: 5px;
    width: 28px; height: 28px;
    cursor: pointer; background: none; border: none; padding: 0;
}
.ss-hamburger span {
    display: block; height: 2px; width: 100%;
    background: #8FA3B8;
    border-radius: 1px;
    transition: all 0.25s;
}
.ss-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ss-hamburger.open span:nth-child(2) { opacity: 0; }
.ss-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Region Group (inside navbar) ── */
.ss-region-group {
    display: flex; align-items: center; gap: 0.2rem;
    margin-right: 0.5rem;
    padding-right: 0.75rem;
    border-right: 1px solid #2E3F5A;
}
.ss-region-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #8FA3B8;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: all 0.15s;
    white-space: nowrap;
    text-decoration: none;
}
.ss-region-btn:hover {
    color: #F5F4F0;
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.1);
}
.ss-region-btn--active {
    color: #F5F4F0;
    background: rgba(196,154,69,0.2);
    border-color: #C49A45;
}
.ss-region-btn--active:hover {
    background: rgba(196,154,69,0.3);
}

/* ── Section Bar ── */
.ss-section-bar {
    background: #253347;
    border-bottom: 1px solid #2E3F5A;
    position: sticky; top: 52px; z-index: 899;
}
.ss-section-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    height: 36px;
    gap: 0.15rem;
}
.ss-section-link {
    color: #8FA3B8;
    text-decoration: none;
    font-size: 0.76rem; font-weight: 600;
    padding: 0.3rem 0.9rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.ss-section-link:hover {
    color: #F5F4F0;
    background: rgba(255,255,255,0.07);
}
.ss-section-link--active {
    color: #F5F4F0;
    background: rgba(42,168,157,0.2);
    border-bottom: 2px solid #2AA89D;
}

/* ── Breadcrumbs ── */
.ss-breadcrumbs {
    display: flex; align-items: center; gap: 0.3rem;
    padding: 0.6rem 0 0.4rem;
    font-size: 0.72rem; color: #8896a6;
}
.ss-breadcrumbs a {
    color: #2c5aa0; text-decoration: none; font-weight: 500;
}
.ss-breadcrumbs a:hover { text-decoration: underline; }
.ss-breadcrumbs-sep { color: #cbd5e0; margin: 0 0.1rem; }
.ss-breadcrumbs-current { color: #4a5568; font-weight: 600; }

/* ── Main Content ── */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

/* ── Global Content Styles ── */
.security-news-content, .country-news-content, .results-content {
    line-height: 1.7;
    overflow-wrap: break-word;
}
.security-news-content h1, .country-news-content h1, .results-content h1,
.section-heading.section-h1 {
    font-family: 'Merriweather', serif;
    font-size: 1.75rem; font-weight: 900;
    margin: 2rem 0 1rem;
    color: #1a2332;
    border-bottom: 2px solid #2c5aa0;
    padding-bottom: 0.5rem;
}
.security-news-content h2, .country-news-content h2, .results-content h2,
.section-heading.section-h2 {
    font-family: 'Merriweather', serif;
    font-size: 1.4rem; font-weight: 700;
    margin: 1.8rem 0 0.8rem;
    color: #1a2332;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.4rem;
}
.security-news-content h3, .country-news-content h3, .results-content h3,
.section-heading.section-h3 {
    font-size: 1.15rem; font-weight: 700;
    margin: 1.5rem 0 0.6rem;
    color: #2d3748;
}
.security-news-content p, .country-news-content p, .results-content p {
    margin-bottom: 1rem;
    text-align: justify;
    color: #4a5568;
}
.security-news-content ul, .security-news-content ol,
.country-news-content ul, .country-news-content ol,
.results-content ul, .results-content ol {
    margin-bottom: 1rem; padding-left: 1.75rem;
}
.security-news-content li, .country-news-content li, .results-content li {
    margin-bottom: 0.45rem; color: #4a5568;
}
.security-news-content blockquote, .country-news-content blockquote, .results-content blockquote {
    border-left: 3px solid #2c5aa0;
    padding: 0.5rem 1rem; margin: 1rem 0;
    background: #f7fafc; color: #4a5568;
    font-style: italic; border-radius: 0 4px 4px 0;
}
.security-news-content code, .country-news-content code, .results-content code {
    background: #edf2f7; padding: 0.15rem 0.4rem;
    border-radius: 3px; font-size: 0.88em;
}
.security-news-content pre, .country-news-content pre, .results-content pre {
    background: #1a2332; color: #e2e8f0;
    padding: 1rem; border-radius: 6px;
    overflow-x: auto; margin-bottom: 1rem;
}
.security-news-content a, .country-news-content a, .results-content a {
    color: #2c5aa0; text-decoration: none;
}
.security-news-content a:hover, .country-news-content a:hover, .results-content a:hover {
    text-decoration: underline;
}
.security-news-content hr, .country-news-content hr, .results-content hr {
    border: 0; height: 1px; background: #e2e8f0; margin: 1.5rem 0;
}

/* ── Utility ── */
.refresh-container { margin-bottom: 1.25rem; text-align: right; }
.refresh-button {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: #2c5aa0; color: #fff;
    text-decoration: none; border-radius: 5px;
    font-size: 0.82rem; font-weight: 600;
    transition: background 0.15s;
}
.refresh-button:hover { background: #1e4a8a; }
.refresh-button::before { content: "\21BB "; }

/* ── Footer ── */
.ss-footer {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    font-size: 0.75rem;
    color: #a0aec0;
    border-top: 1px solid #e2e8f0;
    margin-top: 2rem;
}
.ss-footer a { color: #2c5aa0; text-decoration: none; }
.ss-footer a:hover { text-decoration: underline; }

/* ── Mobile — Global Layout ── */
@media (max-width: 768px) {
    .ss-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: #1C2B3A;
        border-top: 1px solid #253347;
        padding: 0.5rem 0;
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    }
    .ss-links.open { display: flex; }
    .ss-link, .ss-auth {
        text-align: center;
        padding: 0.7rem 1rem;
        border-radius: 0;
    }
    .ss-auth { border: none; margin: 0; }
    .ss-hamburger { display: flex; }
    .ss-region-group {
        flex-wrap: wrap; justify-content: center;
        border-right: none; margin-right: 0;
        padding-right: 0; padding-bottom: 0.3rem;
        border-bottom: 1px solid #253347;
        margin-bottom: 0.3rem;
    }
    .ss-region-btn { font-size: 0.65rem; padding: 0.2rem 0.6rem; }
    .ss-section-bar { top: 52px; }
    .ss-section-bar-inner { gap: 0.1rem; flex-wrap: wrap; height: auto; padding: 0.3rem 1.25rem; }
    .ss-section-link { font-size: 0.7rem; padding: 0.25rem 0.6rem; }
    .ss-dropdown-menu {
        position: static;
        box-shadow: none; border: none; border-radius: 0;
        background: rgba(255,255,255,0.04);
    }
    .ss-dropdown-menu a { color: #8FA3B8; }
    .ss-dropdown-menu a:hover { color: #F5F4F0; background: rgba(255,255,255,0.06); }
    .ss-dropdown-sep { background: #253347; }
    .ss-brand-tag { display: none; }
    .ss-breadcrumbs { font-size: 0.65rem; }
}
