/**
 * Taimelamp Smart Filter System Styles
 * Pro-level filtering with progressive disclosure
 */

/* Smart Filter Section */
.tl-smart-filters {
  background: linear-gradient(135deg, #8fbc8f 0%, #98d982 50%, #a8e6a3 100%);
  color: #2d4a2d;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.tl-smart-filters::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="10" cy="10" r="1" fill="rgba(144,238,144,0.1)"/><circle cx="90" cy="90" r="1.5" fill="rgba(144,238,144,0.08)"/><circle cx="20" cy="80" r="0.8" fill="rgba(144,238,144,0.06)"/></svg>');
  animation: float 20s ease-in-out infinite;
}

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

.tl-smart-filters .tl-section__title {
  color: #1a4a1a;
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
  font-weight: 700;
}

.tl-smart-filters .tl-section__lead {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 3rem;
  opacity: 1;
  color: #2d5a2d;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.7);
  font-weight: 500;
}

/* Experience Selector */
.experience-selector {
  margin-bottom: 3rem;
  position: relative;
  z-index: 10;
}

.experience-selector h3 {
  text-align: center;
  color: #1a4a1a;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.experience-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.experience-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid transparent;
  border-radius: 20px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-align: left;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.experience-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s ease;
}

.experience-btn:hover::before {
  left: 100%;
}

.experience-btn:hover {
  transform: translateY(-8px);
  border-color: #4CAF50;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  background: rgba(76, 175, 80, 0.05);
}

.experience-btn:hover .experience-content strong {
  color: #1a4a1a !important;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.experience-btn:hover .experience-content span {
  color: #2d5a2d !important;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
}

.experience-btn:hover .experience-content small {
  color: #333 !important;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
}

.experience-btn.active {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.1);
  transform: translateY(-5px);
}

.experience-icon {
  font-size: 3rem;
  min-width: 80px;
  text-align: center;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.1);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.experience-btn:hover .experience-icon {
  background: rgba(76, 175, 80, 0.2);
  transform: scale(1.05);
}

.experience-content strong {
  display: block;
  font-size: 1.4rem;
  color: #1a4a1a;
  margin-bottom: 0.5rem;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
  transition: all 0.3s ease;
}

.experience-content span {
  display: block;
  color: #2d5a2d;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
  transition: all 0.3s ease;
}

.experience-content small {
  color: #666;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
  transition: all 0.3s ease;
}

/* Brand Selection */
.brand-selection {
  margin-bottom: 3rem;
  position: relative;
  z-index: 10;
}

.brand-selection h3 {
  text-align: center;
  color: #1a4a1a;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.brand-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.brand-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid transparent;
  border-radius: 15px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.brand-btn:hover {
  transform: translateY(-5px);
  border-color: #4CAF50;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  background: rgba(76, 175, 80, 0.05);
}

.brand-btn:hover .brand-logo strong {
  color: #1a4a1a !important;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.brand-btn:hover .brand-info .product-count {
  color: #2e7d32 !important;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
}

.brand-btn:hover .brand-info small {
  color: #333 !important;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
}

.brand-btn.active {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.1);
}

.brand-logo strong {
  display: block;
  font-size: 1.3rem;
  color: #1a4a1a;
  margin-bottom: 0.5rem;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
  transition: all 0.3s ease;
}

.brand-info .product-count {
  display: block;
  color: #4CAF50;
  font-weight: 600;
  font-size: 1.1rem;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
  transition: all 0.3s ease;
}

.brand-info small {
  color: #666;
  font-size: 0.9rem;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.6);
  transition: all 0.3s ease;
}

/* Perfect Match Indicator */
.perfect-match-indicator {
  background: rgba(76, 175, 80, 0.9);
  border-radius: 15px;
  padding: 1.5rem;
  margin: 2rem auto;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
  animation: pulse 2s infinite;
}

.perfect-match-indicator .match-content {
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
}

.perfect-match-indicator i {
  margin-right: 0.5rem;
  font-size: 1.5rem;
}

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

