/* ============================================================
   EAZYMART - Auto Dark Mode (System Preference Detection)
   Automatically follows macOS/iOS dark mode - NO BUTTON NEEDED
============================================================ */

/* ========== AUTO-DETECT SYSTEM DARK MODE ========== */
@media (prefers-color-scheme: dark) {
  /* GLOBAL DARK MODE */
  body {
    background-color: #16181d !important;
    color: #e7e9ea !important;
  }

  html {
    background-color: #16181d !important;
  }

  /* PRODUCT CARDS */
  .product-card,
  .card,
  .product-row-item-card,
  div[class*="product-card"],
  div[class*="card"] {
    background-color: #242830 !important;
    background: #242830 !important;
    border: 1px solid #3a3f4a !important;
    color: #e7e9ea !important;
  }

  .product-card:hover,
  .card:hover {
    background-color: #2d323a !important;
    border-color: #FFD839 !important;
    box-shadow: 0 6px 20px rgba(255, 216, 57, 0.25) !important;
    transform: translateY(-2px) !important;
  }

  /* CARD BODY */
  .card-body,
  .product-card-body {
    background-color: transparent !important;
    background: transparent !important;
    color: #e7e9ea !important;
  }

  /* PRODUCT IMAGE BACKGROUNDS */
  .product-card-image-container {
    background-color: #2d323a !important;
    background: #2d323a !important;
  }

  /* PRICES - GOLD IN DARK MODE */
  .product-price,
  .price,
  span.product-price,
  div.product-price {
    color: #FFD839 !important;
    font-weight: 700 !important;
  }

  .product-price-old,
  .old-price {
    color: #7d8794 !important;
    text-decoration: line-through !important;
  }

  /* PRODUCT NAMES & TEXT */
  .product-card-title,
  .product-name,
  .card-body h6,
  h6 {
    color: #f5f5f7 !important;
  }

  .product-card-unit,
  .product-unit {
    color: #9ca3af !important;
  }

  .text-muted {
    color: #7d8794 !important;
  }

  /* BUTTONS */
  .btn-gold,
  .btn-primary,
  .btn-add-cart,
  button[class*="btn"] {
    background-color: #FFD839 !important;
    background: #FFD839 !important;
    color: #042853 !important;
    border: none !important;
  }

  .btn-gold:hover,
  .btn-primary:hover {
    background-color: #e6c230 !important;
    transform: scale(1.05) !important;
  }

  /* QUANTITY CONTROLS */
  .quantity-control-card {
    background-color: #2d323a !important;
    border: 1px solid #3a3f4a !important;
  }

  .quantity-control-card button {
    background-color: #FFD839 !important;
    color: #042853 !important;
  }

  .quantity-control-card span {
    color: #f5f5f7 !important;
  }

  /* BADGES */
  .limited-deal-banner {
    background: linear-gradient(135deg, #c62828, #d32f2f) !important;
  }

  .discount-percent-badge,
  .product-discount-badge,
  .badge {
    background-color: #ff4757 !important;
    color: white !important;
  }

  /* HEADER / NAVBAR */
  .header,
  .navbar,
  nav {
    background-color: #1e2126 !important;
    border-bottom: 1px solid #3a3f4a !important;
  }

  .nav-link {
    color: #9ca3af !important;
  }

  .nav-link:hover,
  .nav-link.active {
    color: #FFD839 !important;
  }

  /* SEARCH BAR */
  input[type="search"],
  input[type="text"],
  .form-control {
    background-color: #242830 !important;
    border: 1px solid #3a3f4a !important;
    color: #f5f5f7 !important;
  }

  input:focus {
    border-color: #FFD839 !important;
    box-shadow: 0 0 0 3px rgba(255, 216, 57, 0.2) !important;
  }

  /* PRODUCT SECTIONS */
  .product-row-container {
    background-color: transparent !important;
  }

  .product-row-header h4 {
    color: #f5f5f7 !important;
  }

  .gold-primary,
  .blue-primary {
    color: #FFD839 !important;
  }

  /* BOTTOM NAVIGATION */
  .bottom-nav,
  .navbar-bottom {
    background-color: #1e2126 !important;
    border-top: 1px solid #3a3f4a !important;
  }

  .nav-item {
    color: #9ca3af !important;
  }

  .nav-item.active {
    color: #FFD839 !important;
  }

  /* SIDEBAR */
  .sidebar {
    background-color: #1e2126 !important;
    border-right: 1px solid #3a3f4a !important;
  }

  .sidebar h3 {
    color: #f5f5f7 !important;
  }

  .sidebar li {
    color: #9ca3af !important;
  }

  .sidebar li:hover {
    background-color: #242830 !important;
    color: #f5f5f7 !important;
  }

  .sidebar li.active {
    background-color: #FFD839 !important;
    color: #042853 !important;
  }

  /* TEXT COLORS */
  h1, h2, h3, h4, h5 {
    color: #f5f5f7 !important;
  }

  p {
    color: #9ca3af !important;
  }

  /* SCROLLBAR */
  ::-webkit-scrollbar {
    width: 10px;
    background-color: #16181d;
  }

  ::-webkit-scrollbar-track {
    background-color: #1e2126;
  }

  ::-webkit-scrollbar-thumb {
    background-color: #3a3f4a;
    border-radius: 5px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background-color: #4a5160;
  }

  /* MODALS & FORMS */
  .modal-content {
    background-color: #242830 !important;
    color: #f5f5f7 !important;
  }

  .form-select,
  textarea {
    background-color: #242830 !important;
    border: 1px solid #3a3f4a !important;
    color: #f5f5f7 !important;
  }

  label {
    color: #9ca3af !important;
  }

  /* ALERTS */
  .alert {
    background-color: #242830 !important;
    border-color: #3a3f4a !important;
    color: #f5f5f7 !important;
  }

  /* FOOTER */
  .footer,
  footer {
    background-color: #1e2126 !important;
    border-top: 1px solid #3a3f4a !important;
    color: #9ca3af !important;
  }

  /* CART ITEMS */
  .cart-item {
    background-color: #242830 !important;
    border: 1px solid #3a3f4a !important;
  }

  /* EMPTY CART MESSAGE */
  .empty-cart-message {
    background-color: #242830 !important;
    color: #9ca3af !important;
  }
}
