/* ============================================
   AI HUB - Design System & Styles
   Premium Dark Theme with Glassmorphism
   ============================================ */

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

/* ---- CSS Variables (Design Tokens) ---- */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-strong: rgba(255, 255, 255, 0.1);

  --accent-primary: #6c5ce7;
  --accent-secondary: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #74b9ff 100%);
  --accent-gradient-hot: linear-gradient(135deg, #fd79a8 0%, #e17055 50%, #fdcb6e 100%);
  --accent-gradient-cool: linear-gradient(135deg, #00cec9 0%, #0984e3 50%, #6c5ce7 100%);

  --text-primary: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.6);
  --text-muted: rgba(240, 240, 245, 0.35);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-active: rgba(108, 92, 231, 0.4);

  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #ff6b6b;
  --info: #74b9ff;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-y: scroll; /* Forzamos el scroll vertical siempre activo para evitar saltos */
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

img, video {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---- Layout ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-base);
  position: relative;
  min-width: 0; /* Permite que flex-item se encoja correctamente */
  overflow-x: hidden; /* Evita desbordamientos laterales del contenido */
  display: flex;
  flex-direction: column;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition-base);
  overflow: hidden;
}

.sidebar-header {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 72px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--space-md) var(--space-sm) var(--space-sm);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent-secondary);
}

.nav-item.active .nav-icon {
  color: var(--accent-primary);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-primary);
  color: white;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient-cool);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-info {
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--accent-secondary);
  font-weight: 500;
}

/* ---- Top Bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: var(--space-md) var(--space-xl);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  width: 100%; /* Asegura que ocupe todo el ancho disponible */
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: var(--space-sm) var(--space-md);
  gap: var(--space-sm);
  width: 320px;
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--accent-primary);
  background: var(--bg-glass-strong);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 100%;
  font-family: var(--font-primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--transition-fast);
  position: relative;
}

.topbar-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.topbar-btn .notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

