/* ===== PRODUCT MANAGEMENT STYLES ===== */

/* ===== Toolbar ===== */
.products-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 300px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-count {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #00ffff;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}

.product-count i {
  font-size: 20px;
}

/* ===== Sort Select ===== */
.sort-select {
  padding: 10px 35px 10px 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300ffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.sort-select:hover {
  border-color: #00ffff;
  background-color: rgba(0, 255, 255, 0.05);
}

.sort-select:focus {
  outline: none;
  border-color: #00ffff;
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.1);
}

/* ===== Filter Dropdown ===== */
.filter-dropdown {
  position: relative;
}

.filter-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-dropdown-btn:hover {
  border-color: #00ffff;
  background: rgba(0, 255, 255, 0.05);
}

.filter-dropdown-btn i {
  font-size: 16px;
}

.filter-dropdown.active .filter-dropdown-btn {
  border-color: #00ffff;
  background: rgba(0, 255, 255, 0.1);
}

.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.filter-dropdown.active .filter-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-option:hover {
  background: rgba(0, 255, 255, 0.1);
}

.filter-option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #00ffff;
}

.filter-option span {
  font-size: 14px;
  color: #fff;
  font-weight: 500;
}

/* ===== Products Grid ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.product-card-grid {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-card-grid:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-color: rgba(0, 255, 255, 0.3);
}

.product-card-image {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, #000, #1a1a1a);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 15px;
  transition: transform 0.3s ease;
}

.product-card-grid:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-status {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
  z-index: 2;
}

.product-card-status.active {
  background: rgba(46, 213, 115, 0.9);
  color: #fff;
  box-shadow: 0 4px 12px rgba(46, 213, 115, 0.4);
}

.product-card-status.sold {
  background: rgba(255, 107, 107, 0.9);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.product-card-status.pending {
  background: rgba(255, 193, 7, 0.9);
  color: #000;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.product-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.product-card-grid:hover .product-card-overlay {
  opacity: 1;
  visibility: visible;
}

.product-card-body {
  padding: 20px;
}

.product-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.product-card-price {
  font-size: 20px;
  font-weight: 700;
  color: #00ffff;
  margin-bottom: 12px;
}

.product-card-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #888;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.product-card-stats span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.product-card-stats i {
  color: #00ffff;
}

/* ===== List View ===== */
.products-list-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

/* ===== Pagination Ellipsis ===== */
.pagination-ellipsis {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 18px;
  padding: 0 5px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
  }

  .toolbar-left {
    min-width: 250px;
  }
}

@media (max-width: 768px) {
  .products-toolbar {
    padding: 15px;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar-left {
    flex-wrap: wrap;
  }

  .product-count {
    order: 1;
  }

  .profile-search {
    order: 3;
    width: 100%;
    margin-top: 15px;
  }

  .toolbar-right {
    order: 2;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }

  .product-card-image {
    height: 180px;
  }

  .product-card-body {
    padding: 15px;
  }

  .pagination {
    gap: 5px;
    flex-wrap: wrap;
  }

  .pagination-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-card-image {
    height: 200px;
  }

  .sort-select,
  .filter-dropdown-btn {
    font-size: 13px;
    padding: 8px 15px;
  }

  .view-toggle-btn {
    width: 32px;
    height: 32px;
  }

  .view-toggle-btn i {
    font-size: 16px;
  }

  .product-card-overlay {
    gap: 8px;
  }

  .action-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

/* ===== Form Row for Modal ===== */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card-grid,
.product-card {
  animation: fadeInUp 0.3s ease;
}

/* ===== Loading State ===== */
.products-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: #00ffff;
}

.products-loading i {
  font-size: 48px;
  margin-bottom: 20px;
  animation: spin 1s linear infinite;
}

.products-loading p {
  font-size: 16px;
  color: #aaa;
}

/* ===== No Results State ===== */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
}

