/* ============================================================
 * SSL.ro Romanian CT Index — Trust & Authority Design System
 * Inspired: ui-ux-pro-max --design-system
 * Palette: Navy + Trust Blue + Gold accent (dark mode native)
 * Type: Plus Jakarta Sans (display) + Plus Jakarta Sans (body) + IBM Plex Mono (mono)
 * ============================================================ */

:root {
  /* Surfaces */
  --bg-0: #050A14;        /* deepest */
  --bg-1: #0B1426;        /* card surface */
  --bg-2: #122039;        /* elevated */
  --bg-3: #1A2C4D;        /* highest elevation */

  /* Borders */
  --border: #1F3154;
  --border-hi: #2A4474;
  --border-glow: rgba(59, 130, 246, 0.3);

  /* Text (WCAG AAA on bg-0) */
  --text: #EEF3FA;        /* primary */
  --text-dim: #A8B5CC;    /* secondary, contrast 7:1 */
  --text-mute: #6B7B9C;   /* tertiary, contrast 4.5:1 */

  /* Brand */
  --primary: #1E3A8A;     /* Authority Navy */
  --primary-hi: #3B82F6;  /* Trust Blue bright */
  --secondary: #1E40AF;
  --accent: #B45309;      /* Trust Gold */
  --accent-hi: #F59E0B;   /* Gold bright */

  /* Status */
  --success: #047857;
  --success-hi: #10B981;
  --danger: #B91C1C;
  --danger-hi: #EF4444;
  --warning: #B45309;
  --warning-hi: #F59E0B;

  /* Aliases (legacy) */
  --trust: var(--primary);
  --trust-hi: var(--primary-hi);
  --secure: var(--success);
  --secure-hi: var(--success-hi);
  --gold: var(--accent);
  --gold-hi: var(--accent-hi);
  --red: var(--danger);
  --red-hi: var(--danger-hi);

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 24px rgba(59, 130, 246, 0.18);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --t-fast: 150ms;
  --t-mid: 250ms;
  --t-slow: 400ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
*:focus-visible {
  outline: 2px solid var(--primary-hi);
  outline-offset: 2px;
  border-radius: 4px;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}

code, pre, .mono {
  font-family: 'IBM Plex Mono', 'Menlo', monospace;
  font-feature-settings: "liga" 1;
}

a {
  color: var(--primary-hi);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--accent-hi); }

/* Header */
header.site-header {
  background: linear-gradient(180deg, var(--bg-1) 0%, rgba(11,20,38,0.85) 100%);
  border-bottom: 1px solid var(--border);
  padding: 18px 40px;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}
header.site-header .inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
header.site-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
}
header.site-header .logo .sub {
  font-size: 10px;
  color: var(--accent-hi);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: rgba(217,119,6,0.08);
}
header.site-header nav.main-nav {
  display: flex;
  gap: 8px;
  font-size: 14px;
}
header.site-header nav.main-nav a {
  color: var(--text-dim);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast) var(--ease);
}
header.site-header nav.main-nav a:hover {
  color: #fff;
  background: rgba(59,130,246,0.08);
}
header.site-header nav.main-nav a.active {
  color: var(--accent-hi);
  background: rgba(245,158,11,0.08);
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 70px 20px 50px;
  background: radial-gradient(ellipse at 50% 0%, rgba(30,58,138,0.25) 0%, transparent 60%);
  position: relative;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
}
.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #fff 0%, #93C5FD 50%, #FBBF24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero h1 code {
  background: rgba(245,158,11,0.12);
  padding: 0 12px;
  border-radius: 8px;
  -webkit-text-fill-color: var(--accent-hi);
  border: 1px solid rgba(245,158,11,0.3);
}
.hero p.lead {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text-dim);
  max-width: 720px;
  margin: 0 auto 32px;
  line-height: 1.65;
}

/* Search box */
.search-box {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  background: var(--bg-1);
  border: 2px solid var(--border-hi);
  border-radius: var(--radius-lg);
  padding: 5px;
  transition: all var(--t-mid) var(--ease);
  box-shadow: var(--shadow-md);
}
.search-box:focus-within {
  border-color: var(--primary-hi);
  box-shadow: var(--shadow-glow), var(--shadow-md);
}
.search-box input[type="text"] {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 14px 20px;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  outline: none;
}
.search-box input[type="text"]::placeholder { color: var(--text-mute); }

.search-box input[type="text"][aria-invalid="true"] {
  box-shadow: none;
}

.ct-search-validation {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: none;
  margin: 0.65rem 0 0;
  padding: 0.85rem 1.5rem;
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.6;
  position: relative;
  z-index: 1;
  text-align: center;
}

.ct-search-validation::before {
  content: none;
  display: none;
}

.ct-search-validation[hidden] {
  display: none;
}

.dense-table .meta.match-summary {
  display: flex;
  max-width: 100%;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.dense-table .meta.match-summary .match-query-label,
.dense-table .meta.match-summary .match-query-more {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.dense-table .meta.match-summary .match-query-values {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-hi);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dense-table .meta.match-summary .match-query-more {
  color: var(--accent-hi);
}

.search-box button {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hi) 100%);
  border: 0;
  color: #fff;
  padding: 0 28px;
  border-radius: var(--radius-md);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all var(--t-fast) var(--ease);
}
.search-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59,130,246,0.3);
}
.search-box button:active { transform: translateY(0); }

