/* Cyberbullying Data Visualization */

:root {
  --bg-body: #0b0e14;
  --bg-card: rgba(30, 41, 59, 0.6);
  --bg-nav: rgba(15, 23, 42, 0.88);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;

  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.3);
  --accent: #f59e0b;

  --border-light: rgba(255, 255, 255, 0.1);
  --font-family: 'Inter', sans-serif;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08) 0%, transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(245, 158, 11, 0.07) 0%, transparent 25%);
  background-attachment: fixed;
}

.highlight {
  color: var(--primary);
  text-shadow: 0 0 15px var(--primary-glow);
}

.ext-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  margin-top: 0.75rem;
  transition: var(--transition);
}

.ext-link:hover {
  color: #fbbf24;
  transform: translateX(4px);
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tabs {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

.tab-btn:hover,
.tab-btn.active {
  color: var(--text-main);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero {
  margin-bottom: 2rem;
  text-align: left;
}

.hero h1 {
  font-size: 2.7rem;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 760px;
  margin-bottom: 2rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.3rem;
}

.kpi-card h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.kpi-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.kpi-sub {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.impact-visual-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}

.impact-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.impact-header p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-bottom: 1rem;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.impact-dot {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.impact-dot.impacted {
  background: rgba(245, 158, 11, 0.32);
  border-color: rgba(245, 158, 11, 0.55);
}

.impact-dot.pulse {
  animation: pulseImpact 0.65s ease;
}

@keyframes pulseImpact {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(245, 158, 11, 0); }
  50% { transform: scale(1.08); box-shadow: 0 0 18px rgba(245, 158, 11, 0.55); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(245, 158, 11, 0); }
}

.impact-caption {
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

#impact-counter {
  color: var(--accent);
  font-size: 1.2rem;
}

.impact-fact-text {
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.25s ease;
  min-height: 2.2rem;
  font-size: 0.93rem;
}

.impact-fact-text.show {
  opacity: 1;
}

.controls-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(30, 41, 59, 0.4);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.controls-bar label {
  font-weight: 500;
  color: var(--text-muted);
}

select,
input,
textarea {
  background: #0f172a;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
  outline: none;
}

select {
  max-width: 260px;
  cursor: pointer;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--primary);
}

textarea {
  resize: vertical;
}

.divider {
  color: var(--border-light);
  font-size: 1.25rem;
}

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

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
}

.chart-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.canvas-container {
  position: relative;
  width: 100%;
}

.main-chart .canvas-container,
.secondary-chart .canvas-container {
  height: 400px;
}

.section-header {
  margin-bottom: 2.2rem;
  text-align: center;
}

.section-header h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
}

.cards-grid,
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  transition: var(--transition);
}

.info-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.card-badge {
  position: absolute;
  top: 0.95rem;
  right: 0.95rem;
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.info-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.65rem;
  color: var(--text-main);
}

.source-desc {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.data-details {
  list-style: none;
  margin-bottom: 0.9rem;
}

.data-details li {
  margin-bottom: 0.65rem;
  font-size: 0.94rem;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
}

.data-details li::before {
  content: '•';
  color: var(--primary);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.data-details strong {
  color: var(--text-main);
}

.brief-container {
  display: flex;
  justify-content: center;
}

.policy-doc {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2.4rem;
  max-width: 850px;
  width: 100%;
}

.doc-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.8rem;
  margin-bottom: 2.2rem;
}

.doc-meta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.8rem;
  letter-spacing: 0.08em;
}

.doc-header h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.doc-section {
  margin-bottom: 2.2rem;
}

.doc-section h2 {
  font-size: 1.3rem;
  color: var(--text-main);
  margin-bottom: 0.8rem;
  padding-left: 0.8rem;
  border-left: 4px solid var(--accent);
}

.doc-section p,
.doc-section li {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 0.85rem;
}

.doc-section ul {
  padding-left: 1.3rem;
}

.recommendation-block {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.recommendation-block h3 {
  font-size: 1.03rem;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.template-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.template-form-grid label,
.info-card > label {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  margin-top: 0.35rem;
}

.template-actions {
  display: flex;
  gap: 0.7rem;
  margin: 0.8rem 0;
  flex-wrap: wrap;
}

.directory-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.zip-action-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.zip-action-group .action-btn {
  width: 100%;
}

.directory-stat-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(80px, 1fr));
  gap: 0.55rem;
  margin-top: 0.7rem;
  margin-bottom: 0.8rem;
}

.stat-pill {
  background: linear-gradient(145deg, rgba(14, 25, 42, 0.95), rgba(30, 41, 59, 0.6));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.directory-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 0.8rem;
  margin-top: 0.4rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.directory-footer {
  margin-top: 0.7rem;
  display: flex;
  justify-content: center;
}

.directory-empty {
  border: 1px dashed var(--border-light);
  border-radius: 10px;
  padding: 0.9rem;
  color: var(--text-muted);
}

.rep-card {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 12px;
  padding: 0.85rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.2), transparent 45%),
    linear-gradient(155deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.62));
}

.rep-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

.rep-card-header h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.rep-meta {
  color: var(--text-muted);
  font-size: 0.83rem;
  margin-bottom: 0.5rem;
}

.chamber-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-senate {
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.5);
}

.badge-house {
  background: rgba(245, 158, 11, 0.2);
  color: #fdba74;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.rep-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.rep-card-grid div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.86rem;
}

.meta-label {
  color: var(--text-muted);
}

.rep-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.rep-actions a,
.muted-link {
  font-size: 0.78rem;
  text-decoration: none;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.rep-actions a {
  color: var(--text-main);
}

.muted-link {
  color: var(--text-muted);
}

.action-btn {
  border: 1px solid transparent;
  background: var(--primary);
  color: #0b1220;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  filter: brightness(1.06);
}

.action-btn-secondary {
  background: #1e293b;
  color: var(--text-main);
  border-color: var(--border-light);
}

.status-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-body);
}

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

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .nav-content {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.8rem 1rem;
  }

  .tabs {
    width: 100%;
    justify-content: space-between;
    gap: 0.8rem;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .divider {
    display: none;
  }

  .impact-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .policy-doc {
    padding: 1.4rem;
  }

  .directory-controls {
    grid-template-columns: 1fr;
  }

  .zip-action-group {
    grid-template-columns: 1fr;
  }

  .directory-stat-strip {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
  }
}
