:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-card: #161618;
  --bg-hover: #1c1c1f;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-light: rgba(139, 92, 246, 0.1);
  --border: #27272a;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
}

.logo svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

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

.user-menu {
  position: relative;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  display: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dropdown.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all 0.2s;
}

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

.dropdown-item.danger {
  color: var(--error);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

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

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hero Section */
.hero {
  padding: 80px 0;
  text-align: center;
  background: radial-gradient(ellipse at top, rgba(139, 92, 246, 0.15), transparent 60%);
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.1;
}

.hero .gradient-text {
  background: linear-gradient(135deg, var(--accent), #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Features */
.features {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Products */
.products-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
}

.product-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.1);
}

.product-image {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--accent-light), rgba(139, 92, 246, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image svg {
  width: 48px;
  height: 48px;
  color: rgba(139, 92, 246, 0.5);
}

.product-content {
  padding: 20px;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.product-card h3 {
  font-size: 1rem;
  font-weight: 600;
}

.product-category {
  font-size: 0.75rem;
  background: var(--accent-light);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 20px;
}

.product-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 16px;
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Page Headers */
.page-header {
  padding: 48px 0 32px;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-secondary);
}

/* Category Filter */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.category-btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.category-btn:hover,
.category-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Product Detail */
.product-detail {
  padding: 48px 0;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.product-detail-image {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--accent-light), rgba(139, 92, 246, 0.05));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-detail-image svg {
  width: 80px;
  height: 80px;
  color: rgba(139, 92, 246, 0.5);
}

.product-detail-info {
  position: sticky;
  top: 100px;
}

.product-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.product-detail-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin: 16px 0 24px;
}

.product-features {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.product-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.product-feature svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

/* Dashboard */
.dashboard {
  padding: 48px 0;
}

.purchase-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.purchase-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.purchase-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.purchase-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.purchase-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.purchase-details h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.purchase-date {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Login Page */
.login-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.login-card {
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.login-card h1 {
  font-size: 1.5rem;
  margin: 24px 0 8px;
}

.login-card > p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.login-providers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.login-btn:hover {
  background: var(--bg-hover);
}

.login-footer {
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.login-footer a {
  color: var(--accent);
}

.hidden {
  display: none !important;
}

/* Success Page */
.success-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.success-icon svg {
  width: 40px;
  height: 40px;
  color: var(--success);
}

.success-page h1 {
  margin-bottom: 8px;
}

.success-page p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.success-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Admin */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.stat-card-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.stat-info p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.stat-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

.admin-section {
  margin-bottom: 48px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-section h2 {
  font-size: 1.25rem;
}

.admin-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.admin-table-row:last-child {
  border-bottom: none;
}

.table-item-info h4 {
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.table-item-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.table-item-price {
  font-weight: 600;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-completed {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-failed {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

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

textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-checkbox input {
  width: 18px;
  height: 18px;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.form-card h3 {
  margin-bottom: 20px;
}

.form-actions {
  display: flex;
  gap: 12px;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.875rem;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

/* Owned Badge */
.owned-badge {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .nav-links {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-detail-grid {
    grid-template-columns: 1fr;
  }

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

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