/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #05050f;
  --bg-card: rgba(15, 15, 35, 0.6);
  --bg-card-hover: rgba(20, 20, 45, 0.8);
  --border: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(0, 240, 255, 0.3);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --cyan: #00f0ff;
  --purple: #7c3aed;
  --amber: #f59e0b;
  --green: #10b981;
  --red: #ef4444;
  --gradient: linear-gradient(135deg, #00f0ff 0%, #7c3aed 100%);
  --gradient-text: linear-gradient(135deg, #00f0ff 0%, #a78bfa 50%, #7c3aed 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-glow: 0 0 40px rgba(0, 240, 255, 0.08);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

.accent { color: var(--cyan); }

/* ===== Animated Background ===== */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.bg-glow {
  position: fixed; z-index: -2;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}
.bg-glow--1 { width: 500px; height: 500px; background: #00f0ff; top: -100px; left: -100px; }
.bg-glow--2 { width: 600px; height: 600px; background: #7c3aed; bottom: -200px; right: -150px; animation-delay: -7s; }
.bg-glow--3 { width: 400px; height: 400px; background: #1e3a8a; top: 40%; left: 50%; animation-delay: -14s; opacity: 0.25; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, -60px) scale(1.1); }
  66% { transform: translate(-50px, 70px) scale(0.95); }
}

/* ===== Navigation ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(5, 5, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.nav--scrolled { background: rgba(5, 5, 15, 0.92); box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3); }

.nav__brand { display: flex; align-items: center; gap: 0.75rem; }
.nav__logo { width: 40px; height: 40px; display: flex; align-items: center; }
.nav__logo svg { width: 100%; height: 100%; animation: rotate 30s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.nav__title { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 1.25rem; letter-spacing: 0.5px; }

.nav__links { display: flex; gap: 0.5rem; }
.nav__link {
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  color: var(--text-dim); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  transition: var(--transition); position: relative;
}
.nav__link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav__link.active { color: var(--cyan); }
.nav__link.active::after {
  content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2px; background: var(--cyan); border-radius: 2px;
  box-shadow: 0 0 8px var(--cyan);
}

.nav__cta {
  padding: 0.6rem 1.2rem; border: none; border-radius: var(--radius-sm);
  background: var(--gradient); color: #fff; font-weight: 600; font-size: 0.85rem;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}
.nav__cta:hover { transform: translateY(-1px); box-shadow: 0 4px 25px rgba(0, 240, 255, 0.5); }

.nav__menu { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; }

.mobile-menu {
  position: fixed; top: 64px; left: 0; right: 0; z-index: 99;
  background: rgba(5, 5, 15, 0.95); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: none; flex-direction: column; padding: 1rem 2rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu__link { padding: 0.75rem 0; color: var(--text-dim); text-decoration: none; font-weight: 500; }
.mobile-menu__link:hover { color: var(--cyan); }

/* ===== Sections ===== */
.section { padding: 6rem 2rem 4rem; max-width: 1280px; margin: 0 auto; }
.section--hero { padding-top: 8rem; }

.section__header { text-align: center; margin-bottom: 3rem; }
.section__tag {
  display: inline-block; font-family: 'Orbitron', sans-serif; font-size: 0.75rem;
  letter-spacing: 3px; color: var(--cyan); margin-bottom: 0.75rem;
  padding: 0.3rem 1rem; border: 1px solid var(--border-bright); border-radius: 50px;
}
.section__title { font-family: 'Orbitron', sans-serif; font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.section__desc { color: var(--text-dim); font-size: 1.05rem; max-width: 600px; margin: 0 auto; }

/* ===== Hero ===== */
.hero { text-align: center; margin-bottom: 3rem; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem; border-radius: 50px;
  background: rgba(0, 240, 255, 0.08); border: 1px solid var(--border-bright);
  font-size: 0.8rem; color: var(--cyan); font-weight: 500; margin-bottom: 1.5rem;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 8px rgba(0, 240, 255, 0); }
}

.hero__title {
  font-family: 'Orbitron', sans-serif; font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900; line-height: 1.1; margin-bottom: 1.5rem;
}
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__subtitle { color: var(--text-dim); font-size: 1.15rem; max-width: 600px; margin: 0 auto 2rem; }
.hero__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  padding: 0.85rem 2rem; border: none; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn--primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0, 240, 255, 0.4); }
.btn--ghost {
  background: transparent; color: var(--text); border: 1px solid var(--border);
}
.btn--ghost:hover { border-color: var(--border-bright); background: rgba(255, 255, 255, 0.03); }

/* ===== Stat Cards ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-top: 2rem;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; backdrop-filter: blur(10px); transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient); opacity: 0; transition: var(--transition);
}
.stat-card:hover { background: var(--bg-card-hover); border-color: var(--border-bright); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.stat-card:hover::before { opacity: 1; }

.stat-card__icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 240, 255, 0.1); color: var(--cyan); margin-bottom: 1rem;
}
.stat-card__icon svg { width: 22px; height: 22px; }
.stat-card__icon--amber { background: rgba(245, 158, 11, 0.1); color: var(--amber); }
.stat-card__icon--green { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.stat-card__icon--purple { background: rgba(124, 58, 237, 0.1); color: var(--purple); }

.stat-card__value { font-family: 'Orbitron', sans-serif; font-size: 2.5rem; font-weight: 700; line-height: 1; }
.stat-card__label { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.3rem; }
.stat-card__trend { font-size: 0.75rem; color: var(--cyan); margin-top: 0.75rem; }
.stat-card__trend--amber { color: var(--amber); }
.stat-card__trend--green { color: var(--green); }
.stat-card__trend--purple { color: var(--purple); }

/* ===== Form ===== */
.form-container { max-width: 800px; margin: 0 auto; }
.rfi-form {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2.5rem; backdrop-filter: blur(10px);
  box-shadow: var(--shadow-glow);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: 0.95rem; transition: var(--transition);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group select { cursor: pointer; }
.form-group select option { background: #0f0f23; }

/* Priority selector */
.priority-selector { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.priority-option { cursor: pointer; }
.priority-option input { display: none; }
.priority-badge {
  display: inline-block; padding: 0.5rem 1.1rem; border-radius: 50px;
  font-size: 0.8rem; font-weight: 600; border: 1px solid var(--border);
  transition: var(--transition); opacity: 0.5;
}
.priority-option input:checked + .priority-badge { opacity: 1; transform: scale(1.05); }
.priority-badge--low { background: rgba(16, 185, 129, 0.1); color: var(--green); border-color: rgba(16, 185, 129, 0.3); }
.priority-badge--medium { background: rgba(0, 240, 255, 0.1); color: var(--cyan); border-color: rgba(0, 240, 255, 0.3); }
.priority-badge--high { background: rgba(245, 158, 11, 0.1); color: var(--amber); border-color: rgba(245, 158, 11, 0.3); }
.priority-badge--critical { background: rgba(239, 68, 68, 0.1); color: var(--red); border-color: rgba(239, 68, 68, 0.3); }

.form-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1rem; }

/* ===== Browse ===== */
.browse-controls { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; align-items: center; }
.search-box {
  flex: 1; min-width: 250px; position: relative; display: flex; align-items: center;
}
.search-box svg { position: absolute; left: 1rem; width: 18px; height: 18px; color: var(--text-muted); }
.search-box input {
  width: 100%; padding: 0.85rem 1rem 0.85rem 3rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.95rem; transition: var(--transition);
}
.search-box input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1); }

.filter-chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chip {
  padding: 0.5rem 1.1rem; border-radius: 50px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-dim); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
}
.chip:hover { color: var(--text); border-color: var(--border-bright); }
.chip--active { background: rgba(0, 240, 255, 0.1); color: var(--cyan); border-color: var(--border-bright); }

/* RFI Cards */
.rfi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.rfi-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; backdrop-filter: blur(10px); transition: var(--transition);
  position: relative; overflow: hidden; cursor: pointer;
}
.rfi-card:hover { border-color: var(--border-bright); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.rfi-card__header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 0.75rem; }
.rfi-card__id { font-family: 'Orbitron', sans-serif; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 1px; }
.rfi-card__status {
  padding: 0.2rem 0.7rem; border-radius: 50px; font-size: 0.7rem; font-weight: 600;
}
.status-pending { background: rgba(245, 158, 11, 0.1); color: var(--amber); }
.status-in-progress { background: rgba(0, 240, 255, 0.1); color: var(--cyan); }
.status-resolved { background: rgba(16, 185, 129, 0.1); color: var(--green); }

