/* =============================================================================
   AIAssetsHub — Main CSS Design System
   Dark-first premium digital marketplace
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  /* Colors */
  --bg:            #080810;
  --surface:       #10101e;
  --surface-2:     #18182e;
  --surface-3:     #20203a;
  --border:        #252540;
  --border-light:  #303055;

  --primary:       #7c3aed;
  --primary-hover: #9333ea;
  --primary-light: rgba(124, 58, 237, 0.15);
  --primary-glow:  rgba(124, 58, 237, 0.3);

  --accent:        #06b6d4;
  --accent-hover:  #0891b2;
  --accent-light:  rgba(6, 182, 212, 0.15);

  --gold:          #f59e0b;
  --gold-light:    rgba(245, 158, 11, 0.15);

  --success:       #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --danger:        #ef4444;
  --danger-light:  rgba(239, 68, 68, 0.15);
  --warning:       #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);

  --text:          #f0f0ff;
  --text-muted:    #8892b0;
  --text-dim:      #5a6380;

  /* Gradients */
  --gradient:         linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  --gradient-reverse: linear-gradient(135deg, #06b6d4 0%, #7c3aed 100%);
  --gradient-hero:    radial-gradient(ellipse at 30% 50%, rgba(124,58,237,0.25) 0%, transparent 60%),
                      radial-gradient(ellipse at 70% 20%, rgba(6,182,212,0.2) 0%, transparent 60%),
                      linear-gradient(180deg, #080810 0%, #0d0d1f 100%);
  --gradient-card:    linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  --gradient-text:    linear-gradient(135deg, #a78bfa 0%, #67e8f9 100%);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow:     0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-xl:  0 16px 64px rgba(0,0,0,0.7);
  --shadow-glow:0 0 40px rgba(124,58,237,0.2);
  --shadow-primary: 0 4px 20px rgba(124,58,237,0.4);

  /* Spacing */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Border radius */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-md:  14px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full:9999px;

  /* Typography */
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'Fira Code', 'Courier New', monospace;

  /* Transitions */
  --transition:     all 0.2s ease;
  --transition-lg:  all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container:      1280px;
  --sidebar-width:  260px;
  --header-height:  70px;
}

/* ─── 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: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: inherit; text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
table { border-collapse: collapse; width: 100%; }

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

/* ─── Selection ───────────────────────────────────────────────────────────── */
::selection { background: var(--primary-light); color: var(--primary-hover); }

/* ─── Container ───────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { color: var(--text-muted); line-height: 1.7; }

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-gold    { color: var(--gold); }

.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.75rem; }
.text-lg  { font-size: 1.125rem; }
.text-xl  { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition-lg);
  white-space: nowrap;
  border: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(124,58,237,0.5);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-light);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
}

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

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

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

.btn-sm  { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-lg  { padding: 1rem 2rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-xl  { padding: 1.125rem 2.5rem; font-size: 1.1rem; border-radius: var(--radius-md); }
.btn-full { width: 100%; }
.btn-icon { padding: 0.6rem; }

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

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

.card:hover {
  border-color: var(--border-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-body { padding: 1.5rem; }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); }

.glass-card {
  background: rgba(16, 16, 30, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
}

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--surface-3);
}

.form-control::placeholder { color: var(--text-dim); }
.form-control:disabled { opacity: 0.5; cursor: not-allowed; }

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.35rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-radius: var(--radius) 0 0 var(--radius);
  flex: 1;
}

.input-group .btn {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary   { background: var(--primary-light);  color: var(--primary-hover); }
.badge-accent    { background: var(--accent-light);   color: var(--accent); }
.badge-success   { background: var(--success-light);  color: var(--success); }
.badge-danger    { background: var(--danger-light);   color: var(--danger); }
.badge-gold      { background: var(--gold-light);     color: var(--gold); }
.badge-new       { background: linear-gradient(135deg, #10b981, #06b6d4); color: #fff; }
.badge-hot       { background: linear-gradient(135deg, #ef4444, #f59e0b); color: #fff; }
.badge-premium   { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; }
.badge-sale      { background: linear-gradient(135deg, #ef4444, #ef4444); color: #fff; }
.badge-best      { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; }

/* ─── Star Rating ─────────────────────────────────────────────────────────── */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--gold);
  font-size: 0.9rem;
}

/* ─── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.alert-danger  { background: var(--danger-light);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.3); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.alert-info    { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(124,58,237,0.3); }

/* ─── Section Titles ──────────────────────────────────────────────────────── */
.section-title {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.section-title h2 {
  margin-bottom: 0.75rem;
}

.section-title p {
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Grid System ─────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2  { grid-template-columns: repeat(2, 1fr); }
.grid-3  { grid-template-columns: repeat(3, 1fr); }
.grid-4  { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.gap-xl { gap: 2rem; }

/* ─── Utilities ───────────────────────────────────────────────────────────── */
.mt-auto { margin-top: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-sm   { margin-bottom: var(--space-sm); }
.mb-md   { margin-bottom: var(--space-md); }
.mb-lg   { margin-bottom: var(--space-lg); }
.mb-xl   { margin-bottom: var(--space-xl); }
.mb-2xl  { margin-bottom: var(--space-2xl); }

.pt-sm   { padding-top: var(--space-sm); }
.py-sm   { padding: var(--space-sm) 0; }
.py-md   { padding: var(--space-md) 0; }
.py-lg   { padding: var(--space-lg) 0; }
.py-xl   { padding: var(--space-xl) 0; }
.py-2xl  { padding: var(--space-2xl) 0; }
.py-3xl  { padding: var(--space-3xl) 0; }
.py-4xl  { padding: var(--space-4xl) 0; }

.hidden  { display: none !important; }
.w-full  { width: 100%; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xl) 0;
}

.section {
  padding: var(--space-4xl) 0;
}

.section-sm {
  padding: var(--space-2xl) 0;
}

/* ─── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
}

.pagination a:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.pagination .active {
  background: var(--gradient);
  color: #fff;
  border-color: var(--primary);
}

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

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

.table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.table td {
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: var(--surface-2);
}

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

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Loading spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Toast / Notifications ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--text);
  animation: toast-in 0.3s ease;
  transform-origin: bottom right;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--primary); }

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ─── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: var(--transition-lg);
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; justify-content: flex-end; }

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.modal-close:hover { background: var(--surface-3); }

/* ─── Page header ─────────────────────────────────────────────────────────── */
.page-header {
  padding: var(--space-2xl) 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, transparent 100%);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span    { color: var(--text-dim); }

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 { margin-bottom: 0.5rem; }
.empty-state p  { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ─── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(124,58,237,0.2); }
  50%       { box-shadow: 0 0 40px rgba(124,58,237,0.5); }
}

.animate-in { animation: fadeIn 0.4s ease forwards; }

/* ─── Glow orbs (hero decorations) ───────────────────────────────────────── */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.glow-orb-primary { background: rgba(124, 58, 237, 0.25); }
.glow-orb-accent  { background: rgba(6, 182, 212, 0.2); }

/* ─── Responsive helpers ──────────────────────────────────────────────────── */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .btn-xl { padding: 0.875rem 1.75rem; }
}
