/* === COMPONENTS.CSS === */
/* Reusable UI components: cards, buttons, inputs, badges, banners */

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-base), transform var(--transition-base),
              background-color var(--transition-theme), border-color var(--transition-theme);
}

.card--hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card--solar {
  border-top: 3px solid var(--accent-solar);
}

.card--3dprint {
  border-top: 3px solid var(--accent-3dprint);
}

.card__icon {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-3);
}

.card__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.card__description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.card__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.card__list-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.card__list-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.card--solar .card__list-item::before {
  background: var(--accent-solar);
}

.card--3dprint .card__list-item::before {
  background: var(--accent-3dprint);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  border: 1.5px solid var(--text-primary);
}

.btn--primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: var(--bg-card);
  border: 1.5px solid var(--border-secondary);
  color: var(--text-primary);
}

.btn--secondary:hover {
  border-color: var(--text-tertiary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.btn--solar {
  background: var(--accent-solar-gradient);
  color: #1A1D2E;
}

.btn--solar:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn--3dprint {
  background: var(--accent-3dprint-gradient);
  color: #FFFFFF;
}

.btn--3dprint:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--border-secondary);
  color: var(--text-primary);
}

.btn--outline:hover {
  border-color: var(--text-tertiary);
  background: var(--bg-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
}

.btn--ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
}

.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.btn--full {
  width: 100%;
}

/* ─── Form Inputs ─── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.form-sublabel {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 400;
}

.form-input,
.form-select,
.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  background: var(--bg-input);
  border: 1.5px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
              background-color var(--transition-theme);
  outline: none;
}

.input--sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.form-input:focus,
.form-select:focus,
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239BA1B7' d='M6 8.825a.5.5 0 0 1-.354-.146l-4-4a.5.5 0 0 1 .708-.708L6 7.617l3.646-3.646a.5.5 0 0 1 .708.708l-4 4A.5.5 0 0 1 6 8.825z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ─── Range Slider ─── */
.form-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border-primary);
  outline: none;
  transition: background var(--transition-theme);
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-solar);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-solar);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}

.range-value {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  min-width: 3ch;
  text-align: right;
}

/* ─── Checkbox / Toggle ─── */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.checkbox-group:hover {
  background: var(--bg-hover);
}

.checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-solar);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  flex: 1;
}

.checkbox-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ─── Toggle Switch ─── */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-secondary);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent-solar);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge--danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.badge--solar {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-solar);
}

.badge--3dprint {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-3dprint);
}

/* ─── Result Display ─── */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  transition: background-color var(--transition-theme), border-color var(--transition-theme);
}

.result-card__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-1);
}

.result-card__value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  transition: color var(--transition-fast);
}

.result-card__unit {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.result-card--success { border-color: var(--color-success); }
.result-card--success .result-card__value { color: var(--color-success); }

.result-card--warning { border-color: var(--color-warning); }
.result-card--warning .result-card__value { color: var(--color-warning); }

.result-card--danger { border-color: var(--color-danger); }
.result-card--danger .result-card__value { color: var(--color-danger); }

/* ─── Breadcrumbs ─── */
.breadcrumbs {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  padding-block: var(--space-4);
  width: 100%;
}

.breadcrumbs__list {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: var(--space-2) !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.breadcrumbs__item {
  display: inline-flex !important;
  align-items: center !important;
  font-size: var(--text-sm);
  list-style: none !important;
}

.breadcrumbs__separator,
.breadcrumbs__sep {
  display: inline-flex !important;
  align-items: center !important;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  opacity: 0.5;
  user-select: none;
  list-style: none !important;
}

.breadcrumbs a,
.breadcrumbs__link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumbs a:hover,
.breadcrumbs__link:hover {
  color: var(--text-primary);
}

.breadcrumbs__current {
  color: var(--text-primary);
  font-weight: 600;
}

/* ─── Modern Data Tables ─── */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: var(--text-sm);
}

.table th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-primary);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover td {
  background: var(--bg-hover);
}

/* ─── FAQ / Accordions ─── */
.faq-accordion,
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.faq-item {
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  overflow: hidden;
  margin-bottom: var(--space-3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: border-color var(--transition-theme), background-color var(--transition-theme), box-shadow var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.faq-item summary {
  padding: var(--space-5) var(--space-6);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:hover {
  background: var(--bg-hover);
}

.faq-item summary::after {
  content: '+';
  font-size: var(--text-lg);
  font-weight: 600;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.faq-item[open] {
  border-color: var(--border-focus);
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border-primary);
}

.faq-item[open] summary::after {
  content: '−';
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-solar);
}

.faq-item__answer {
  padding: var(--space-5) var(--space-6);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.8;
  background: var(--bg-primary);
}

/* ─── Trust Bar ─── */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-6);
  border-top: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.trust-item__icon {
  font-size: var(--text-lg);
}

/* ─── Guide Article Card ─── */
.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base),
              background-color var(--transition-theme);
}

.guide-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.guide-card__accent {
  height: 4px;
}

.guide-card__accent--solar {
  background: var(--accent-solar-gradient);
}

.guide-card__accent--3dprint {
  background: var(--accent-3dprint-gradient);
}

.guide-card__body {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.guide-card__badge {
  margin-bottom: var(--space-3);
}

.guide-card__title {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

.guide-card__excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  flex: 1;
}

.guide-card__link {
  font-size: var(--text-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: gap var(--transition-fast);
}

.guide-card__link:hover {
  gap: var(--space-2);
}

.guide-card__link--solar {
  color: var(--accent-solar);
}

.guide-card__link--3dprint {
  color: var(--accent-3dprint);
}
