:root {
  --primary: #6C47FF;
  --secondary: #FF6B6B;
  --accent: #00D4AA;
  --dark: #0D0D1A;
  --text: #1A1A2E;
  --text-muted: #6B7280;
  --bg: #FFFFFF;
  --bg-surface: #F8F7FF;
  --bg-hover: #F3F4F6;
  --border: #E5E7EB;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(108,71,255,0.12);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  
  --network-instagram: #E1306C;
  --network-tiktok: #000000;
  --network-youtube: #FF0000;
  --network-facebook: #1877F2;
  --network-twitter: #1DA1F2;
  --network-spotify: #1DB954;
  --network-telegram: #0088cc;
}

/* Dark Mode optional */
[data-theme="dark"] {
  --bg: #0D0D1A;
  --bg-surface: #1A1A2E;
  --bg-hover: #2A2A3E;
  --text: #F3F4F6;
  --border: #374151;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font);
}

body {
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color var(--transition);
}
a:hover {
  filter: brightness(1.1);
}

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.5rem; }
.text-2xl { font-size: 2rem; }
.text-3xl { font-size: 3rem; }
.text-4xl { font-size: 4rem; }

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

.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-white { color: #FFFFFF; }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hidden-desktop { display: none; }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 767px) {
  .hidden-mobile { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  gap: 0.5rem;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:not(:disabled):hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.btn-secondary {
  background-color: var(--secondary);
  color: #fff;
}
.btn-accent {
  background-color: var(--accent);
  color: #fff;
}
.btn-outline {
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--bg-surface);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.btn-full {
  width: 100%;
}

/* Cards */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(108,71,255,0.3);
}

.card-product {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-product .icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-primary { background: rgba(108,71,255,0.1); color: var(--primary); }
.badge-success { background: rgba(0,212,170,0.1); color: var(--accent); }
.badge-warning { background: rgba(245,158,11,0.1); color: #d97706; }
.badge-error { background: rgba(239,68,68,0.1); color: #b91c1c; }

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-group label {
  font-weight: 500;
  font-size: 0.875rem;
}
.form-control, input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 1rem;
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: var(--transition);
}
textarea.form-control {
  height: auto;
  padding-top: 1rem;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,71,255,0.15);
}
.form-error {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: -1rem;
  margin-bottom: 1rem;
  display: block;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: var(--transition);
}
[data-theme="dark"] .navbar {
  background: rgba(13, 13, 26, 0.9);
}
.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}
.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
}
.navbar-brand img {
  height: 32px;
}
.navbar-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.navbar-menu a.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.navbar-menu a.nav-link:hover {
  color: var(--primary);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  gap: 2rem;
}

@media (max-width: 767px) {
  .nav-wrapper {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--bg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--border);
    gap: 1.5rem;
    align-items: stretch;
  }
  .nav-wrapper.active {
    display: flex;
  }
  .navbar-menu {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .nav-actions {
    flex-direction: column;
    width: 100%;
  }
  .nav-actions select {
    width: 100% !important;
  }
}

/* Sections */
.section {
  padding: 80px 0;
}
.section-sm {
  padding: 40px 0;
}
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* Hero */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 70px;
}
.hero-gradient {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(108,71,255,0.05) 0%, rgba(0,212,170,0.05) 100%);
  z-index: -1;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}
.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
}

/* Flash Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  background: #333;
  color: #fff;
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  animation: slideInRight 0.3s ease-out;
}
.toast.success { background: var(--accent); }
.toast.error { background: var(--secondary); }

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

@media (prefers-reduced-motion: no-preference) {
  .animate-fadeInUp {
    opacity: 0;
  }
  .animate-fadeInUp.visible {
    animation: fadeInUp 0.6s ease-out forwards;
  }
}

/* Utils */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.truncate {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