.search-hint {
  max-width: 720px;
  margin: 14px auto 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-mute);
}
.search-hint code {
  background: var(--bg-3);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--accent-hi);
  font-size: 11px;
}

/* Stats cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 30px 0;
}
.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--t-mid) var(--ease);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-hi));
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hi);
  box-shadow: var(--shadow-md);
}
.stat-card:hover::before { opacity: 1; }
.stat-card .label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-mute);
  margin-bottom: 8px;
  font-weight: 600;
}
.stat-card .value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 28px;
  color: var(--accent-hi);
  font-weight: 600;
  line-height: 1.1;
  animation: stat-reveal var(--t-slow) var(--ease);
}
.stat-card .sub {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 6px;
}

@keyframes stat-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards/sections */
section.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 36px;
  margin-bottom: 24px;
  transition: border-color var(--t-mid) var(--ease);
}
section.card:hover { border-color: var(--border-hi); }
section.card h2 {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
section.card h3 {
  font-size: 14px;
  color: var(--accent-hi);
  margin: 22px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 14px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-2);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: var(--bg-3);
  text-align: left;
  padding: 12px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text);
  border-bottom: 1px solid var(--border-hi);
}
th.num, td.num { text-align: right; font-family: 'IBM Plex Mono', monospace; }
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  transition: background var(--t-fast) var(--ease);
}
tr:last-child td { border-bottom: none; }
tr:hover td {
  background: rgba(59,130,246,0.06);
  color: var(--text);
}
td .mono, td code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--accent-hi);
}
td a { color: var(--primary-hi); }
td a:hover { color: var(--accent-hi); }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-left: 6px;
  vertical-align: middle;
  transition: all var(--t-fast) var(--ease);
}
.badge:hover { transform: scale(1.05); }
.badge-active {
  background: rgba(16,185,129,0.12);
  color: var(--success-hi);
  border: 1px solid var(--success);
}
.badge-expired {
  background: rgba(107,123,156,0.15);
  color: var(--text-mute);
  border: 1px solid var(--text-mute);
}
.badge-revoked {
  background: rgba(239,68,68,0.12);
  color: var(--danger-hi);
  border: 1px solid var(--danger);
}
.badge-wildcard {
  background: rgba(245,158,11,0.12);
  color: var(--accent-hi);
  border: 1px solid var(--accent);
}

/* Source pills */
.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace;
  margin: 2px 3px;
  transition: all var(--t-fast) var(--ease);
}
.source-pill:hover {
  border-color: var(--primary-hi);
  color: #fff;
}
.source-pill.first {
  background: rgba(16,185,129,0.12);
  border-color: var(--success);
  color: var(--success-hi);
}
.source-pill .op { color: var(--accent-hi); }

/* Footer */
footer.site-foot {
  max-width: 1400px;
  margin: 60px auto 0;
  padding: 30px 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-mute);
  font-size: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.3px;
}

/* Progress bars for operators */
.bar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0;
  font-size: 13px;
}
.bar-row .name {
  flex: 0 0 220px;
  color: var(--text-dim);
  font-weight: 500;
}
.bar-row .bar-wrap {
  flex: 1;
  background: var(--bg-3);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}
.bar-row .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-hi), var(--accent-hi));
  border-radius: 5px;
  position: relative;
  transition: width var(--t-slow) var(--ease);
}
.bar-row .bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.bar-row .val {
  flex: 0 0 100px;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent-hi);
  font-size: 12px;
  font-weight: 500;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-mute);
}
.empty .icon { font-size: 48px; margin-bottom: 14px; opacity: 0.3; }

/* Pulse for live indicators */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.6); }
  50% { opacity: 1; box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-hi);
  animation: pulse-dot 2s infinite;
  margin-right: 6px;
  vertical-align: middle;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .hero { padding: 40px 16px 30px; }
  .container { padding: 20px; }
  header.site-header { padding: 14px 20px; position: relative; }
  header.site-header .inner { gap: 10px; }
  header.site-header nav.main-nav { gap: 4px; flex-wrap: wrap; }
  header.site-header nav.main-nav a { padding: 6px 10px; font-size: 13px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  section.card { padding: 22px 20px; }
  .stat-card { padding: 16px 16px; }
  .stat-card .value { font-size: 24px; }
  .bar-row {
    display: grid;
    grid-template-columns: minmax(100px, 0.9fr) minmax(100px, 1.5fr) 86px;
    gap: 8px;
  }
  .bar-row .name { flex: none; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
  .bar-row .val { flex: none; width: auto; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card .label { font-size: 10px; }
  .stat-card .value { font-size: 23px; }
  .bar-row {
    grid-template-columns: 1fr 78px;
    align-items: start;
  }
  .bar-row .bar-wrap { grid-column: 1 / -1; grid-row: 2; }
  .search-box { flex-direction: column; gap: 4px; }
  .search-box button { padding: 12px; width: 100%; }
}
