:root {
  --foreground-rgb: 255, 255, 255;
  --background-start-rgb: 17, 24, 39;
  --background-end-rgb: 15, 23, 42;
  --accent-color: 59, 130, 246;
  --accent-color-dark: 37, 99, 235;
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: rgba(0, 0, 0, 0.25);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: rgb(var(--foreground-rgb));
  background: linear-gradient(135deg, rgb(var(--background-start-rgb)) 0%, rgb(var(--background-end-rgb)) 100%);
  min-height: 100vh;
  background-attachment: fixed;
  line-height: 1.6;
}

a { color: rgb(var(--accent-color)); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.min-h-screen { min-height: 100vh; display: flex; flex-direction: column; }

/* Glass components */
.glass-container {
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}

.glass-card {
  backdrop-filter: blur(16px);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 0.75rem;
  box-shadow: 0 8px 32px var(--glass-shadow);
  padding: 1.5rem;
  transition: transform 0.3s ease;
}
.glass-card:hover { transform: translateY(-2px); }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }

.logo {
  font-size: 1.5rem; font-weight: 700;
  background: linear-gradient(to right, rgb(var(--accent-color)), #818cf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: transparent;
}
.logo:hover { text-decoration: none; }

.nav-list { list-style: none; display: flex; gap: 2rem; }
.nav-link { color: rgba(255,255,255,0.8); position: relative; padding-bottom: 2px; }
.nav-link::after {
  content: ''; position: absolute; width: 0; height: 2px;
  background: rgb(var(--accent-color)); left: 0; bottom: -2px;
  transition: width 0.3s;
}
.nav-link:hover { color: rgb(var(--accent-color)); text-decoration: none; }
.nav-link:hover::after { width: 100%; }

/* Main content */
.main-content { flex: 1; padding: 2rem 1.5rem; }

/* Footer */
.footer { padding: 2rem; text-align: center; color: rgba(255,255,255,0.4); margin-top: 2rem; }

/* Forms */
.input-primary {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: white; font-size: 1rem;
  outline: none; width: 100%;
  transition: border-color 0.3s;
}
.input-primary:focus { border-color: rgb(var(--accent-color)); box-shadow: 0 0 0 2px rgba(var(--accent-color), 0.3); }
.input-primary::placeholder { color: rgba(255,255,255,0.4); }

.btn-primary {
  display: inline-block;
  background: rgb(var(--accent-color-dark));
  color: white; font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem; border: none;
  cursor: pointer; font-size: 1rem;
  transition: background 0.3s, box-shadow 0.3s;
}
.btn-primary:hover { background: rgb(var(--accent-color)); box-shadow: 0 4px 16px rgba(var(--accent-color), 0.4); text-decoration: none; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: white; font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem; border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer; font-size: 0.875rem;
  transition: background 0.3s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.2); text-decoration: none; }

/* Hero */
.hero { text-align: center; padding: 3rem 0; }
.hero h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
.hero p { font-size: 1.125rem; color: rgba(255,255,255,0.7); max-width: 600px; margin: 0 auto 2rem; }

/* Analyze form */
.analyze-form { display: flex; gap: 0.75rem; max-width: 600px; margin: 0 auto; }
.analyze-form .input-primary { flex: 1; }

/* Result card */
.result-card { max-width: 700px; margin: 2rem auto; }
.result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.result-domain { font-size: 0.875rem; color: rgba(255,255,255,0.6); }

/* Bias badge */
.bias-badge {
  display: inline-block; padding: 0.25rem 0.75rem;
  border-radius: 9999px; font-weight: 600; font-size: 0.875rem;
}
.bias-left { background: rgba(59,130,246,0.3); color: #93c5fd; }
.bias-center-left { background: rgba(34,211,238,0.3); color: #67e8f9; }
.bias-center { background: rgba(34,197,94,0.3); color: #86efac; }
.bias-center-right { background: rgba(251,146,60,0.3); color: #fdba74; }
.bias-right { background: rgba(239,68,68,0.3); color: #fca5a5; }
.bias-unknown { background: rgba(156,163,175,0.3); color: #d1d5db; }

/* Analysis text */
.analysis-text { color: rgba(255,255,255,0.85); line-height: 1.8; }
.analysis-text ul { padding-left: 1.25rem; margin: 0.5rem 0; }
.analysis-text li { margin: 0.25rem 0; }
.analysis-text strong { color: white; }

/* Alert */
.alert { padding: 1rem; border-radius: 0.5rem; margin: 1rem 0; }
.alert-error { background: rgba(239,68,68,0.2); border: 1px solid rgba(239,68,68,0.4); color: #fca5a5; }
.alert-info { background: rgba(59,130,246,0.2); border: 1px solid rgba(59,130,246,0.4); color: #93c5fd; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.data-table th, .data-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.1); }
.data-table th { color: rgba(255,255,255,0.6); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table tr:hover { background: rgba(255,255,255,0.05); }

/* Reports list */
.report-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.5rem; margin: 0.5rem 0;
  transition: background 0.3s;
  flex-wrap: wrap; gap: 0.5rem;
}
.report-item:hover { background: rgba(255,255,255,0.1); }
.report-item a { color: white; }
.report-item a:hover { text-decoration: none; }
.report-meta { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* Pagination */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin: 2rem 0; align-items: center; }
.pagination .page-num { color: rgba(255,255,255,0.6); font-size: 0.875rem; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.stat-card { text-align: center; padding: 1.25rem; border-radius: 0.75rem; }
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-top: 0.25rem; }

/* Section headings */
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
.section-subtitle { font-size: 0.875rem; color: rgba(255,255,255,0.5); margin-bottom: 1.5rem; }

/* Badge row */
.badge-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }

/* Report detail */
.report-detail { max-width: 800px; margin: 0 auto; }
.report-detail .meta-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; font-size: 0.875rem; color: rgba(255,255,255,0.6); }
.report-detail .actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

.direct-badge {
  display: inline-block; background: rgba(251,191,36,0.2);
  border: 1px solid rgba(251,191,36,0.4);
  color: #fcd34d; padding: 0.125rem 0.5rem;
  border-radius: 9999px; font-size: 0.75rem;
}

/* Domain page header */
.domain-header { margin-bottom: 2rem; }
.subdomain-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.subdomain-tag {
  background: rgba(255,255,255,0.1); padding: 0.125rem 0.5rem;
  border-radius: 9999px; font-size: 0.75rem; color: rgba(255,255,255,0.7);
}

/* Loading spinner */
.spinner {
  display: inline-block; width: 1.25rem; height: 1.25rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.75rem; }
  .analyze-form { flex-direction: column; }
  .header-inner { flex-direction: column; gap: 0.75rem; }
  .report-item { flex-direction: column; align-items: flex-start; }
}
