/* 
 * PRODUCT DARK COLORS CSS 
 * Centralized control for all dark mode styling across the site
 */

/* Add the cosmic-gradient animation that works well for the logo */
@keyframes cosmic-gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Base dark mode colors for products and clothing pages */
body.dark.clothing-page,
body.dark.products-page {
  background-color: #171a23;
  color: #e0e0e0;
}

/* Text colors for standard elements */
body.dark.clothing-page h1:not(.page-title),
body.dark.clothing-page h2,
body.dark.clothing-page h3,
body.dark.clothing-page h4,
body.dark.clothing-page p,
body.dark.clothing-page a:not(.btn),
body.dark.clothing-page label,
body.dark.clothing-page span,
body.dark.clothing-page div,
body.dark.products-page h1:not(.page-title),
body.dark.products-page h2,
body.dark.products-page h3,
body.dark.products-page h4,
body.dark.products-page p,
body.dark.products-page a:not(.btn),
body.dark.products-page label,
body.dark.products-page span,
body.dark.products-page div {
  color: #e0e0e0;
}

/* Input styling in dark mode */
body.dark.clothing-page input,
body.dark.products-page input {
  background-color: #252836;
  color: #e0e0e0;
  border: 1px solid #4e1a4a;
}

/* 
 * ICON & TEXT GRADIENT ANIMATIONS - USING SAME ANIMATION AS LOGO
 */

/* For all icons with ::before (FontAwesome icons) */
body.dark .fa::before,
body.dark .fas::before,
body.dark .far::before,
body.dark .fab::before,
/* Navigation bar icons */
body.dark .nav-signin i,
body.dark .nav-signup i,
/* Main page title */
body.dark .title {
  /* Use exact same gradient as the logo */
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block;
  text-shadow: none;
  font-weight: bold;
}

/* Special fix specifically for menu toggle icon - highest priority */
.menu-toggle i,
body.dark .menu-toggle i,
body.dark .menu-toggle .fa.fa-bars,
body.dark .menu-toggle .fa-bars::before {
  /* Use exact same gradient as the logo */
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
  text-shadow: none;
  font-weight: bold;
  visibility: visible;
  opacity: 1;
}

/* Sidebar menu icons with same styling as logo */
body.dark .sidebar_menu .menu ul li a i,
body.dark .sidebar_menu .menu ul li a i::before {
  /* Use exact same gradient as the logo */
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
  text-shadow: none;
  font-weight: bold;
}

/* Make all icons slightly bolder in dark mode */
body.dark .fa::before,
body.dark .fas::before,
body.dark .fab::before,
body.dark .far::before {
  font-weight: bold;
}

/* GLOBAL cosmic-gradient for ALL icons in dark mode (fix missing icons) */
body.dark i, body.dark .fa, body.dark .fas, body.dark .fab, body.dark .far {
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
  text-shadow: none;
  font-weight: bold;
  opacity: 1;
}

/* Ensure cosmic-gradient animation is applied to menu icon in dark mode */
body.dark .menu-toggle i {
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
  text-shadow: none;
  font-weight: bold;
  opacity: 1;
}

/* Essential styles for menu icon animation - standalone approach */
body.dark .fas.fa-bars,
body.dark .fas.fa-times,
body.dark .menu-toggle .fas {
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transform: none;
  transition: none;
}

