/* ============================================================
   COGNICRAFT MARKETPLACE 3D — CSS
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-1: #0a0118;
  --bg-2: #1a0b2e;
  --primary: #a855f7;
  --primary-2: #ec4899;
  --accent: #06b6d4;
  --text: #f0e5ff;
  --text-muted: #a78bfa;
  --card-bg: rgba(30, 15, 60, 0.6);
  --border: rgba(168, 85, 247, 0.25);
  --glow: rgba(168, 85, 247, 0.6);
}

html, body {
  background: var(--bg-1);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background: radial-gradient(ellipse at top, #1a0b2e 0%, #0a0118 60%);
}

/* ============================================================
   CANVAS BACKGROUND
   ============================================================ */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Noise overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.03;
  mix-blend-mode: overlay;
}

/* ============================================================
   CURSOR GLOW
   ============================================================ */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease-out;
  mix-blend-mode: screen;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.mk-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px);
  background: rgba(10, 1, 24, 0.6);
  border-bottom: 1px solid var(--border);
}

.mk-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff, #a855f7, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: logo-shine 6s ease-in-out infinite;
  background-size: 200% 100%;
}

@keyframes logo-shine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.mk-logo .icon {
  font-size: 24px;
  -webkit-text-fill-color: initial;
}

.mk-nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.mk-nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
  position: relative;
}

.mk-nav-links a:hover {
  color: var(--primary);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.mk-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 5;
  padding: 100px 20px 60px;
  perspective: 1200px;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  transform-style: preserve-3d;
  transition: transform 0.3s ease-out;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.hero-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px #22c55e;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, #a855f7 40%, #ec4899 70%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-move 4s linear infinite;
  text-shadow: 0 0 80px rgba(168, 85, 247, 0.4);
}

@keyframes gradient-move {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.6;
}

.hero-cta {
  display: inline-flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-hero {
  padding: 16px 32px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
}

.btn-hero.primary {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #fff;
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.4);
}

.btn-hero.primary:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 60px rgba(168, 85, 247, 0.6);
}

.btn-hero.secondary {
  background: rgba(168, 85, 247, 0.1);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.btn-hero.secondary:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: var(--primary);
}

/* Hero 3D floating cards */
.hero-cards-3d {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.hero-float-card {
  position: absolute;
  width: 240px;
  height: 160px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.1));
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  padding: 20px;
  animation: float-3d 8s ease-in-out infinite;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.hero-float-card.c1 { top: 15%; left: 8%; animation-delay: 0s; }
.hero-float-card.c2 { top: 60%; right: 10%; animation-delay: -2s; width: 200px; height: 140px; }
.hero-float-card.c3 { bottom: 15%; left: 15%; animation-delay: -4s; width: 180px; height: 120px; }

@keyframes float-3d {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-30px) rotate(2deg); }
}

.hero-float-card .mini-bar {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #a855f7, transparent);
  margin-bottom: 10px;
}

.hero-float-card .mini-bar:nth-child(2) { width: 70%; background: linear-gradient(90deg, #ec4899, transparent); }
.hero-float-card .mini-bar:nth-child(3) { width: 50%; background: linear-gradient(90deg, #06b6d4, transparent); }

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: bounce-down 2s infinite;
}

@keyframes bounce-down {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

.scroll-indicator .arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg);
}

/* ============================================================
   FILTER BAR (sticky)
   ============================================================ */
.mk-filter-bar {
  position: sticky;
  top: 70px;
  z-index: 50;
  padding: 20px 40px;
  background: rgba(10, 1, 24, 0.85);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.mk-search {
  flex: 1;
  min-width: 240px;
  max-width: 500px;
  padding: 12px 20px;
  background: rgba(30, 15, 60, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.mk-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15);
}

.mk-search::placeholder { color: var(--text-muted); }

.mk-select {
  padding: 12px 16px;
  background: rgba(30, 15, 60, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.mk-select:focus { border-color: var(--primary); }

.tag-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 40px 20px;
}

.tag-chip {
  padding: 6px 14px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.tag-chip:hover, .tag-chip.active {
  background: rgba(168, 85, 247, 0.3);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.mk-section {
  padding: 60px 40px;
  position: relative;
  z-index: 5;
}

.mk-section-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.5px;
}

.mk-section-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

/* ============================================================
   FEATURED CAROUSEL (3D)
   ============================================================ */
.featured-3d {
  position: relative;
  height: 420px;
  perspective: 1400px;
  overflow: hidden;
  margin-bottom: 60px;
}
.featured-3d.grid-mode {
  height: auto !important;
  min-height: 380px;
  perspective: none;
  overflow: visible;
  padding: 20px 0 40px;
  margin-bottom: 40px;
}
.carousel-stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-item {
  position: absolute;
  width: 360px;
  height: 380px;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.1));
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.carousel-item.center {
  z-index: 10;
  transform: translateZ(60px) scale(1.05);
  box-shadow: 0 30px 80px rgba(168, 85, 247, 0.5);
  border-color: var(--primary);
}

.carousel-item.left { transform: translateX(-280px) translateZ(-100px) rotateY(35deg) scale(0.85); opacity: 0.7; }
.carousel-item.right { transform: translateX(280px) translateZ(-100px) rotateY(-35deg) scale(0.85); opacity: 0.7; }
.carousel-item.hidden { transform: translateZ(-400px) scale(0.5); opacity: 0; pointer-events: none; }

.carousel-item .preview {
  height: 65%;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: #1a0b2e;
}

.carousel-item .preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 1, 24, 0.95) 100%);
}

.carousel-item .info {
  padding: 16px 20px;
  height: 35%;
}

.carousel-item .name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
  color: #fff;
}

