/**
 * components.css — Reusable UI Components for the v2 Public Site
 *
 * Loaded on every page via base.html. Contains components that appear
 * on 2+ pages. All values use CSS custom properties from tokens.css.
 *
 * Does NOT contain: nav, footer, or page-specific styles.
 *
 * Sections:
 *   - Buttons
 *   - Read More Link
 *   - Screenshot Containers
 *   - Form Inputs & Groups
 *   - Form Errors
 *   - Pills (tag-pill, channel-pill)
 *   - Card Base
 *   - Empty State
 */

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

/* Primary: filled navy, used for main CTAs */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px; /* Figma: py:8px px:20px */
  background: var(--navy);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast);
}

.btn-primary:hover {
  background: var(--navy-hover);
  transform: translateY(-1px);
}

/* Outline: bordered navy, used for secondary CTAs */
.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border: 1px solid var(--navy);
  color: var(--navy);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  border-radius: 10px;
  transition: background var(--transition-fast);
}

.btn-outline:hover {
  background: rgba(35, 44, 91, 0.05);
}

/* Ghost: no background/border, used for subtle actions */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  color: var(--navy);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  border-radius: 10px;
}

.btn-ghost:hover {
  opacity: 0.7;
}

/* Light: white fill, used on dark backgrounds */
.btn-primary-light {
  display: inline-flex;
  align-items: center;
  padding: 12px 26px;
  background: #fff;
  color: var(--navy-dark);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  transition: transform var(--transition-fast);
}

.btn-primary-light:hover {
  transform: translateY(-1px);
}

/* Outline White: used on dark hero backgrounds */
.btn-outline-white {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1px solid #fff;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  border-radius: 10px;
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ─── Read More Link ─────────────────────────────────────────────────────── */

/* Used on blog listings and post footers */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  text-decoration: underline;
  color: var(--text-dark);
  margin-top: auto;
  transition: opacity var(--transition-fast);
}

.read-more:hover {
  opacity: 0.7;
}

.read-more svg {
  width: 14px;
  height: 14px;
  transform: rotate(-90deg);
}

/* ─── Screenshot Containers ─────────────────────────────────────────────── */

/* Dark container for product screenshots on the public site.
   Creates contrast against light page backgrounds. */
.screenshot-container {
  background: var(--bg-dark);
  border: 1px solid #1f1f1f;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
  overflow: hidden;
}

/* Dashed placeholder shown before real screenshots are added */
.screenshot-placeholder {
  border: 2px dashed #2a2a2a;
  border-radius: 10px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  width: 100%;
}

/* ─── Form Groups ─────────────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(35, 44, 91, 0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-secondary);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Custom select arrow */
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* Two-column form row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Full-width submit button */
.form-submit {
  width: 100%;
  padding: 14px 24px;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast);
}

.form-submit:hover {
  background: var(--navy-hover);
  transform: translateY(-1px);
}

/* Fine print below form */
.form-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
  text-align: center;
}

/* Form success state */
.form-success {
  display: none;
  text-align: center;
  padding: 60px 20px;
}

.form-success.show {
  display: block;
}

.form-success svg {
  width: 48px;
  height: 48px;
  color: var(--green);
  margin: 0 auto 20px;
}

.form-success h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 12px;
}

.form-success p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto;
}

/* ─── Form Errors ────────────────────────────────────────────────────────── */

/* Django form error state on a group */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

/* Inline error message below the field */
.form-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--error);
  font-weight: 500;
}

/* Django's default errorlist (rendered as <ul class="errorlist">) */
ul.errorlist {
  list-style: none;
  margin-top: 6px;
}

ul.errorlist li {
  font-size: 13px;
  color: var(--error);
  font-weight: 500;
}

/* ─── Pills ──────────────────────────────────────────────────────────────── */

/* Tag pill — used in blog sidebar and article tags */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--accent-bg);
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--accent);
  transition: transform var(--transition-fast);
}

.tag-pill:hover {
  transform: translateY(-1px);
}

/* Channel pill — used in platform page channel list */
.channel-pill {
  background: var(--accent-bg);
  border-radius: 10px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--accent);
  transition: transform var(--transition-fast);
}

.channel-pill:hover {
  transform: translateY(-2px);
}

.channel-pill svg {
  width: 24px;
  height: 24px;
}

/* ─── Card Base ───────────────────────────────────────────────────────────── */

/* Base card surface — extend with page-specific styles in pages/*.css */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-medium);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}

/* ─── Empty State ────────────────────────────────────────────────────────── */

/* Graceful empty content placeholder for lists, feeds, and grids */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
  max-width: 360px;
}