.rfi-card__title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; line-height: 1.4; }
.rfi-card__desc { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 1rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rfi-card__meta { display: flex; gap: 1rem; font-size: 0.75rem; color: var(--text-muted); flex-wrap: wrap; }
.rfi-card__meta span { display: flex; align-items: center; gap: 0.3rem; }
.rfi-card__priority { position: absolute; top: 0; left: 0; width: 4px; height: 100%; }
.priority-bar--low { background: var(--green); }
.priority-bar--medium { background: var(--cyan); }
.priority-bar--high { background: var(--amber); }
.priority-bar--critical { background: var(--red); }

.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }

/* ===== Analytics ===== */
.analytics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.chart-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; backdrop-filter: blur(10px); transition: var(--transition);
}
.chart-card:hover { border-color: var(--border-bright); }
.chart-card--wide { grid-column: span 2; }
.chart-card__title { font-size: 0.9rem; font-weight: 600; color: var(--text-dim); margin-bottom: 1.5rem; }

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 0.75rem; }
.bar-row { display: flex; align-items: center; gap: 0.75rem; }
.bar-row__label { font-size: 0.75rem; color: var(--text-dim); width: 100px; text-align: right; flex-shrink: 0; }
.bar-row__track { flex: 1; height: 10px; background: rgba(255, 255, 255, 0.05); border-radius: 5px; overflow: hidden; }
.bar-row__fill { height: 100%; border-radius: 5px; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }
.bar-row__value { font-size: 0.75rem; color: var(--text); font-weight: 600; width: 30px; }