.no-results i {
  font-size: 64px;
  color: rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.no-results h3 {
  font-size: 20px;
  color: #fff;
  margin-bottom: 10px;
}

.no-results p {
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ===== Hover Effects Enhancement ===== */
.product-card-grid::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.product-card-grid:hover::before {
  opacity: 1;
}

/* ===== Stats Indicator ===== */
.stats-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(0, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #00ffff;
}

.stats-indicator i {
  font-size: 13px;
}

/* ===== Quick Actions Menu ===== */
.quick-actions {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2;
}

.product-card-grid:hover .quick-actions {
  opacity: 1;
  visibility: visible;
}

.quick-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.quick-action-btn:hover {
  background: rgba(0, 255, 255, 0.9);
  color: #000;
  transform: scale(1.1);
  border-color: #00ffff;
}

/* ===== Bulk Actions Toolbar ===== */
.bulk-actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: rgba(0, 255, 255, 0.1);
  border: 2px solid rgba(0, 255, 255, 0.3);
  border-radius: 12px;
  margin-bottom: 20px;
  animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.bulk-actions-toolbar .selected-count {
  font-size: 14px;
  font-weight: 600;
  color: #00ffff;
}

.bulk-actions-toolbar .actions {
  display: flex;
  gap: 10px;
}

.bulk-actions-toolbar button {
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bulk-actions-toolbar button:hover {
  background: rgba(0, 255, 255, 0.2);
  border-color: #00ffff;
  color: #00ffff;
}

.bulk-actions-toolbar button.danger {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
}

.bulk-actions-toolbar button.danger:hover {
  background: rgba(255, 107, 107, 0.3);
}

/* ===== Product Selection Checkbox ===== */
.product-checkbox {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 3;
  accent-color: #00ffff;
}

.product-card-grid:hover .product-checkbox,
.product-card-grid.selected .product-checkbox {
  opacity: 1;
  visibility: visible;
}

.product-card-grid.selected {
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* ===== Filter Tags ===== */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 20px;
  font-size: 13px;
  color: #00ffff;
  animation: fadeInUp 0.3s ease;
}

.filter-tag button {
  background: none;
  border: none;
  color: #00ffff;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.filter-tag button:hover {
  transform: scale(1.2);
  color: #ff6b6b;
}

/* ===== Export/Import Buttons ===== */
.export-import-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-export,
.btn-import {
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-export:hover,
.btn-import:hover {
  border-color: #00ffff;
  background: rgba(0, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* ===== Product Status Timeline ===== */
.status-timeline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.status-timeline-item {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: #666;
  position: relative;
}

.status-timeline-item::before {
  content: '';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.status-timeline-item.active {
  color: #00ffff;
}

.status-timeline-item.active::before {
  background: #00ffff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* ===== Grid/List Toggle Enhancement ===== */
.view-toggle {
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Performance Indicators ===== */
.performance-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
}

.performance-badge.trending {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.performance-badge.hot {
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.performance-badge.new {
  background: rgba(46, 213, 115, 0.2);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.3);
}

.performance-badge i {
  font-size: 13px;
}

/* ===== Skeleton Loading for Products ===== */
.product-skeleton {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  overflow: hidden;
  padding: 20px;
}

.product-skeleton .skeleton-image {
  width: 100%;
  height: 220px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 10px;
  margin-bottom: 15px;
}

.product-skeleton .skeleton-text {
  height: 16px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 10px;
}

.product-skeleton .skeleton-text.short {
  width: 60%;
}

/* ===== Smooth Transitions ===== */
.products-grid,
.products-list-view {
  transition: opacity 0.3s ease;
}

.products-grid.loading,
.products-list-view.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* ===== Print Styles ===== */
@media print {
  .products-toolbar,
  .pagination,
  .product-card-overlay,
  .quick-actions,
  .bulk-actions-toolbar {
    display: none !important;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .product-card-grid {
    page-break-inside: avoid;
  }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
  .product-card-grid,
  .products-toolbar {
    border-width: 2px;
  }

  .product-card-status {
    border: 2px solid currentColor;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .product-card-grid,
  .product-card-image img,
  .filter-dropdown-menu,
  .product-card-overlay {
    transition: none;
    animation: none;
  }
}

/* ===== Dark Theme Enhancements ===== */
@media (prefers-color-scheme: dark) {
  .products-toolbar {
    background: rgba(0, 0, 0, 0.5);
  }

  .product-card-grid {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.6) 100%);
  }

  .sort-select,
  .filter-dropdown-btn {
    background: rgba(0, 0, 0, 0.5);
  }
}

/* ===== Accessibility Focus Styles ===== */
.product-card-grid:focus-within {
  outline: 2px solid #00ffff;
  outline-offset: 2px;
}

.sort-select:focus,
.filter-dropdown-btn:focus,
.view-toggle-btn:focus {
  outline: 2px solid #00ffff;
  outline-offset: 2px;
}

/* ===== Mobile Optimizations ===== */
@media (max-width: 480px) {
  .products-toolbar {
    padding: 12px;
  }

  .toolbar-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .product-count {
    font-size: 14px;
  }

  .toolbar-right {
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 5px;
  }

  .toolbar-right::-webkit-scrollbar {
    height: 3px;
  }

  .toolbar-right::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
  }

  .toolbar-right::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 3px;
  }

  .filter-dropdown-menu {
    right: auto;
    left: 0;
  }
}

/* ===== Touch Device Optimizations ===== */
@media (hover: none) {
  .product-card-overlay {
    opacity: 0;
    visibility: hidden;
  }

  .product-card-grid .quick-actions {
    opacity: 1;
    visibility: visible;
  }

  .action-icon {
    width: 40px;
    height: 40px;
  }
}