@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
  --bg: #050a14;
  --surface: #0f172a;
  --surface-glass: rgba(15, 23, 42, 0.6);
  --card: #1e293b;
  --card-glass: rgba(30, 41, 59, 0.7);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.5);
  --accent: #f59e0b;
  /* Gold/Amber */
  --accent-glow: rgba(245, 158, 11, 0.5);
  --success: #10b981;
  --danger: #ef4444;
  --border: rgba(148, 163, 184, 0.1);
  --ring: rgba(148, 163, 184, 0.2);
  --radius: 16px;
  --font-main: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 0%, #1e293b 0%, var(--bg) 60%),
    radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 15% 70%, rgba(245, 158, 11, 0.05) 0%, transparent 40%);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 32px;
  position: sticky;
  top: 20px;
  z-index: 50;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.header:hover {
  transform: translateY(-2px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}

.brand h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(to right, #fff, #94a3b8);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand .badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}

/* Cards & Layout */
.hero {
  display: grid;
  gap: 24px;
  animation: fadeUp 0.8s ease-out;
}

.card {
  background: var(--card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Forms */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

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

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-muted);
}

input,
textarea,
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(0, 0, 0, 0.4);
}

/* Buttons */
.row {
  display: flex;
  gap: 16px;
}

button,
.btn-primary,
.btn-secondary {
  border: none;
  cursor: pointer;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Visuals */
.visual {
  position: relative;
  height: 500px;
  background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.dotViz {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.label {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: #fff;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: none;
  max-width: 250px;
}

/* KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.kpi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s;
}

.kpi:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.05);
}

.kpi .big {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(to bottom, #fff, #94a3b8);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

/* Certificate */
.certificate {
  margin-top: 24px;
  background: #fff;
  /* Always white for download */
  color: #0f172a;
  padding: 32px;
  border-radius: 0;
  /* Sharp corners for print feel */
  display: none;
  position: relative;
  overflow: hidden;
}

.cer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.cer-title {
  font-family: 'Times New Roman', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.cer-sub {
  font-size: 1rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-top: 8px;
}

.cer-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
}

.cer-name {
  font-size: 3rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  font-family: 'Pinyon Script', cursive;
  /* Need to import this if used, else fallback */
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  opacity: 0.6;
}

/* Admin Table */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

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

.table th,
.table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table th {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.table tbody tr {
  transition: background 0.2s ease;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Category Pill in Table */
.cat-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Action Button in Table */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* Range Input */
input[type=range] {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  padding: 0;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  margin-top: -8px;
  box-shadow: 0 0 10px var(--primary-glow);
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: var(--border);
  border-radius: 2px;
}

/* Mobile Responsiveness for Header */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
    gap: 8px;
    top: 10px;
    /* User mentioned "static there" looking bad. 
       If they meant position:static, this doesn't change it. 
       If they meant it's stuck and taking space, we can make it relative or smaller.
       Let's keep it sticky but smaller. */
  }

  .logo {
    gap: 8px;
  }

  .logo img {
    width: 32px;
    height: 32px;
  }

  .brand .badge {
    font-size: 0.55rem;
    white-space: nowrap;
    letter-spacing: 0.5px;
  }

  .brand h2 {
    font-size: 0.85rem;
    white-space: nowrap;
  }

  /* Hide status text on small screens to save space */
  #status-text {
    display: none;
  }

  .status {
    padding: 6px;
  }

  /* Adjust right logo */
  .header>.logo:last-child img {
    height: 24px;
  }
}