:root {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-card: #3a3a3a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent-purple: #6b2d5b;
  --accent-purple-light: #8b4d7b;
  --accent-green: #2d5a27;
  --accent-success: #28a745;
  --accent-danger: #dc3545;
  --accent-warning: #ffc107;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: 80px;
}

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

/* Header */
.header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  color: var(--text-primary);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.header-icon {
  color: var(--text-primary);
  font-size: 1.25rem;
  padding: 8px;
}

.badge-sm {
  font-size: 0.65rem;
  padding: 2px 5px;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  font-size: 1.5rem;
}

/* Location Bar */
.location-bar {
  background-color: var(--bg-secondary);
}

/* Category Tabs */
.category-tabs {
  background-color: var(--bg-primary);
  padding: 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tabs-container {
  display: flex;
  gap: 10px;
  padding: 0 16px;
  white-space: nowrap;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: 25px;
  border: 1px solid var(--bg-card);
  background-color: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.tab-btn.active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.tab-btn:hover:not(.active) {
  border-color: var(--text-secondary);
}

/* Flash Sale Banner */
.flash-sale-banner {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-light) 100%);
  border-radius: 16px;
  padding: 24px;
}

.sale-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.lightning {
  font-size: 1.5rem;
}

.sale-description {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
}

.shop-btn {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.shop-btn:hover {
  transform: scale(1.05);
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

/* Gift Banner */
.gift-banner {
  background: linear-gradient(135deg, var(--accent-green) 0%, #4a8f42 100%);
}

/* Section Header */
.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.view-all {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.25rem;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.product-card {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-image {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: var(--bg-card);
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-label {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-primary);
  opacity: 0.9;
}

.sale-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: var(--accent-danger);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.product-info {
  padding: 12px;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price {
  font-size: 0.9rem;
  color: var(--accent-success);
  margin: 0;
  font-weight: 600;
}

.original-price {
  color: var(--text-secondary);
  text-decoration: line-through;
  margin-right: 8px;
  font-weight: normal;
}

/* Mobile Navigation */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  border-top: 1px solid var(--bg-card);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s ease;
}

.nav-item.active,
.nav-item:hover {
  color: var(--text-primary);
}

.nav-item i {
  font-size: 1.25rem;
}

/* Forms */
.form-control,
.form-select {
  background-color: var(--bg-secondary);
  border: 1px solid var(--bg-card);
  color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
  background-color: var(--bg-secondary);
  border-color: var(--accent-purple);
  color: var(--text-primary);
  box-shadow: 0 0 0 0.2rem rgba(107, 45, 91, 0.25);
}

.form-control::placeholder {
  color: var(--text-secondary);
}

/* Buttons */
.btn-primary {
  background-color: var(--accent-purple);
  border-color: var(--accent-purple);
}

.btn-primary:hover {
  background-color: var(--accent-purple-light);
  border-color: var(--accent-purple-light);
}

/* Cards */
.card {
  background-color: var(--bg-secondary);
  border: none;
  border-radius: 12px;
}

.card-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--bg-card);
}

/* Tables */
.table {
  color: var(--text-primary);
}

.table-dark {
  --bs-table-bg: var(--bg-secondary);
  --bs-table-border-color: var(--bg-card);
}

/* Dashboard Stats */
.stat-card {
  background-color: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
}

.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.stat-card .stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Order Status */
.status-pending {
  color: var(--accent-warning);
}
.status-confirmed {
  color: #17a2b8;
}
.status-processing {
  color: var(--accent-purple);
}
.status-shipped {
  color: #6f42c1;
}
.status-delivered {
  color: var(--accent-success);
}
.status-cancelled {
  color: var(--accent-danger);
}

/* Messages */
.message-item {
  background-color: var(--bg-card);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.message-item.unread {
  border-left: 3px solid var(--accent-purple);
}

.message-sender {
  font-weight: 600;
}

.message-preview {
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chat */
.chat-container {
  max-height: 400px;
  overflow-y: auto;
}

.chat-message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  margin-bottom: 8px;
}

.chat-message.sent {
  background-color: var(--accent-purple);
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-message.received {
  background-color: var(--bg-card);
  border-bottom-left-radius: 4px;
}

/* Scrollbar */
.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tabs {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Auth Pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background-color: var(--bg-secondary);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 400px;
}

.auth-card .logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-card .logo i {
  font-size: 2.5rem;
  color: var(--accent-purple);
}

/* Responsive */
@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .product-image {
    height: 180px;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .mobile-nav {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}
