/**
 * Customers Advanced Filtering Styles
 * Premium filtering UI for customer management
 */

:root {
  --customers-accent: #fff947;
}

/* ============================================
   Toolbar Container
   ============================================ */
.customers-toolbar {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

/* ============================================
   Search Row
   ============================================ */
.customers-search-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.customers-search-wrapper {
  flex: 1;
  position: relative;
  min-width: 200px;
}

.customers-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 2.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fafafa;
  transition: all 0.2s ease;
}

.customers-search-input:focus {
  outline: none;
  border-color: var(--customers-accent);
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--customers-accent) 20%, transparent);
}

.customers-search-input::placeholder {
  color: #9ca3af;
}

.customers-search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  font-size: 0.875rem;
}

.customers-search-input:focus + .customers-search-icon {
  color: var(--customers-accent);
}

/* ============================================
   Filter Toggle Button
   ============================================ */
.customers-filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.customers-filter-toggle:hover {
  border-color: var(--customers-accent);
  color: var(--customers-accent);
  background: #fffbf5;
}

.customers-filter-toggle.active {
  border-color: var(--customers-accent);
  background: linear-gradient(135deg, var(--customers-accent) 0%, var(--customers-accent) 100%);
  color: #0b0b0b;
}

.customers-filter-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Reservations: center selected category text (keep options natural) */
.reservations-category-filter select {
  text-align: center;
  text-align-last: center;
}

/* ============================================
   Refresh Button
   ============================================ */
.customers-refresh-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.customers-refresh-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}

.customers-refresh-btn:active .fa-sync-alt {
  animation: spin 0.5s ease-in-out;
}

/* ============================================
   Customers CTA overrides
   ============================================ */
#customers-section .section-header-actions .holded-button-primary,
#customers-section #addCustomerBtn {
  background: var(--honey) !important;
  border-color: var(--honey) !important;
  color: var(--charcoal) !important;
  box-shadow: 0 14px 24px -14px rgba(255, 249, 71, 0.3) !important;
}
#customers-section .section-header-actions .holded-button-primary:hover,
#customers-section #addCustomerBtn:hover {
  background: var(--honey) !important;
  filter: brightness(1.02);
  transform: translateY(-1px);
}

/* Customer card name hover effect */
.customer-card-enhanced.group:hover h3 {
  background-color: var(--honey);
  color: var(--charcoal);
}

/* Offering card name hover effect */
.group:hover h3.font-semibold.text-heading.text-lg {
  background-color: var(--honey);
  color: var(--charcoal);
}

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

/* ============================================
   Filters Panel
   ============================================ */
.customers-filters-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  animation: slideDown 0.2s ease-out;
}

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

.customers-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

/* ============================================
   Filter Group
   ============================================ */
.customers-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.customers-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.customers-filter-select {
  padding: 0.5rem 0.75rem;
  padding-right: 2rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.875rem;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s 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 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.customers-filter-select:focus {
  outline: none;
  border-color: var(--honey);
  box-shadow: 0 0 0 2px rgba(255, 249, 71, 0.1);
}

.customers-filter-select:hover {
  border-color: #d1d5db;
}

/* Highlight active filters */
.customers-filter-select.has-value {
  border-color: var(--honey);
  background-color: var(--primary-light);
}

/* ============================================
   Filter Actions
   ============================================ */
.customers-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #e5e7eb;
}

.customers-clear-filters-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.customers-clear-filters-btn:hover {
  background: #fef2f2;
  color: #ef4444;
}

.customers-results-count {
  font-size: 0.8rem;
  color: #6b7280;
}

.customers-results-count strong {
  color: #374151;
  font-weight: 600;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
  .customers-search-row {
    flex-wrap: wrap;
  }

  .customers-search-wrapper {
    width: 100%;
    order: 1;
  }

  .customers-filter-toggle,
  .customers-refresh-btn {
    flex: 1;
    justify-content: center;
    order: 2;
  }

  .customers-filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .customers-filter-actions {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .customers-filters-grid {
    grid-template-columns: 1fr;
  }

  .customers-toolbar {
    padding: 0.75rem;
  }
}

/* ============================================
   Customer Card Enhancements (Tags)
   ============================================ */
.customer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.customer-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 500;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.customer-tag.tag-newsletter {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.customer-tag.tag-vip {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.customer-tag.tag-new {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}
