/* ==========================================================
   COMPONENTS DESIGN SYSTEM (UPDATED)
   ========================================================== */

/* Category Dropdown Selector & Filter Bar */
.category-dropdown-wrap {
  width: 100%;
  max-width: 680px;
  margin: 1.25rem auto 0;
}

.category-select-modern {
  width: 100%;
  padding: 0.85rem 2.5rem 0.85rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-medium);
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2218%22%20height%3D%2218%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23c36c6e%22%20stroke-width%3D%222.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.category-select-modern:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(195, 108, 110, 0.15);
}

/* Modern Search Box */
.search-container {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(195, 108, 110, 0.15), var(--shadow-lg);
}

.search-icon {
  color: var(--brand-accent);
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 500;
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-clear-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  margin-right: 0.25rem;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

.search-submit-btn {
  border-radius: var(--radius-full);
  padding: 0.6rem 1.25rem;
}

/* Quick Filter Pills Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  width: 100%;
}

@media (min-width: 640px) {
  .filter-group {
    width: auto;
  }
}

.filter-select {
  flex: 1 1 140px;
  padding: 0.55rem 2rem 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2214%22%20height%3D%2214%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23bf7e7b%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

/* Business Card */
.business-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.business-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-medium);
}

.card-header-media {
  position: relative;
  height: 140px;
  background-color: var(--brand-dark);
  overflow: hidden;
}

.card-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.business-card:hover .card-banner-img {
  transform: scale(1.04);
}

.card-badges-top {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.badge-featured {
  background: rgba(35, 27, 27, 0.85);
  backdrop-filter: blur(8px);
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-tower {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-subtle);
}

.card-favorite-btn {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  z-index: 5;
}

.card-favorite-btn:hover {
  transform: scale(1.1);
  color: #ef4444;
}

.card-favorite-btn.active {
  color: #ef4444;
  background-color: #ffffff;
}

.card-favorite-btn.active svg {
  fill: #ef4444;
}

.card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-business-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.badge-category {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  background-color: var(--brand-primary-light);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.card-title a:hover {
  color: var(--brand-primary);
}

.card-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.card-resident-info {
  font-size: 0.775rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

@media (max-width: 480px) {
  .card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .card-actions {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    width: 100%;
  }
  .card-actions .btn {
    width: 100%;
  }
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: #ef4444;
}

.form-control {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(195, 108, 110, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-primary);
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Schedule Quick Selection Pills */
.schedule-presets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 600px) {
  .schedule-presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.schedule-preset-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.schedule-preset-btn:hover {
  background: var(--brand-primary-light);
  border-color: var(--brand-primary-border);
  color: var(--brand-primary);
}

.schedule-preset-btn.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

/* Registration Form Mobile Button Bar Fix */
.form-actions-bar {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .form-actions-bar {
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
  }
  .form-actions-bar .btn {
    width: auto;
  }
}

.form-actions-bar .btn {
  width: 100%;
}

/* Modals & Dialogs */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 27, 27, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-backdrop.show .modal-content {
  transform: scale(1);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--brand-dark);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
  animation: toast-in 0.25s cubic-bezier(0.2, 0, 0, 1);
}

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

.toast.toast-success { border-left: 4px solid var(--color-success); }
.toast.toast-danger { border-left: 4px solid var(--color-danger); }
.toast.toast-info { border-left: 4px solid var(--brand-primary); }

/* Skeleton Loading State */
.skeleton {
  background: linear-gradient(90deg, #f7ede7 25%, #ebdcd5 37%, #f7ede7 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--border-medium);
  margin: 1.5rem 0;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto 1.5rem;
  font-size: 0.9rem;
}
