/* Ph.D. Scholarship & Doctoral Fellowship Portal Theme
 * Direct port of CODCrafters Design Tokens (codcrafters.org)
 * Midnight Violet + Warm Amber Aesthetic
 * (Strictly NO em-dashes anywhere)
 */

:root {
  --bg: #07060d;
  --bg-2: #0e0b1c;
  --bg-3: #140f26;
  --ink: #f4f2ff;
  --ink-2: #c9c3e6;
  --ink-3: #8e87ad;
  --primary: #7c3aed;
  --primary-2: #8b5cf6;
  --lilac: #c4b5fd;
  --accent: #f59e0b;
  --accent-2: #fbbf24;
  --tier-a: #10b981;
  --tier-a-bg: rgba(16, 185, 129, 0.12);
  --tier-b: #8b5cf6;
  --tier-b-bg: rgba(139, 92, 246, 0.12);
  --tier-c: #f59e0b;
  --tier-c-bg: rgba(245, 158, 11, 0.12);
  --glass: rgba(14, 11, 28, 0.65);
  --glass-line: rgba(196, 181, 253, 0.14);
  --glass-hover: rgba(26, 20, 51, 0.75);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-full: 9999px;
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --nav-h: 72px;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: radial-gradient(120% 90% at 70% 10%, #1a1036 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

p {
  color: var(--ink-2);
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(7, 6, 13, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.55);
}

.brand__mark svg {
  width: 22px;
  height: 22px;
}

.brand__title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand__title b {
  color: var(--accent);
  font-weight: 700;
}

.brand__badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.2);
  color: var(--lilac);
  border: 1px solid rgba(196, 181, 253, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.2s ease;
}

.nav__link:hover, .nav__link.active {
  color: var(--ink);
}

.nav__link.active {
  color: var(--accent);
}

/* Hero Section */
.hero {
  padding: 48px var(--gutter) 32px;
  max-width: 1320px;
  margin: 0 auto;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.hero__title {
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 700;
  margin-bottom: 18px;
  max-width: 900px;
}

.hero__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__lead {
  font-size: clamp(16px, 1.8vw, 18px);
  color: var(--ink-2);
  max-width: 780px;
  margin-bottom: 32px;
}

/* Metrics Row */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.metric-card {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 181, 253, 0.3);
}

.metric-card__val {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}

.metric-card__label {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}

/* Urgent Alert Banner */
.deadline-rail {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(124, 58, 237, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deadline-rail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.deadline-rail__title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.deadline-rail__badge {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--accent);
  color: #120b02;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.deadline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.deadline-item {
  background: rgba(14, 11, 28, 0.7);
  border: 1px solid rgba(196, 181, 253, 0.16);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deadline-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deadline-item__name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.deadline-item__days {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.deadline-item__meta {
  font-size: 13px;
  color: var(--ink-2);
}

/* Tabs & Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.tabs {
  display: flex;
  gap: 8px;
  background: rgba(14, 11, 28, 0.5);
  border: 1px solid var(--glass-line);
  padding: 4px;
  border-radius: var(--radius-full);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.card {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(196, 181, 253, 0.35);
  background: var(--glass-hover);
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.card__institution {
  font-size: 13px;
  color: var(--lilac);
  font-weight: 500;
  margin-top: 2px;
}

/* Tier Badges */
.tier-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tier-tag--a {
  background: var(--tier-a-bg);
  color: var(--tier-a);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tier-tag--b {
  background: var(--tier-b-bg);
  color: var(--tier-b);
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.tier-tag--c {
  background: var(--tier-c-bg);
  color: var(--tier-c);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.card__detail {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

.card__detail b {
  color: var(--ink);
  font-weight: 600;
}

.card__footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(196, 181, 253, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card__deadline {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.card__deadline b {
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #120b02;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.5);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border-color: rgba(196, 181, 253, 0.25);
}

.btn--ghost:hover {
  border-color: var(--lilac);
  background: rgba(124, 58, 237, 0.2);
}

.btn--sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

/* Modal / Review Queue Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  place-items: center;
  padding: 20px;
}

.drawer-backdrop.is-open {
  display: grid;
}

.drawer {
  background: var(--bg-2);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer__close {
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: 24px;
  cursor: pointer;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input, .form-textarea {
  background: var(--bg-3);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
}

.form-textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 220px;
}

.form-input:focus, .form-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: transparent;
}

/* Footer */
.footer {
  border-top: 1px solid var(--glass-line);
  padding: 32px var(--gutter);
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}