.carousel-item .author {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.carousel-item .stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   THEME GRID
   ============================================================ */
.mk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.theme-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s;
  transform-style: preserve-3d;
  will-change: transform;
  min-height: 340px;
  display: flex;
  flex-direction: column;
}

.theme-card:hover {
  box-shadow: 0 30px 80px rgba(168, 85, 247, 0.4);
  border-color: var(--primary);
}

.theme-card .card-glow {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(168, 85, 247, 0.25), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 2;
}

.theme-card:hover .card-glow { opacity: 1; }

.theme-preview {
  height: 200px;
  background: linear-gradient(135deg, #1a0b2e, #2d1b4e);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-preview .mock-ui {
  width: 85%;
  padding: 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  transform: scale(0.95);
  transition: transform 0.3s;
}

.theme-card:hover .theme-preview .mock-ui {
  transform: scale(1);
}

.mock-ui .mock-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  margin-bottom: 8px;
}

.mock-ui .mock-bar.w80 { width: 80%; }
.mock-ui .mock-bar.w60 { width: 60%; }
.mock-ui .mock-bar.w40 { width: 40%; }

.mock-ui .mock-dots {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.mock-ui .mock-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.4);
}

.theme-card .card-info {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 3;
}

.theme-card .card-name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.theme-card .card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.card-author img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--primary);
}

.card-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.card-stats .stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Featured badge */
.theme-card.featured::before {
  content: '⭐ FEATURED';
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  border-radius: 6px;
  z-index: 4;
  letter-spacing: 0.5px;
}

.theme-card.verified::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, #06b6d4, #22c55e);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  z-index: 4;
}

/* ============================================================
   MODAL
   ============================================================ */
.mk-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.mk-modal.open { display: flex; }

.mk-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 1, 15, 0.85);
  backdrop-filter: blur(20px);
  animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mk-modal-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  background: linear-gradient(135deg, rgba(30, 15, 60, 0.95), rgba(20, 8, 45, 0.95));
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  animation: modal-zoom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 40px 100px rgba(168, 85, 247, 0.3);
}

