/* AI NEXUS VAULT - Modern E-Commerce Dark Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800;900&display=swap');

:root {
  --bg-dark: hsl(250, 35%, 7%);
  --bg-sidebar: hsl(250, 40%, 5%);
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(26, 38, 66, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 80px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-sidebar); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* Layout Shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.3s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) 1fr;
}

/* Sidebar */
.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 90;
  user-select: none;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary), var(--accent-purple));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 800;
  background: linear-gradient(90deg, #ffffff, #60a5fa, #c084fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.sidebar-content {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px 6px;
  white-space: nowrap;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.sidebar-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.sidebar-icon {
  font-size: 18px;
  width: 24px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.menu-badge {
  margin-left: auto; font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px; text-transform: uppercase;
}
.badge-hot-tag { background: var(--accent-rose); color: #fff; }
.badge-free-tag { background: var(--accent-emerald); color: #fff; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: auto;
}

.btn-collapse-sidebar {
  width: 100%; background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color); color: var(--text-muted);
  padding: 10px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Main Area */
.main-content {
  display: flex; flex-direction: column; min-width: 0; min-height: 100vh;
}

.topbar {
  height: 72px; padding: 0 32px; background: rgba(7, 10, 18, 0.8);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.hamburger-btn { display: none; background: transparent; border: none; color: #fff; font-size: 24px; cursor: pointer; }

.topbar-title { font-family: 'Outfit', sans-serif; font-size: 20px; font-weight: 800; color: #fff; }

.topbar-right { display: flex; align-items: center; gap: 16px; }

/* Wallet Widget */
.wallet-header-widget {
  background: rgba(15, 23, 42, 0.9); border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg); padding: 6px 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

.wallet-info-text { display: flex; flex-direction: column; }
.wallet-info-text span:first-child { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.wallet-balance-val { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 800; color: #34d399; }

.btn-topup-header {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  border: none; color: #fff; padding: 7px 14px; border-radius: var(--radius-md);
  font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; gap: 6px;
}
.btn-topup-header:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); }

.user-pill-btn {
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 6px 12px; color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all 0.2s;
}
.user-pill-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }

.avatar-badge-mini {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px;
}

/* Page Container */
.page-container { padding: 32px; max-width: 1440px; margin: 0 auto; width: 100%; }

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95)), url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=1200&q=80') center/cover;
  border: 1px solid var(--border-glow); border-radius: var(--radius-xl);
  padding: 40px; margin-bottom: 32px; position: relative; overflow: hidden;
}

.hero-content { max-width: 680px; z-index: 2; position: relative; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa; padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-bottom: 16px;
}

.hero-title { font-family: 'Outfit', sans-serif; font-size: 36px; font-weight: 900; line-height: 1.2; margin-bottom: 14px; }
.hero-title span { background: linear-gradient(90deg, #60a5fa, #c084fc, #f472b6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.hero-subtitle { font-size: 15px; color: var(--text-sub); margin-bottom: 24px; max-width: 580px; }

/* Filter Controls */
.filter-bar {
  display: flex; flex-direction: column; gap: 20px; margin-bottom: 28px;
}

.search-box-wrapper { position: relative; width: 100%; }
.search-input {
  width: 100%; background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 14px 20px 14px 48px; color: #fff; font-size: 15px; outline: none; transition: all 0.2s;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--text-muted); }

.tab-pills-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tab-btn {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color);
  color: var(--text-muted); padding: 8px 18px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.tab-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.tab-btn.active { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border-color: rgba(59, 130, 246, 0.4); font-weight: 700; }

.niche-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.niche-pill {
  background: transparent; border: 1px solid rgba(255,255,255,0.06); color: var(--text-sub);
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.niche-pill:hover { border-color: var(--primary); color: #fff; }
.niche-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Products Grid */
.products-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; margin-bottom: 36px;
}

/* Product Card (Maulamvideo style) */
.product-card {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column; transition: all 0.3s ease; position: relative;
}
.product-card:hover {
  transform: translateY(-4px); border-color: var(--border-glow); box-shadow: 0 15px 35px rgba(0,0,0,0.5); background: var(--bg-card-hover);
}

.card-thumb-wrapper {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000; overflow: hidden;
}
.card-thumb { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .card-thumb { transform: scale(1.05); }

.type-badge {
  position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; z-index: 5;
}
.badge-chatbot { background: rgba(59, 130, 246, 0.85); color: #fff; backdrop-filter: blur(4px); }
.badge-workflow { background: rgba(139, 92, 246, 0.85); color: #fff; backdrop-filter: blur(4px); }
.badge-app { background: rgba(236, 72, 153, 0.85); color: #fff; backdrop-filter: blur(4px); }

.ai-engine-badge {
  position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 700; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); color: #fff; z-index: 5;
}

.thumb-play-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.3); display: flex;
  align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s ease; z-index: 4;
}
.product-card:hover .thumb-play-overlay { opacity: 1; }
.play-btn-circle {
  width: 48px; height: 48px; border-radius: 50%; background: rgba(59, 130, 246, 0.9);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.6); transform: scale(0.9); transition: transform 0.2s;
}
.product-card:hover .play-btn-circle { transform: scale(1); }

.discount-tag {
  position: absolute; bottom: 10px; right: 10px; background: #ef4444; color: #fff;
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; z-index: 5;
}

.card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; color: #fff; }
.card-slug { font-size: 11px; color: var(--text-muted); margin-bottom: 14px; }

.card-price-row { display: flex; align-items: baseline; gap: 10px; margin-top: auto; margin-bottom: 14px; }
.price-main { font-family: 'Outfit', sans-serif; font-size: 20px; font-weight: 800; color: #38bdf8; }
.price-original { font-size: 13px; color: var(--text-muted); text-decoration: line-through; }

.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-demo {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border-color); color: #fff;
  padding: 9px; border-radius: var(--radius-md); font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s; text-align: center;
}
.btn-demo:hover { background: rgba(255,255,255,0.12); }

.btn-buy {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple)); border: none; color: #fff;
  padding: 9px; border-radius: var(--radius-md); font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s; text-align: center;
}
.btn-buy:hover { opacity: 0.9; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }

/* Modals System */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
  z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-box {
  background: #0f172a; border: 1px solid var(--border-glow); border-radius: var(--radius-xl);
  width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; padding: 28px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.7); position: relative; animation: modalPop 0.25s ease;
}
@keyframes modalPop { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-close-btn {
  position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.06); border: none;
  color: var(--text-muted); width: 32px; height: 32px; border-radius: 50%; font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.modal-close-btn:hover { background: rgba(244, 63, 94, 0.2); color: #f43f5e; }

/* Toast Notification Stack */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #1e293b; border: 1px solid var(--border-glow); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.3s ease; transition: opacity 0.3s;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.mobile-open { display: flex; position: fixed; inset: 0; width: 280px; }
  .hamburger-btn { display: block; }
}
