/* ============================================================
   ANIMOTION — Showcase Website Styles
   A CSS3 Animation & Icons Framework
   By Bachao.AI — Open Source, MIT License
   ============================================================ */

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

:root {
  /* Theme - Light Mode (default) */
  --bg: #f5f7fa;
  --bg2: #eef0f5;
  --surface: #ffffff;
  --surface2: #f8f9fc;
  --surface3: #f0f1f5;
  --border: #d8dae5;
  --border2: #c5c8d8;
  --text: #1a1a2e;
  --text2: #4a4a68;
  --text3: #7a7a98;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.12);
  --accent2: #06b6d4;
  --accent3: #f59e0b;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-full: 9999px;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --header-h: 64px;
  --sidebar-w: 260px;
  --grid-line-color: rgba(99, 102, 241, 0.06);
  --header-bg: rgba(245, 247, 250, 0.88);
  --card-preview-bg: #f0f1f6;
  --code-bg: #f5f6fa;
  --checkerboard-color: rgba(0,0,0,0.04);
  --demo-gradient: linear-gradient(135deg, #6366f1, #06b6d4);
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --surface: #1a1a25;
  --surface2: #22222f;
  --surface3: #2a2a38;
  --border: #2a2a3a;
  --border2: #3a3a4d;
  --text: #e8e8f0;
  --text2: #a0a0b8;
  --text3: #6a6a80;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --grid-line-color: rgba(99, 102, 241, 0.03);
  --header-bg: rgba(10, 10, 15, 0.85);
  --card-preview-bg: #0f0f18;
  --code-bg: #0f0f18;
  --checkerboard-color: rgba(255,255,255,0.03);
  --demo-gradient: linear-gradient(135deg, #818cf8, #22d3ee);
}

/* Category Colors */
:root {
  --cat-entrance: #3b82f6;
  --cat-exit: #94a3b8;
  --cat-attention: #f59e0b;
  --cat-text: #8b5cf6;
  --cat-background: #10b981;
  --cat-button: #ef4444;
  --cat-card: #06b6d4;
  --cat-loader: #6366f1;
  --cat-navigation: #f97316;
  --cat-form: #ec4899;
  --cat-transform3d: #14b8a6;
  --cat-filter: #a855f7;
  --cat-micro: #84cc16;
  --cat-scroll: #0ea5e9;
  --cat-creative: #e879f9;
  --cat-fintech: #fbbf24;
  --cat-gaming: #4ade80;
  --cat-ecommerce: #f472b6;
  --cat-social: #38bdf8;
  --cat-dashboard: #a78bfa;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Subtle grid background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-color) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ── HEADER ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

[data-theme="dark"] .header-title {
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-badge {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Search */
.header-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.header-search input {
  width: 100%;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px 0 40px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-search input::placeholder { color: var(--text3); }

.header-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}

.header-search .shortcut-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text3);
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-family: var(--mono);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  height: 36px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.header-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface2);
}

.header-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── LAYOUT ── */
.app-layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 50;
  padding: 16px 0;
  transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section {
  padding: 0 16px;
  margin-bottom: 24px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text3);
  padding: 0 8px;
  margin-bottom: 8px;
}

/* Category nav items */
.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  color: var(--text2);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.cat-item:hover {
  background: var(--surface);
  color: var(--text);
}

.cat-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text3);
  font-family: var(--mono);
}

/* Sidebar stats */
.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

[data-theme="dark"] .stat-value {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-title {
  font-size: 22px;
  font-weight: 700;
}

.toolbar-count {
  font-size: 13px;
  color: var(--text3);
  font-family: var(--mono);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* View toggle */
.view-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-btn {
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition);
}

.view-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Tag filter pills */
.tag-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tag-pill {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.tag-pill:hover, .tag-pill.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── ANIMATION GRID ── */
.anim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.anim-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.anim-grid.list {
  grid-template-columns: 1fr;
  gap: 8px;
}

/* ── ANIMATION CARD ── */
.anim-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.anim-card:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.anim-card-preview {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-preview-bg);
  position: relative;
  overflow: hidden;
}

/* Checkerboard for transparent demos */
.anim-card-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, var(--checkerboard-color) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checkerboard-color) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checkerboard-color) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checkerboard-color) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  opacity: 0.5;
}

/* Demo elements */
.demo-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--demo-gradient);
  position: relative;
  z-index: 1;
}

.demo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.demo-button {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  position: relative;
  z-index: 1;
  font-family: var(--font);
}

