/* ============================================================
   main.css — Xaevyon Studios
   Global styles, CSS variables, reset, typography
   ============================================================ */

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

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  /* Colours */
  --bg:           #07060D;
  --bg2:          #0C0A16;
  --bg3:          #110F1E;
  --surface:      #161228;
  --surface2:     #1C1732;
  --surface3:     #231D3F;

  --accent:       #A855F7;
  --accent-hover: #C084FC;
  --accent-dim:   rgba(168, 85, 247, 0.1);
  --accent-border:rgba(168, 85, 247, 0.25);

  --purple:       #7C3AED;
  --purple-dim:   rgba(124, 58, 237, 0.15);
  --purple-border:rgba(124, 58, 237, 0.3);

  --blue:         #6366F1;
  --blue-dim:     rgba(99, 102, 241, 0.15);

  --text:         #E8EDF5;
  --text2:        #A0AABB;
  --text3:        #5A6478;

  --border:       rgba(255, 255, 255, 0.07);
  --border2:      rgba(255, 255, 255, 0.12);

  --error:        #FC8181;
  --error-bg:     rgba(252, 129, 129, 0.08);
  --error-border: rgba(252, 129, 129, 0.2);

  --success:      #68D391;
  --success-bg:   rgba(104, 211, 145, 0.08);
  --success-border:rgba(104, 211, 145, 0.2);

  --warning:      #F6AD55;
  --warning-bg:   rgba(246, 173, 85, 0.08);
  --warning-border:rgba(246, 173, 85, 0.2);

  /* Typography */
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Outfit', sans-serif;

  /* Spacing */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Transitions */
  --trans: 0.2s ease;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ── GRID BACKGROUND ─────────────────────────────────────────── */
.grid-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.8rem); }
h4 { font-size: 1.2rem; }

p {
  font-size: 0.95rem;
  color: var(--text2);
  line-height: 1.75;
}

.label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text3);
}

.accent-text { color: var(--accent); }
.purple-text { color: var(--purple); }
.muted-text  { color: var(--text2); }
.error-text  { color: var(--error); }
.success-text{ color: var(--success); }

/* ── LAYOUT HELPERS ─────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-wrap {
  position: relative;
  z-index: 1;
  padding-top: 80px; /* top nav height */
}

.section {
  padding: 80px 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

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

/* ── DIVIDERS ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

.divider-accent {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 32px 0;
}

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-accent  { background: var(--accent-dim);   border: 1px solid var(--accent-border);  color: var(--accent); }
.badge-purple  { background: var(--purple-dim);   border: 1px solid var(--purple-border);  color: var(--purple); }
.badge-success { background: var(--success-bg);   border: 1px solid var(--success-border); color: var(--success); }
.badge-error   { background: var(--error-bg);     border: 1px solid var(--error-border);   color: var(--error); }
.badge-warning { background: var(--warning-bg);   border: 1px solid var(--warning-border); color: var(--warning); }

.badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 20px;
}
.alert.show        { display: block; }
.alert.alert-error   { background: var(--error-bg);   border: 1px solid var(--error-border);   color: var(--error); }
.alert.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }
.alert.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); }
.alert.alert-info    { background: var(--accent-dim); border: 1px solid var(--accent-border);  color: var(--accent); }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-hover {
  transition: border-color var(--trans), background var(--trans), transform var(--trans);
}
.card-hover:hover {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateY(-2px);
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  letter-spacing: 0.03em;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 200, 255, 0.2);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface3);
  border-color: var(--border2);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border2);
  background: var(--surface);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(252, 129, 129, 0.15);
}

.btn-sm  { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; }
.btn-full{ width: 100%; }

/* ── SPINNER ────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.btn-primary .spinner {
  border-color: rgba(7,8,13,0.2);
  border-top-color: var(--bg);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FORM ELEMENTS ──────────────────────────────────────────── */
.form-field { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--trans), background var(--trans);
}
.form-input:focus {
  border-color: rgba(0,200,255,0.4);
  background: var(--accent-dim);
}
.form-input::placeholder { color: var(--text3); }
.form-input.error { border-color: var(--error-border); }

.form-hint {
  font-size: 0.78rem;
  color: var(--text3);
  margin-top: 6px;
  line-height: 1.5;
}

/* ── TABLES ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
}

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

tbody tr:hover td {
  background: var(--surface);
  color: var(--text);
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim-fade-up { animation: fadeUp 0.5s ease both; }
.anim-fade-up-2 { animation: fadeUp 0.5s 0.1s ease both; }
.anim-fade-up-3 { animation: fadeUp 0.5s 0.2s ease both; }
.anim-fade-up-4 { animation: fadeUp 0.5s 0.3s ease both; }

/* ── UTILITY ────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container, .container-sm { padding: 0 16px; }
  .section { padding: 56px 0; }
  .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
