/* ============================================================
   VoxPact Base Styles
   Reset + typography + global utilities + shared components
   ============================================================ */

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

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

body {
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* --- Selection --- */
::selection { background: var(--blue-dim); color: var(--blue-neon); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { color: var(--muted); line-height: 1.7; }
small { font-size: var(--text-sm); color: var(--dim); }
code { font-family: var(--font-mono); font-size: 0.875em; }

/* --- Gradient text utility --- */
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.grad-text-hero {
  background: linear-gradient(90deg, #60a5fa 0%, #06b6d4 40%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Container --- */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* --- Section --- */
.section {
  padding: var(--space-24) 0;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--blue);
  display: block;
}

.section-title {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-4xl));
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 600px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-glow-sm);
}

.btn-primary:hover {
  background: var(--blue-neon);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue-neon);
  background: var(--blue-dim);
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
}

.btn-outline:hover {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-glow-sm);
}

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-success:hover { background: #16a34a; }

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover { background: #dc2626; }

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-md);
  border-radius: var(--radius-lg);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-active   { background: var(--green-dim);  color: var(--green); }
.badge-pending  { background: var(--yellow-dim); color: var(--yellow); }
.badge-error    { background: var(--red-dim);    color: var(--red); }
.badge-info     { background: var(--blue-dim);   color: var(--blue-neon); }
.badge-purple   { background: var(--purple-dim); color: var(--purple); }
.badge-suspended { background: var(--red-dim);   color: var(--red); }
.badge-banned   { background: rgba(100,0,0,0.2); color: #ff6b6b; }
.badge-completed { background: var(--blue-dim);  color: var(--blue-neon); }

.badge-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* --- Cards --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

.card-glow {
  position: relative;
}

.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-lg) + 1px);
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity var(--transition-slow);
  z-index: -1;
}

.card-glow:hover::before {
  opacity: 0.3;
}

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.card-header h3, .card-header h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: var(--space-5);
}

/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
}

thead th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-dim);
  color: var(--text);
  vertical-align: middle;
}

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

tbody tr:hover td { background: rgba(30, 58, 95, 0.2); }

/* --- Forms --- */
.form-group { margin-bottom: var(--space-5); }

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--text-base);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--dim);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  font-size: var(--text-sm);
  color: var(--red);
  margin-top: var(--space-2);
}

/* --- Divider --- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

/* --- Stats grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color var(--transition);
}

.stat-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--dim);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-change {
  font-size: var(--text-sm);
  color: var(--green);
  margin-top: var(--space-2);
}

/* --- Loading skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-raised) 25%, var(--bg-surface) 50%, var(--bg-raised) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--dim);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state h3 {
  font-size: var(--text-xl);
  color: var(--muted);
  margin-bottom: var(--space-2);
}

/* --- Glow border utility --- */
.glow-border {
  border: 1px solid var(--border-glow) !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

/* --- Animations --- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(59, 130, 246, 0.3); }
  50%       { box-shadow: 0 0 24px rgba(59, 130, 246, 0.7); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Entrance animation utility --- */
.anim-fadeInUp {
  animation: fadeInUp 0.6s ease both;
}

.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .container { padding: 0 var(--space-4); }
  .section { padding: var(--space-16) 0; }
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
}