.demo-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  border-top-color: transparent;
  position: relative;
  z-index: 1;
}

.demo-dots {
  display: flex;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.demo-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.demo-bars {
  display: flex;
  gap: 4px;
  align-items: end;
  height: 40px;
  position: relative;
  z-index: 1;
}

.demo-bars span {
  width: 6px;
  background: var(--accent);
  border-radius: 3px;
}

.demo-card {
  width: 80px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.demo-background {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.demo-nav {
  display: flex;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.demo-nav span {
  font-size: 12px;
  color: var(--text2);
  padding: 4px 0;
  position: relative;
}

.demo-input {
  width: 120px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.demo-image {
  width: 64px;
  height: 48px;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, #667eea, #764ba2);
  position: relative;
  z-index: 1;
}

/* Replay button */
.anim-card-replay {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 5;
}

.anim-card:hover .anim-card-replay { opacity: 1; }

/* Card info */
.anim-card-info {
  padding: 12px 16px;
}

.anim-card-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.anim-card-category {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.anim-card-desc {
  font-size: 12px;
  color: var(--text3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.anim-card-tags {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.anim-card-tag {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--mono);
}

/* List view card */
.anim-grid.list .anim-card {
  display: flex;
  flex-direction: row;
}

.anim-grid.list .anim-card-preview {
  width: 120px;
  height: 80px;
  flex-shrink: 0;
}

.anim-grid.list .anim-card-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

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

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

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

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

/* Modal preview */
.modal-preview {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-preview-bg);
  position: relative;
  border-bottom: 1px solid var(--border);
}

.modal-preview .demo-box {
  width: 64px;
  height: 64px;
}

.modal-preview .demo-text {
  font-size: 28px;
}

.modal-replay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.modal-replay:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Modal tabs */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.modal-tab {
  flex: 1;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-family: var(--font);
}

.modal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.modal-tab:hover {
  color: var(--text);
}

/* Code block */
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
}

.code-block {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.code-block-label {
  font-size: 11px;
  color: var(--text3);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-btn {
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text2);
  font-size: 11px;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

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

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  tab-size: 2;
}

.code-block pre code {
  font-family: inherit;
}

/* Modal meta info */
.modal-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.meta-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text2);
  background: var(--surface2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.meta-chip strong {
  color: var(--text);
  font-weight: 600;
}

/* ── PNG ANIMATOR ── */
.png-animator {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  display: none;
}

.png-animator.active { display: block; }

.png-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.png-upload-zone:hover,
.png-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.png-upload-zone svg {
  width: 48px;
  height: 48px;
  color: var(--text3);
  margin-bottom: 12px;
}

.png-upload-zone p {
  color: var(--text2);
  font-size: 14px;
}

.png-upload-zone small {
  color: var(--text3);
  font-size: 12px;
}

.png-controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.png-controls select,
.png-controls input {
  height: 40px;
  padding: 0 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
}

.png-controls select:focus,
.png-controls input:focus {
  border-color: var(--accent);
}

.png-preview {
  width: 100%;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-preview-bg);
  border-radius: var(--radius);
  margin-top: 16px;
  overflow: hidden;
  position: relative;
}

.png-preview img {
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
}

/* ── ICONS TAB ── */
.icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.icon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.icon-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.icon-card svg {
  width: 32px;
  height: 32px;
  color: var(--text);
  margin-bottom: 8px;
}

.icon-card-name {
  font-size: 10px;
  color: var(--text3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── TABS (Animations / Icons / PNG Animator) ── */
.main-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}

.main-tab {
  flex: 1;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-family: var(--font);
}

.main-tab:hover { color: var(--text); }

.main-tab.active {
  background: var(--accent);
  color: #fff;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

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

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text2);
}

/* ── SCROLL TO TOP ── */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.3s ease;
  z-index: 50;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── TOAST NOTIFICATIONS ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
}

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

/* ── MOBILE SIDEBAR TOGGLE ── */
.sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

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

  .sidebar-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0 16px;
  }

  .header-badge, .header-btn span {
    display: none;
  }

  .main-content {
    padding: 16px;
  }

  .anim-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }

  .modal {
    max-height: 95vh;
    border-radius: 12px;
  }

  .modal-overlay {
    padding: 12px;
  }
}

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

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── THEME TRANSITION ── */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* ── LOADING SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ── FOOTER ── */
.footer {
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  color: var(--text3);
  font-size: 13px;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover { text-decoration: underline; }