@keyframes modal-zoom {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-preview {
  position: relative;
  background: #0a0118;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 500px;
}

.modal-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-info {
  padding: 32px;
  overflow-y: auto;
  max-height: 90vh;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(236, 72, 153, 0.4);
  transform: rotate(90deg);
}

.modal-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.modal-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-author img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

.modal-author .name {
  font-weight: 700;
  font-size: 14px;
}

.modal-author .role {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.modal-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.modal-tag {
  padding: 5px 12px;
  background: rgba(168, 85, 247, 0.15);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.modal-stat {
  padding: 14px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.modal-stat .num {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

.modal-stat .label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.btn-modal {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-modal.primary {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #fff;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4);
}

.btn-modal.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(168, 85, 247, 0.6);
}

.btn-modal.secondary {
  background: rgba(168, 85, 247, 0.15);
  color: #fff;
  border: 1px solid var(--border);
}

.btn-modal.secondary:hover {
  background: rgba(168, 85, 247, 0.3);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  top: 90px;
  right: 30px;
  padding: 16px 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  z-index: 10000;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.success { background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.9)); }
.toast.error   { background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9)); }
.toast.info    { background: linear-gradient(135deg, rgba(168, 85, 247, 0.9), rgba(236, 72, 153, 0.9)); }

/* ============================================================
   EMPTY / LOADING
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.skeleton {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.1) 0%, rgba(168, 85, 247, 0.25) 50%, rgba(168, 85, 247, 0.1) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .mk-modal-content { grid-template-columns: 1fr; }
  .modal-preview { min-height: 300px; }
  .mk-nav { padding: 12px 20px; }
  .mk-section { padding: 40px 20px; }
  .mk-filter-bar { padding: 16px 20px; }
  .tag-chips { padding: 0 20px 16px; }
  .hero-float-card { display: none; }
  .featured-3d { height: 340px; }
  .carousel-item { width: 260px; height: 320px; }
  .carousel-item.left { transform: translateX(-180px) translateZ(-100px) rotateY(35deg) scale(0.75); }
  .carousel-item.right { transform: translateX(180px) translateZ(-100px) rotateY(-35deg) scale(0.75); }
}
/* ============================================================
   DELETE BUTTON trong Modal
   ============================================================ */
.modal-delete-btn {
  flex: 0 0 auto;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(200, 30, 30, 0.15);
  border: 1px solid rgba(200, 30, 30, 0.4);
  color: #ff6060;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-delete-btn:hover {
  background: rgba(200, 30, 30, 0.4);
  color: #fff;
  border-color: #ff4040;
  transform: scale(1.05);
}

.modal-delete-btn:active {
  transform: scale(0.95);
}

/* Owner badge */
.owner-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  font-size: 10px;
  color: #ffd700;
  font-weight: 700;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* ============================================================
   DELETE BUTTON trong Modal
   ============================================================ */
.modal-delete-btn {
  flex: 0 0 auto;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(200, 30, 30, 0.15);
  border: 1px solid rgba(200, 30, 30, 0.4);
  color: #ff6060;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-delete-btn:hover {
  background: rgba(200, 30, 30, 0.4);
  color: #fff;
  border-color: #ff4040;
  transform: scale(1.05);
}

.modal-delete-btn:active {
  transform: scale(0.95);
}

/* Owner badge */
.owner-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  font-size: 10px;
  color: #ffd700;
  font-weight: 700;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}
/* ============================================================
   PRICE BADGE trên cards
   ============================================================ */
.price-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  z-index: 10;
  backdrop-filter: blur(10px);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  pointer-events: none;
}

.price-badge.free {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(22, 163, 74, 0.9));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.5);
}

.price-badge.paid {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(245, 158, 11, 0.95));
  color: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.6);
}

/* Lock badge trong modal */
.lock-badge {
  display: inline-block;
  padding: 3px 10px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 999px;
  font-size: 11px;
  color: #1a1a1a;
  font-weight: 800;
  margin-left: 8px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Buy button */
.btn-buy {
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
  color: #1a1a1a !important;
  box-shadow: 0 8px 30px rgba(251, 191, 36, 0.5) !important;
  font-weight: 800 !important;
}

.btn-buy:hover {
  box-shadow: 0 12px 40px rgba(251, 191, 36, 0.7) !important;
  transform: translateY(-2px);
}

/* ============================================================
   PURCHASE MODAL OVERLAY
   ============================================================ */
.purchase-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 1, 15, 0.9);
  backdrop-filter: blur(20px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.purchase-modal {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, rgba(30, 15, 60, 0.98), rgba(20, 8, 45, 0.98));
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 20px;
  padding: 28px;
  color: #f0e5ff;
  box-shadow: 0 40px 100px rgba(168, 85, 247, 0.3);
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.purchase-modal h2 {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.purchase-info {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.purchase-info .row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.1);
}

.purchase-info .row:last-child {
  border-bottom: none;
}

.purchase-info .row.highlight {
  font-size: 18px;
  color: #fbbf24;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(251, 191, 36, 0.3);
}

.purchase-info .row span {
  color: #a78bfa;
}

.purchase-info .row strong {
  color: #fff;
}

.purchase-notice {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #fcd34d;
  margin-bottom: 20px;
}

.purchase-notice strong {
  color: #fbbf24;
}

.purchase-actions {
  display: flex;
  gap: 12px;
}

.btn-cancel {
  flex: 1;
  padding: 14px;
  background: rgba(168, 85, 247, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: rgba(168, 85, 247, 0.25);
}

.btn-confirm {
  flex: 2;
  padding: 14px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1a1a;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 8px 30px rgba(251, 191, 36, 0.5);
}

.btn-confirm:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(251, 191, 36, 0.7);
}

.btn-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}