/* ---- Page Content ---- */
.page-content {
  padding: var(--space-xl);
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card:nth-child(1)::before { background: var(--accent-gradient); }
.stat-card:nth-child(2)::before { background: var(--accent-gradient-hot); }
.stat-card:nth-child(3)::before { background: var(--accent-gradient-cool); }
.stat-card:nth-child(4)::before { background: linear-gradient(135deg, #00b894, #55efc4); }

.stat-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-card:nth-child(1) .stat-icon { background: rgba(108, 92, 231, 0.15); color: var(--accent-secondary); }
.stat-card:nth-child(2) .stat-icon { background: rgba(253, 121, 168, 0.15); color: #fd79a8; }
.stat-card:nth-child(3) .stat-icon { background: rgba(0, 206, 201, 0.15); color: #00cec9; }
.stat-card:nth-child(4) .stat-icon { background: rgba(0, 184, 148, 0.15); color: #00b894; }

.stat-trend {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.stat-trend.up {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---- Section Headers ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
  max-width: 100%;
  flex-wrap: wrap; /* Permite que el título y las flechas se reorganicen si no hay espacio */
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1; /* El título ocupa el espacio restante */
  min-width: 200px;
}

.section-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 40px var(--accent-glow);
}

.btn-ghost {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ---- Content Row (Netflix style) ---- */
.content-row {
  margin-bottom: var(--space-xl);
}

.content-scroll {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-md);
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.content-scroll::-webkit-scrollbar {
  display: none;
}

/* ---- Resource Card ---- */
.resource-card {
  flex: 0 0 calc(25% - var(--space-md) + (var(--space-md) / 4)); /* Ajuste para que quepan 4 tarjetas con el gap */
  min-width: 250px; /* Ancho mínimo para que no se vean mal en pantallas muy pequeñas */
  max-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  scroll-snap-align: start;
  cursor: pointer;
  position: relative;
}

.resource-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-active);
}

.card-thumbnail {
  position: relative;
  width: 100%;
  height: 158px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.card-thumbnail video,
.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-thumbnail .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.resource-card:hover .play-overlay {
  opacity: 1;
}

.play-btn {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: transform var(--transition-fast);
}

.resource-card:hover .play-btn {
  transform: scale(1.1);
}

.card-type-badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
}

.badge-prompt { background: rgba(108, 92, 231, 0.7); color: #e8e5ff; }
.badge-idea { background: rgba(253, 203, 110, 0.7); color: #3d3214; }
.badge-app { background: rgba(0, 206, 201, 0.7); color: #003d3b; }
.badge-demo { background: rgba(253, 121, 168, 0.7); color: #3d0f1f; }
.badge-recurso { background: rgba(116, 185, 255, 0.7); color: #0c2942; }

.card-duration {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.75);
  padding: 2px 6px;
  border-radius: 4px;
}

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

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.card-author-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: white;
}

.card-stats {
  display: flex;
  gap: var(--space-md);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-stats span {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ---- Resource Grid ---- */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--space-lg);
}

.resource-grid .resource-card {
  min-width: auto;
  max-width: none;
}

/* ---- Filter Tabs ---- */
.filter-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filter-tab {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.filter-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

/* ---- TikTok Feed ---- */
.tiktok-container {
  position: relative;
  height: calc(100vh - 72px);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tiktok-container::-webkit-scrollbar {
  display: none;
}

.tiktok-slide {
  height: calc(100vh - 72px);
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.tiktok-slide video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tiktok-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    transparent 40%,
    transparent 70%,
    rgba(0, 0, 0, 0.3) 100%
  );
  pointer-events: none;
}

.tiktok-info {
  position: absolute;
  bottom: var(--space-xl);
  left: var(--space-xl);
  right: 80px;
  z-index: 10;
}

.tiktok-type {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
  background: rgba(108, 92, 231, 0.7);
  backdrop-filter: blur(8px);
}

.tiktok-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.tiktok-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: var(--space-md);
  max-width: 450px;
}

.tiktok-author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 500;
}

.tiktok-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.tiktok-actions {
  position: absolute;
  right: var(--space-lg);
  bottom: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  z-index: 10;
}

.tiktok-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.9);
  font-size: 0.68rem;
  transition: transform var(--transition-fast);
}

.tiktok-action-btn:hover {
  transform: scale(1.15);
}

.tiktok-action-btn .icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.tiktok-action-btn.liked .icon {
  background: rgba(253, 121, 168, 0.3);
  color: #fd79a8;
}

.tiktok-progress {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-md);
  right: var(--space-md);
  display: flex;
  gap: 4px;
  z-index: 10;
}

.tiktok-progress-dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
}

.tiktok-progress-dot.active {
  background: white;
}

/* ---- Modal / Detail View ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

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

.modal {
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

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

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-lg);
}

/* ---- Hero Banner ---- */
.hero-banner {
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: 100%;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
  line-height: 1.1;
}

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

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ---- Tags ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  margin-right: 4px;
  margin-bottom: 4px;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-state .emoji {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

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

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

/* ---- Animations ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

.animate-in {
  animation: fadeInUp 0.5s ease-out forwards;
}

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

/* ---- Page Transitions ---- */
.page {
  display: none;
  opacity: 0;
}

.page.active {
  display: block;
  animation: fadeIn var(--transition-base) ease-out forwards;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .resource-card {
    min-width: 240px;
    max-width: 240px;
  }

  .topbar {
    padding: var(--space-md);
  }

  .page-content {
    padding: var(--space-lg);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .search-box {
    width: 180px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-banner {
    padding: var(--space-xl) var(--space-lg);
  }

  .resource-card {
    min-width: 220px;
    max-width: 220px;
  }

  .topbar-title {
    display: none;
  }
}

@media (max-width: 480px) {
  .search-box {
    width: 140px;
  }

  .resource-card {
    min-width: 200px;
    max-width: 200px;
  }

  .tiktok-title {
    font-size: 1.1rem;
  }

  .tiktok-info {
    left: var(--space-md);
    bottom: var(--space-lg);
  }
}

/* ---- Hamburger ---- */
.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
}

/* ---- Sidebar Overlay (mobile) ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
}

.sidebar-overlay.active {
  display: block;
}

/* ---- Ranking / Leaderboard ---- */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.ranking-item:hover {
  background: var(--bg-card-hover);
}

.ranking-position {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.ranking-position.gold { background: linear-gradient(135deg, #fdcb6e, #e17055); color: #2d1b06; }
.ranking-position.silver { background: linear-gradient(135deg, #b2bec3, #636e72); color: #1a1a1a; }
.ranking-position.bronze { background: linear-gradient(135deg, #e17055, #d63031); color: #1a0a08; }
.ranking-position.default { background: var(--bg-glass); color: var(--text-muted); }

.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ranking-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-secondary);
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.85rem;
  min-width: 280px;
  animation: fadeInUp var(--transition-base) ease-out;
  backdrop-filter: blur(20px);
}

.toast-icon {
  font-size: 1.2rem;
}

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