/* Category Page - Comprehensive UI/UX Enhancements */

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Page Container */
.category-container {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Section Headers */
.section-header-enhanced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 3px solid transparent;
  background: linear-gradient(to right, #e0e7ff, transparent) no-repeat bottom;
  background-size: 100% 3px;
  position: relative;
}

.section-header-enhanced::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  border-radius: 3px;
  animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 80px;
    opacity: 1;
  }
}

.header-content h3 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 900;
  color: #1e293b;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.5px;
}

.header-content h3 i {
  font-size: 24px;
  color: #2563eb;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.header-content p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

/* Enhanced Filter Sidebar */
.filter-sidebar {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid #f1f5f9;
  position: sticky;
  top: 100px;
  overflow: visible;
  transition: all 0.3s ease;
}

.filter-sidebar:hover {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
  border-color: #e0e7ff;
}

/* Scrollbar styles removed - no scrolling */

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f1f5f9;
}

.filter-header h3 {
  font-size: 20px;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-header h3 i {
  font-size: 18px;
  color: #2563eb;
}

/* Filter Groups */
.filter-group {
  margin-bottom: 28px;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  transition: all 0.3s ease;
}

.filter-group:hover {
  border-color: #e0e7ff;
  transform: translateX(-4px);
}

.filter-group h4 {
  font-size: 16px;
  font-weight: 700;
  color: #334155;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group h4 i {
  font-size: 14px;
  color: #64748b;
}

/* Enhanced Input Fields */
.filter-group input[type="number"],
.filter-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  background: #ffffff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Cairo', sans-serif;
}

.filter-group input[type="number"]:focus,
.filter-group select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

/* Enhanced Buttons */
.btn-apply-filters,
.btn-reset-filters {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn-apply-filters {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-apply-filters::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-apply-filters:hover::before {
  width: 300px;
  height: 300px;
}

.btn-apply-filters:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
}

.btn-apply-filters:active {
  transform: translateY(0);
}

.btn-reset-filters {
  background: #ffffff;
  color: #64748b;
  border: 2px solid #e2e8f0;
}

.btn-reset-filters:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

/* Enhanced Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 20px;
  border: 2px dashed #e2e8f0;
  animation: fadeIn 0.5s ease-in-out;
}

.empty-icon {
  font-size: 80px;
  color: #cbd5e1;
  margin-bottom: 24px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.empty-state h3 {
  font-size: 24px;
  color: #1e293b;
  margin-bottom: 12px;
  font-weight: 800;
}

.empty-state p {
  color: #64748b;
  margin-bottom: 24px;
  font-size: 16px;
}

.empty-state .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.empty-state .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
}

/* Products Section Header */
.products-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.products-section-header h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 900;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.products-section-header h2 i {
  font-size: 24px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.results-count {
  padding: 8px 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Toggle Filters Button */
.btn-toggle-filters {
  display: none;
  padding: 10px 20px;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  gap: 8px;
  align-items: center;
  transition: all 0.3s ease;
}

.btn-toggle-filters:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

/* View All Button Enhancements */
.btn-view-all-categories {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: #2563eb;
  border: 2px solid #2563eb;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.btn-view-all-categories:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: white;
  transform: translateX(-4px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-view-all-categories i {
  transition: transform 0.3s ease;
}

.btn-view-all-categories:hover i {
  transform: translateX(-4px);
}

/* Loading State */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .filter-sidebar {
    position: static;
    max-height: none;
  }

  .btn-toggle-filters {
    display: flex;
  }

  .filter-sidebar.hidden {
    display: none;
  }
}

@media (max-width: 768px) {
  .section-header-enhanced {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .products-section-header {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .results-info {
    width: 100%;
    justify-content: space-between;
  }

  .filter-group {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .header-content h3 {
    font-size: 20px;
  }

  .products-section-header h2 {
    font-size: 18px;
  }

  .empty-state {
    padding: 60px 16px;
  }

  .empty-icon {
    font-size: 60px;
  }
}

/* Accessibility Improvements */
.filter-group input:focus,
.filter-group select:focus,
button:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .filter-sidebar,
  .btn-toggle-filters,
  .btn-favorite {
    display: none;
  }
}