/* Advanced Toggle */
.advanced-toggle {
  text-align: center;
  margin: 3rem 0;
  position: relative;
  z-index: 10;
}

.toggle-advanced-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(76, 175, 80, 0.3);
  border-radius: 25px;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  color: #1a4a1a;
  font-weight: 600;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.toggle-advanced-btn:hover {
  background: #4CAF50;
  border-color: #4CAF50;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.toggle-advanced-btn:hover .toggle-text {
  color: white !important;
}

.toggle-advanced-btn i {
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.toggle-advanced-btn.active {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.toggle-advanced-btn.active .toggle-text {
  color: white !important;
}

.toggle-advanced-btn.active i {
  transform: rotate(180deg);
}

/* Advanced Filters */
.filter-mode-advanced {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
  position: relative;
  z-index: 10;
}

.advanced-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.filter-group label {
  display: block;
  font-weight: 600;
  color: #1a4a1a;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.size-options,
.wattage-options,
.series-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.size-btn,
.wattage-btn,
.series-btn {
  background: #f5f5f5;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.size-btn:hover,
.wattage-btn:hover,
.series-btn:hover {
  background: #e8f5e8;
  border-color: #4CAF50;
}

.size-btn.active,
.wattage-btn.active,
.series-btn.active {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

/* Price Range */
.price-range {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.price-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  margin: 1rem 0;
}

.price-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.price-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.price-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #666;
}

#price-value {
  background: #4CAF50;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-weight: 600;
}

/* Admin Filters */
.admin-filters {
  border-top: 1px solid #ddd;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.admin-filters h4 {
  color: #1a4a1a;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.status-filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.status-filters label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: normal;
  color: #666;
  margin-bottom: 0;
}

.status-filters input[type="checkbox"] {
  margin: 0;
}

/* FiboSearch Integration */
.fibosearch-container {
  margin: 3rem 0;
  position: relative;
  z-index: 10;
}

.search-wrapper {
  margin: 0 auto;
  max-width: 600px;
  position: relative;
}

.search-wrapper .dgwt-wcas-search-wrapp {
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  border-radius: 50px;
  overflow: hidden;
  background: white;
  transition: all 0.3s ease;
}

.search-wrapper .dgwt-wcas-search-wrapp:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 70px rgba(0,0,0,0.4);
}

.search-wrapper .dgwt-wcas-search-input {
  border: none !important;
  padding: 20px 60px 20px 25px !important;
  font-size: 18px !important;
  border-radius: 50px !important;
  background: white !important;
  color: #333 !important;
}

.search-wrapper .dgwt-wcas-search-input:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(107, 142, 35, 0.3) !important;
}

/* Filter Results */
.filter-results {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 2rem;
  margin-top: 3rem;
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
  position: relative;
  z-index: 10;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-header h3 {
  color: #1a4a1a;
  margin: 0;
  font-size: 1.5rem;
}

.clear-filters {
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.clear-filters:hover {
  background: #ff5252;
  transform: translateY(-2px);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.product-card.perfect-match {
  border: 3px solid #4CAF50;
  box-shadow: 0 10px 25px rgba(76, 175, 80, 0.2);
}

.product-card.perfect-match::before {
  content: '✅ Täiuslik valik!';
  position: absolute;
  top: 10px;
  right: 10px;
  background: #4CAF50;
  color: white;
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-weight: 600;
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 1rem;
  background: #f9f9f9;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a4a1a;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.spec-badge {
  background: #e8f5e8;
  color: #2e7d32;
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #4CAF50;
  margin-bottom: 1rem;
}

.stock-badge {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
  min-height: 1.2rem;
}

.stock-badge.in-stock {
  color: #4CAF50;
}

.stock-badge.low-stock {
  color: #ff9800;
}

.stock-badge.out-of-stock {
  display: none !important;
}

.stock-badge:empty {
  display: none !important;
}

.stock-badge:not(.in-stock):not(.low-stock) {
  display: none !important;
}

/* Ensure no phantom elements */
.product-card .stock-badge:empty + .product-actions {
  margin-top: 1rem;
}

.product-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.btn-view-product {
  flex: 1;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  display: inline-block;
}

.btn-view-product:hover {
  background: #45a049;
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

.btn-compare {
  background: #f8f8f8;
  color: #4CAF50;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.5rem 0.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 50px;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.btn-compare::before {
  content: "⚖";
  font-size: 14px;
  font-weight: bold;
  display: block;
  line-height: 1;
  margin-bottom: 2px;
}

.btn-compare::after {
  content: "Võrdle";
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  line-height: 1;
}

.btn-compare i {
  display: none;
}

.btn-compare:hover {
  background: #e8f5e8;
  border-color: #4CAF50;
  color: #2e7d2e;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.btn-compare.active {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
  box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.btn-compare.active::before,
.btn-compare.active::after {
  color: white;
}

.results-loading {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.results-loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #4CAF50;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .tl-smart-filters {
    padding: 60px 0;
  }

  .tl-smart-filters .container {
    padding: 0 1rem;
    overflow-x: hidden;
  }

  .tl-smart-filters .tl-section__title {
    font-size: 2rem;
  }

  .experience-filters {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .experience-btn {
    padding: 1.5rem;
    gap: 1rem;
  }

  .experience-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    font-size: 2rem;
  }

  .brand-filters {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-mode-advanced {
    margin: 2rem -1rem;
    padding: 1.5rem 1rem;
    border-radius: 15px;
    overflow-x: hidden;
  }

  .advanced-filters-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .filter-group {
    width: 100%;
    overflow: hidden;
  }

  .price-range {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 0.5rem;
  }

  .price-slider {
    width: calc(100% - 20px);
    margin-left: 10px;
    margin-right: 10px;
  }

  .size-options,
  .wattage-options,
  .series-options {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
  }

  .size-btn,
  .wattage-btn,
  .series-btn {
    flex: 0 0 auto;
    min-width: 80px;
    min-height: 44px; /* Touch-friendly */
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .results-header {
    flex-direction: column;
    text-align: center;
  }

  .status-filters {
    flex-direction: column;
    gap: 0.5rem;
  }

  .filter-results {
    margin: 3rem -1rem 0;
    padding: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .experience-btn {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .experience-content {
    text-align: center;
  }

  .filter-mode-advanced {
    padding: 1rem;
    margin: 2rem -0.5rem;
    overflow: hidden;
  }

  .price-range {
    padding: 0 0.25rem;
  }

  .price-slider {
    width: calc(100% - 10px);
    margin-left: 5px;
    margin-right: 5px;
  }

  .product-card {
    padding: 1rem;
  }

  .product-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-view-product,
  .btn-compare {
    width: 100%;
    justify-content: center;
  }

  .tl-smart-filters .container {
    padding: 0 0.5rem;
  }

  .size-options,
  .wattage-options,
  .series-options {
    margin: 0;
    padding: 0;
    gap: 0.4rem;
  }

  .size-btn,
  .wattage-btn,
  .series-btn {
    min-width: 70px;
    padding: 0.5rem 0.6rem;
    font-size: 0.8rem;
  }

  .filter-results {
    margin: 3rem -0.5rem 0;
    padding: 1.5rem 0.5rem;
  }
}

/* Floating Compare Button */
.floating-compare-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  display: none;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.floating-compare-btn.visible {
  transform: translateY(0);
  opacity: 1;
}

.btn-floating-compare {
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 15px 25px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  min-height: 60px;
}

.btn-floating-compare:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(76, 175, 80, 0.4);
}

.compare-icon {
  font-size: 20px;
}

.compare-text {
  white-space: nowrap;
}

.compare-count {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 14px;
  font-weight: bold;
}

@media (max-width: 768px) {
  .floating-compare-btn {
    bottom: 20px;
    right: 20px;
  }

  .btn-floating-compare {
    padding: 12px 20px;
    font-size: 14px;
    min-height: 50px;
  }

  .compare-icon {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .btn-floating-compare {
    padding: 10px 16px;
    font-size: 13px;
  }

  .compare-text {
    font-size: 13px;
  }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.slide-down {
  animation: slideDown 0.3s ease-out;
}

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

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}