/* =========================================
   HANDYMANPRO.AI — COMPONENTS
   Reusable UI Patterns
   ========================================= */

/* ── Checklist Component ── */
.checklist { display: flex; flex-direction: column; gap: 10px; }

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--black-50);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.checklist-item:hover {
  background: var(--teal-50);
  border-color: var(--teal-200);
}

.checklist-item.checked {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--black-300);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  transition: var(--transition-fast);
  margin-top: 1px;
}

.checklist-item.checked .checkbox {
  background: var(--teal-500);
  border-color: var(--teal-500);
  color: white;
}

.checklist-item.checked .checkbox::after {
  content: '✓';
  font-size: 0.75rem;
  font-weight: 700;
}

.checklist-item.checked .checklist-text {
  text-decoration: line-through;
  color: var(--black-500);
}

.checklist-text { font-size: 0.9rem; line-height: 1.5; }

/* ── Progress Tracker ── */
.progress-tracker {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  padding: var(--space-xl);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.progress-title { font-weight: 700; }
.progress-count { font-size: 0.9rem; color: var(--teal-500); font-weight: 700; }

.progress-bar-track {
  height: 8px;
  background: var(--black-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-500), var(--teal-400));
  border-radius: var(--radius-full);
  transition: width 500ms var(--ease-out);
}

/* ── Accordion ── */
.accordion { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border); }

.accordion-item { border-bottom: 1px solid var(--color-border); }
.accordion-item:last-child { border-bottom: none; }

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: white;
  border: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: var(--transition-fast);
  gap: var(--space-md);
}

.accordion-trigger:hover { background: var(--black-50); }
.accordion-trigger.open { color: var(--teal-600); background: var(--teal-50); }

.accordion-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--black-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  transition: transform var(--transition-base), background var(--transition-base);
}

.accordion-trigger.open .accordion-icon {
  background: var(--teal-100);
  transform: rotate(45deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms var(--ease-out);
}

.accordion-content.open {
  max-height: 800px;
}

.accordion-body {
  padding: 16px 20px 20px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  background: white;
}

/* ── Material List ── */
.materials-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: var(--space-lg) 0;
}

.material-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.material-item:hover { border-color: var(--teal-300); background: var(--teal-50); }

.material-icon {
  font-size: 1.2rem;
  width: 30px;
  flex-shrink: 0;
  text-align: center;
}

.material-name { font-weight: 600; color: var(--color-text); }
.material-note { font-size: 0.75rem; color: var(--color-text-muted); }

/* ── Warning / Tip Callouts ── */
.callout {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  line-height: 1.6;
}

.callout-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-body h5 { font-size: 0.875rem; font-weight: 700; margin-bottom: 4px; }
.callout-body p { font-size: 0.875rem; }

.callout-tip {
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
}
.callout-tip .callout-body h5 { color: var(--teal-700); }
.callout-tip .callout-body p { color: var(--teal-700); }

.callout-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.callout-warning .callout-body h5 { color: #9a3412; }
.callout-warning .callout-body p { color: #9a3412; }

.callout-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.callout-danger .callout-body h5 { color: #991b1b; }
.callout-danger .callout-body p { color: #991b1b; }

.callout-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.callout-info .callout-body h5 { color: #1e40af; }
.callout-info .callout-body p { color: #1e40af; }

/* ── Tab System ── */
.tabs { /* Container */ }

.tab-list {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: var(--space-xl);
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn:hover { color: var(--teal-600); background: var(--teal-50); }

.tab-btn.active {
  color: var(--teal-600);
  border-bottom-color: var(--teal-500);
  background: var(--teal-50);
}

/* ── Category Pill Filter ── */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.filter-pill {
  padding: 7px 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: white;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-pill:hover { border-color: var(--teal-400); color: var(--teal-600); }

.filter-pill.active {
  background: var(--teal-500);
  border-color: var(--teal-500);
  color: white;
}

/* ── Info Card (Stat Box) ── */
.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: var(--space-xl);
  text-align: center;
  transition: var(--transition-base);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.stat-card-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--teal-500);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ── Search Bar ── */
.search-bar {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  padding: 6px 6px 6px 20px;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
  max-width: 560px;
  width: 100%;
}

.search-bar:focus-within {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20,184,166,.1), var(--shadow-md);
}

.search-icon { color: var(--black-400); font-size: 1.1rem; margin-right: 10px; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--color-text);
  background: transparent;
}

.search-input::placeholder { color: var(--black-400); }

.search-btn {
  background: var(--teal-500);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 9px 20px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.search-btn:hover { background: var(--teal-600); }

/* ── Before / After Slider ── */
.before-after {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  user-select: none;
}

.before-after-label {
  position: absolute;
  top: 12px;
  padding: 4px 12px;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  z-index: 3;
}

.ba-label-before { left: 12px; }
.ba-label-after  { right: 12px; }

/* ── Rating Stars ── */
.stars {
  display: flex;
  gap: 2px;
  color: var(--orange-400);
  font-size: 0.9rem;
}

.star-empty { color: var(--black-200); }

/* ── Notification Toast ── */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--black-900);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-up 300ms var(--ease-spring) both;
  border-left: 3px solid var(--teal-500);
  max-width: 320px;
}

.toast.toast-success { border-left-color: #4ade80; }
.toast.toast-warning { border-left-color: var(--orange-400); }
.toast.toast-error { border-left-color: #f87171; }

.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  font-size: 1rem;
  margin-left: auto;
  padding: 0;
  line-height: 1;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  animation: fade-in 200ms ease both;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: bounce-in 400ms var(--ease-spring) both;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--black-100);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover { background: var(--black-200); }

.modal-body { padding: var(--space-xl); }
.modal-footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* ── Pros/Cons ── */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.pros, .cons {
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.pros { background: #f0fdf4; border: 1px solid #bbf7d0; }
.cons { background: #fff1f2; border: 1px solid #fecdd3; }

.pros-header { color: #166534; font-weight: 700; margin-bottom: var(--space-md); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }
.cons-header { color: #9f1239; font-weight: 700; margin-bottom: var(--space-md); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }

.pros ul li, .cons ul li {
  font-size: 0.875rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.pros ul li::before { content: '✓'; font-weight: 700; color: #22c55e; flex-shrink: 0; }
.cons ul li::before { content: '✗'; font-weight: 700; color: #ef4444; flex-shrink: 0; }

.pros ul li:last-child, .cons ul li:last-child { border-bottom: none; }

/* ── Sticky CTA Bar ── */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--black-900);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 12px var(--space-xl);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.sticky-cta.visible { display: flex; animation: slide-up 300ms var(--ease-out) both; }
.sticky-cta-text { color: white; font-size: 0.875rem; }
.sticky-cta-text strong { color: var(--teal-400); }

/* ── Icon Grid ── */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-md);
}

.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: var(--space-lg) var(--space-md);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}

.icon-item:hover {
  border-color: var(--teal-400);
  background: var(--teal-50);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.icon-item .icon { font-size: 2rem; }
.icon-item .icon-label { font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); }
.icon-item:hover .icon-label { color: var(--teal-600); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .pros-cons { grid-template-columns: 1fr; }
  .search-bar { max-width: 100%; }
  .toast-container { bottom: var(--space-md); right: var(--space-md); left: var(--space-md); }
  .toast { max-width: 100%; }
  .modal { border-radius: var(--radius-lg); }
  .modal-overlay { padding: var(--space-md); }
}