/* Donut chart */
.donut-chart { position: relative; width: 200px; height: 200px; margin: 0 auto 1.5rem; }
.donut-chart__svg { width: 100%; height: 100%; }
.donut-segment { transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1); }
.donut-chart__center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center;
}
.donut-chart__value { display: block; font-family: 'Orbitron', sans-serif; font-size: 2rem; font-weight: 700; }
.donut-chart__label { font-size: 0.75rem; color: var(--text-dim); }
.donut-legend { display: flex; flex-direction: column; gap: 0.5rem; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-dim); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-dot--cyan { background: var(--cyan); }
.legend-dot--amber { background: var(--amber); }
.legend-dot--green { background: var(--green); }

/* Line chart */
.line-chart { width: 100%; }
.line-chart__svg { width: 100%; height: 180px; }
.line-chart__line { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: drawLine 2s ease forwards; }
.line-chart__area { opacity: 0; animation: fadeIn 2.5s ease forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
.line-chart__dots circle { opacity: 0; animation: popIn 0.3s ease forwards; }
.line-chart__dots circle:nth-child(1) { animation-delay: 0.3s; }
.line-chart__dots circle:nth-child(2) { animation-delay: 0.5s; }
.line-chart__dots circle:nth-child(3) { animation-delay: 0.7s; }
.line-chart__dots circle:nth-child(4) { animation-delay: 0.9s; }
.line-chart__dots circle:nth-child(5) { animation-delay: 1.1s; }
.line-chart__dots circle:nth-child(6) { animation-delay: 1.3s; }
.line-chart__dots circle:nth-child(7) { animation-delay: 1.5s; }
@keyframes popIn { to { opacity: 1; } }
.line-chart__labels { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.7rem; color: var(--text-muted); }

/* Metric display */
.metric-display { text-align: center; margin: 1rem 0; }
.metric-display__value { font-family: 'Orbitron', sans-serif; font-size: 2.5rem; font-weight: 700; color: var(--green); }
.metric-display__unit { font-size: 1rem; color: var(--text-dim); font-weight: 400; }
.metric-display__trend { display: block; font-size: 0.8rem; color: var(--green); margin-top: 0.5rem; }
.sparkline { margin-top: 1rem; }
.sparkline svg { width: 100%; height: 60px; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); margin-top: 4rem; padding: 3rem 2rem 2rem; background: rgba(5, 5, 15, 0.5); }
.footer__content { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; }
.footer__logo { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; font-weight: 700; }
.footer__tagline { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.5rem; }
.footer__links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.footer__col h4 { font-size: 0.8rem; font-weight: 600; color: var(--text); margin-bottom: 1rem; }
.footer__col a { display: block; color: var(--text-dim); text-decoration: none; font-size: 0.82rem; margin-bottom: 0.5rem; transition: var(--transition); }
.footer__col a:hover { color: var(--cyan); }
.footer__bottom { max-width: 1280px; margin: 2rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); }
.footer__bottom a { color: var(--cyan); text-decoration: none; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 200;
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem;
  background: rgba(15, 15, 35, 0.95); border: 1px solid var(--border-bright); border-radius: var(--radius-sm);
  backdrop-filter: blur(20px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast__icon {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(16, 185, 129, 0.15); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700;
}
.toast__body { display: flex; flex-direction: column; }
.toast__body strong { font-size: 0.9rem; }
.toast__body span { font-size: 0.78rem; color: var(--text-dim); }

/* ===== Scroll Reveal ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .rfi-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-card--wide { grid-column: span 2; }
}
@media (max-width: 768px) {
  .nav__links, .nav__cta { display: none; }
  .nav__menu { display: block; }
  .section { padding: 5rem 1rem 3rem; }
  .section--hero { padding-top: 6rem; }
  .form-row { grid-template-columns: 1fr; }
  .rfi-form { padding: 1.5rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .rfi-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .chart-card--wide { grid-column: span 1; }
  .footer__content { grid-template-columns: 1fr; }
  .footer__links { grid-template-columns: repeat(2, 1fr); }
  .footer__bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
}