/* Product page specific styling */
body.dark.products-page .product-card,
body.dark .product-card {
  background-color: #252836;
  border: 1px solid #2d2f3f;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

body.dark.products-page .category-title,
body.dark .category-title {
  color: #e0e0e0;
  border-bottom: 2px solid #504099;
}

/* View Product Page Dark Mode Styling */
body.dark .product-details {
  background-color: #1a1a2e;
  color: #e0e0e0;
}

body.dark .product-breadcrumb,
body.dark .product-breadcrumb a {
  color: #aaa;
}

body.dark .product-breadcrumb a:hover {
  color: #209cb3;
}

body.dark .product-title {
  color: #f0f0f0;
}

body.dark .product-main-image {
  background-color: #252836;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark .thumbnail-item {
  background-color: #252836;
  border-color: #2d2f3f;
}

body.dark .thumbnail-item.active {
  border-color: #209cb3;
}

body.dark .product-pricing .current-price {
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
  font-weight: bold;
  text-shadow: none;
}

body.dark .product-pricing .original-price {
  color: #888;
}

body.dark .attribute-group h3,
body.dark .attribute-group h4,
body.dark .attribute-title {
  color: #ccc;
}

body.dark .product-description {
  color: #ddd;
}

body.dark .color-group .attribute-title {
  color: #ccc;
  /* Removed forced positioning that caused spacing inconsistencies */
}

body.dark .description-group .attribute-title {
  color: #ccc;
  /* Removed forced positioning that caused spacing inconsistencies */
}

/* Adjust positioning for Colors in dark mode */
body.dark .color-group {
  display: block;
  margin-top: -5px; /* Move up slightly in dark mode */
  position: relative;
  z-index: 1;
}

/* Adjust positioning for Description in dark mode */
body.dark .description-group {
  display: block;
  margin-top: 20px; /* Move down more in dark mode */
  position: relative;
  z-index: 1;
}

body.dark .color-options,
body.dark .product-description {
  /* Removed forced positioning that could cause spacing inconsistencies */
  color: #ddd;
}

/* Style icons without affecting layout */
body.dark .color-group i,
body.dark .description-group i {
  /* Simplified styling that doesn't impact layout */
  color: inherit;
  -webkit-text-fill-color: inherit;
}

body.dark .size-option,
body.dark .config-option {
  background-color: #333;
  border-color: #444;
  color: #f0f0f0;
}

body.dark .size-option:hover,
body.dark .config-option:hover {
  border-color: #209cb3;
}

body.dark .size-option.selected,
body.dark .config-option.selected {
  background-color: #209cb3;
  color: white;
  border-color: #209cb3;
}

body.dark .color-option.selected,
body.dark .color-option:active {
  box-shadow: 0 0 0 2px #222, 0 0 0 4px #209cb3;
}

body.dark .no-colors-message {
  color: #aaa;
}

body.dark .quantity-selector {
  border-color: #444;
}

body.dark .quantity-btn {
  background-color: #333;
  color: #f0f0f0;
}

body.dark .quantity-btn:hover {
  background-color: #444;
}

body.dark .quantity-selector input[type="number"] {
  background-color: #333;
  color: #f0f0f0;
}

body.dark .add-to-cart-btn {
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
}

body.dark .add-to-cart-btn:hover {
  filter: brightness(1.2);
}

body.dark .wishlist-btn {
  border-color: #444;
}

body.dark .product-tabs {
  border-color: #444;
}

body.dark .tabs-header {
  border-color: #444;
}

/* Dark mode styles for Details section */
body.dark .detail-item {
  border-bottom-color: #444;
}

body.dark .detail-item h3 {
  color: #f0f0f0;
}

body.dark .detail-item p {
  color: #aaa;
}

/* Dark mode styles for Specifications section */
body.dark .spec-group {
  background: linear-gradient(270deg, #252836, #1e2233, #252836, #252836);
  background-size: 800% 800%;
  animation: cosmic-gradient 10s ease infinite;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

body.dark .spec-group h3 {
  /* Match add-to-cart button gradient */
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
}

body.dark .spec-item {
  border-bottom-color: #444;
}

body.dark .spec-item h4 {
  color: #e0e0e0;
}

body.dark .spec-item p {
  color: #aaa;
}

body.dark .tab-btn {
  color: #ccc;
}

body.dark .tab-btn:hover {
  background-color: #333;
}

body.dark .tab-btn.active {
  color: #209cb3;
  border-bottom: 2px solid #209cb3;
}

body.dark .related-product-card {
  background-color: #252836;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark .related-product-card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

body.dark .related-product-name a {
  color: #f0f0f0;
}

body.dark .related-product-price {
  color: #ff6b6b;
}

body.dark .quick-add-btn {
  background-color: #209cb3;
}

body.dark .quick-add-btn:hover {
  background-color: #35a79c;
}

body.dark .meta-item {
  color: #ccc;
}

/* Animated buttons with enhanced gradient background - using same animation as logo */
body.dark .animated-button {
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px 0 rgba(32, 156, 179, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-weight: bold;
}

body.dark .animated-button:hover {
  filter: brightness(1.2);
  box-shadow: 0 6px 24px 0 rgba(32, 156, 179, 0.3);
  transform: translateY(-2px);
}

/* Add styling for all buttons in dark mode */
body.dark .btn:not(.search-btn),
body.dark button[type="submit"]:not(.search-btn),
body.dark button.btn:not(.search-btn) {
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  color: #fff;
  border: none;
  transition: all 0.3s ease;
}

body.dark .btn:hover,
body.dark button[type="submit"]:hover,
body.dark button.btn:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

/* Main page title styling - moved from products-page.css */
body.dark .title {
  border-bottom: none;
}

/* Override any conflicting menu icon styles from other files */
body.dark .menu-toggle.close i::before {
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

/* Extra specific selector for menu toggle icon */
body.dark header .menu-toggle i.fa.fa-bars,
body.dark .top-nav .menu-toggle i.fa-bars,
body.dark div.menu-toggle i.fa-bars {
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
  text-shadow: none;
  font-weight: bold;
  visibility: visible;
  opacity: 1;
}

/* Menu items in the sidebar with animating icons */
body.dark .sidebar_menu .menu ul li a i,
body.dark .sidebar_menu .menu ul li a i::before,
body.dark .menu .fa::before,
body.dark .menu .fas::before {
  background: linear-gradient(270deg, #35a79c, #209cb3, #1e4a69, #35a79c);
  background-size: 800% 800%;
  animation: cosmic-gradient 8s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
  text-shadow: none;
  font-weight: bold;
}

/* Firefox specific fix for text gradients */
@-moz-document url-prefix() {
  body.dark .fa::before,
  body.dark .fas::before,
  body.dark .far::before,
  body.dark .fab::before,
  body.dark .nav-signin i,
  body.dark .nav-signup i,
  body.dark .brand a,
  body.dark .title,
  body.dark .menu-toggle i,
  body.dark .sidebar_menu .menu ul li a i::before {
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Styling from clothing.html - moved here for consistency and organization */
body.dark.clothing-page {
  background-color: #1a1a2e;
}

body.dark.clothing-page .products-grid .product-card h3 {
  color: #ffffff;
}

body.dark.clothing-page .products-grid .product-card p {
  color: #ffffff;
}

body.dark.clothing-page .products-grid .product-card .price {
  color: #35a79c;
}

/* Sign in and Sign up button icons - now handled by nav-header.css professional styles */

/* Search icon in dark mode */
body.dark .search-btn i.fas.fa-search {
  background: none;
  -webkit-text-fill-color: white;
  color: white;
  animation: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Sign in/up button icons - inherits from nav-header.css professional styles */

/* Styling for "No ratings yet" text */
.no-ratings {
  color: #777777; /* Dark gray in light mode */
  font-style: italic;
  opacity: 0.85;
}

body.dark .no-ratings {
  color: #a0a0a0; /* Lighter gray in dark mode */
  opacity: 0.9;
}

/* Light mode animation for the page title */
body:not(.dark) .page-title {
  background: linear-gradient(120deg, #3f51b5, #8e24aa, #5c6bc0, #9c27b0);
  background-size: 300% 300%;
  animation: gradientMove 8s ease infinite;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  position: relative;
  font-size: 32px;
  font-weight: 800;
  border-bottom: none;
}

/* Light mode underline animation */
body:not(.dark) .page-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(120deg, #3f51b5, #8e24aa, #5c6bc0, #9c27b0);
  background-size: 300% 300%;
  animation: gradientMove 8s ease infinite;
}

body.dark .page-title {
  background: linear-gradient(135deg, #35a79c, #209cb3, #1e4a69);
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  border-bottom-color: transparent;
  position: relative;
  font-size: 32px; /* Match the size in light mode */
  font-weight: 800; /* Match the weight in light mode */
}

body.dark .page-title::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(135deg, #35a79c, #209cb3, #1e4a69);
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
}

/* Color option buttons for product modal */
.color-option[data-color="Black"] {
  background-color: #3a3a3a;
}

.color-option[data-color="Blue"] {
  background-color: #2158c1;
}

.color-option[data-color="Red"] {
  background-color: #c12121;
}

.color-option[data-color="White"] {
  background-color: #ffffff;
  border: 1px solid #ddd;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes gradientMove {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}

/* Dark mode scrollbar styling - with higher specificity and !important to ensure it takes effect */
html body.dark::-webkit-scrollbar-track {
  background: #2a2a2a !important;
}

html body.dark::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #209cb3 0%, #35a79c 50%, #1e4a69 100%) !important;
  background-size: 200% 200% !important;
  animation: gradientScroll 6s ease infinite !important;
  border-radius: 3px !important;
}

html body.dark::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #19889c 0%, #2c9085 50%, #183a54 100%) !important;
  background-size: 200% 200% !important;
  animation: gradientScroll 4s ease infinite !important;
}

/* Firefox scrollbar in dark mode - with higher specificity */
html body.dark * {
  scrollbar-color: #209cb3 #2a2a2a !important;
}

/* Scrollbar animation */
@keyframes gradientScroll {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}

/* Mobile-specific dark mode styles with !important flags */
@media screen and (max-width: 768px) {
  /* Dark mode page title for mobile */
  body.dark .page-title,
  body.dark .title.page-title {
    background: linear-gradient(135deg, #35a79c, #209cb3, #1e4a69) !important;
    background-size: 200% 200% !important;
    animation: gradientShift 5s ease infinite !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    position: relative !important;
  }
  
  /* Dark mode page title underline for mobile */
  body.dark .page-title::after,
  body.dark .title.page-title::after {
    background: linear-gradient(135deg, #35a79c, #209cb3, #1e4a69) !important;
    background-size: 200% 200% !important;
    animation: gradientShift 5s ease infinite !important;
  }
  
  /* Dark mode title text */
  body.dark .page-title {
    background-clip: text !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    position: relative !important;
  }
}

/* ============================================================================
   EXCEPTIONS - Icons that should be WHITE in dark mode (no gradient animation)
   ============================================================================ */

/* Search button icon - WHITE */
body.dark .search-btn i,
body.dark .search-btn i.fas,
body.dark .search-btn i.fa-search,
body.dark .search-btn .fa-search,
body.dark .search-btn i::before {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: #ffffff !important;
  color: #ffffff !important;
  animation: none !important;
}

/* Sign in / Sign up button icons - WHITE */
body.dark .nav-signin i,
body.dark .nav-signup i,
body.dark .nav-signin i.fas,
body.dark .nav-signup i.fas,
body.dark .nav-signin .fa-sign-in-alt,
body.dark .nav-signup .fa-user-plus,
body.dark .auth-links .nav-signin i,
body.dark .auth-links .nav-signup i,
body.dark .login-button i,
body.dark .signup-button i {
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: #ffffff !important;
  color: #ffffff !important;
  animation: none !important;
}
