/* ============================================================
   components.css — Xaevyon Studios
   Top nav, side nav, footer, and reusable UI components
   ============================================================ */

/* ── TOP NAVIGATION ─────────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(7, 8, 13, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.top-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Nav logo */
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo span { color: var(--accent); }

.nav-logo img {
  height: 28px;
  width: auto;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text2);
  text-decoration: none;
  transition: color var(--trans), background var(--trans);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-link.active {
  color: var(--text);
  background: var(--surface2);
}

/* Nav right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text2);
  border-radius: 2px;
  transition: all 0.25s;
}

/* Mobile menu */
.nav-mobile {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 16px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}

.nav-mobile.open { display: flex; }

.nav-mobile .nav-link {
  padding: 11px 14px;
  border-radius: var(--radius-md);
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-right { display: none; }
  .nav-toggle { display: flex; }
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── SIDE NAVIGATION (Dashboard) ────────────────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 64px; /* top nav height */
}

.side-nav {
  position: fixed;
  top: 64px; left: 0;
  width: 240px;
  height: calc(100vh - 64px);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
}

.side-nav-section {
  margin-bottom: 28px;
}

.side-nav-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 10px;
  margin-bottom: 6px;
}

.side-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text2);
  text-decoration: none;
  transition: all var(--trans);
  margin-bottom: 2px;
}

.side-nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.side-nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.side-nav-link svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  opacity: 0.8;
}

.side-nav-link.active svg { opacity: 1; }

/* Side nav bottom (logout etc) */
.side-nav-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Dashboard main content */
.dashboard-main {
  margin-left: 240px;
  flex: 1;
  padding: 36px 40px;
  min-height: calc(100vh - 64px);
}

/* Dashboard mobile */
@media (max-width: 900px) {
  .side-nav {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .side-nav.open {
    transform: translateX(0);
  }

  .dashboard-main {
    margin-left: 0;
    padding: 24px 16px;
  }
}

/* ── DASHBOARD PAGE HEADER ──────────────────────────────────── */
.dash-header {
  margin-bottom: 32px;
}

.dash-title {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 6px;
}

.dash-sub {
  font-size: 0.875rem;
  color: var(--text3);
}

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-hint {
  font-size: 0.78rem;
  color: var(--text3);
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .nav-logo {
  margin-bottom: 12px;
  display: inline-flex;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text3);
  max-width: 240px;
  line-height: 1.7;
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  font-size: 0.85rem;
  color: var(--text3);
  text-decoration: none;
  transition: color var(--trans);
}
.footer-link:hover { color: var(--text2); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text3);
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

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

/* ── SECTION HEADING ────────────────────────────────────────── */
.section-heading {
  margin-bottom: 48px;
}

.section-heading .label {
  margin-bottom: 12px;
  display: block;
}

.section-heading h2 {
  margin-bottom: 14px;
}

.section-heading p {
  max-width: 520px;
}

.section-heading.center {
  text-align: center;
}

.section-heading.center p {
  margin: 0 auto;
}

/* ── FEATURE CARD ───────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color var(--trans), background var(--trans);
}

.feature-card:hover {
  border-color: var(--border2);
  background: var(--surface2);
}

.feature-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 18px; height: 18px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card h4 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text3);
  line-height: 1.65;
}

/* ── PRICING CARD ───────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--accent-border);
  background: var(--surface2);
}

.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 100px;
  white-space: nowrap;
}

.pricing-name {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 12px;
}

.pricing-price {
  font-family: var(--font-display);
  font-size: 3rem;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.pricing-price sup {
  font-size: 1.2rem;
  vertical-align: super;
  font-family: var(--font-body);
  font-weight: 500;
}

.pricing-period {
  font-size: 0.82rem;
  color: var(--text3);
  margin-bottom: 24px;
}

.pricing-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.pricing-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text2);
}

.pricing-feature svg {
  width: 15px; height: 15px;
  stroke: var(--success);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text3);
}

.empty-state svg {
  width: 40px; height: 40px;
  stroke: var(--text3);
  fill: none;
  stroke-width: 1.5;
  margin: 0 auto 16px;
  opacity: 0.5;
}

.empty-state h4 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text2);
  letter-spacing: 0;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text3);
  margin-bottom: 20px;
}

/* ── COPY TO CLIPBOARD ──────────────────────────────────────── */
.copy-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.copy-value {
  flex: 1;
  padding: 10px 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--text2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  padding: 10px 14px;
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text3);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: var(--font-body);
  transition: all var(--trans);
  white-space: nowrap;
}

.copy-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  animation: fadeUp 0.25s ease both;
}

.modal-title {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
  margin-bottom: 8px;
}

.modal-sub {
  font-size: 0.875rem;
  color: var(--text3);
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
