/* ============================================================
   WildGuard Society — Component Library (css/components.css)
   Cards, buttons, forms, badges, modals, alerts
   ============================================================ */

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn--primary {
  background: var(--accent);
  color: var(--darker);
  box-shadow: 0 4px 16px rgba(244, 162, 97, 0.28);
}

.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(244, 162, 97, 0.38);
}

.btn--secondary {
  background: var(--surface);
  color: var(--lighter);
  border: 1px solid var(--border-medium);
}

.btn--secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-medium);
}

.btn--ghost:hover {
  background: var(--surface-hover);
  color: var(--lighter);
}

.btn--danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
}

.btn--danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn--sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn--lg { padding: 1rem 2.5rem; font-size: 1.05rem; }
.btn--block { width: 100%; justify-content: center; }
.btn--icon { padding: 0.5rem; border-radius: 50%; }
.btn--round { border-radius: var(--radius-full); }

/* CTA button — used in hero area */
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.2rem;
  background: var(--accent);
  color: var(--darker);
  font-size: 0.98rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(244, 162, 97, 0.28);
  text-decoration: none;
}
.cta-button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(244, 162, 97, 0.38);
}
.cta-outline {
  background: transparent !important;
  border: 2px solid var(--accent) !important;
  color: var(--accent) !important;
}
.cta-outline:hover {
  background: var(--accent-soft) !important;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: rgba(255, 255, 255, 0.18);
}

.card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}

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

.card:hover .card-image img {
  transform: scale(1.06);
}

.card-body {
  padding: 1.5rem;
}

.card-body h3 {
  color: var(--lighter);
  margin-bottom: 0.5rem;
  font-size: var(--text-xl);
}

.card-body p {
  color: var(--text-dim);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Horizontal Card (image left + text right — used for conservation heroes) */
.card--horizontal {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.card--horizontal .card-image {
  height: 100%;
  min-height: 220px;
}

.card--horizontal .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 600px) {
  .card--horizontal {
    grid-template-columns: 1fr;
  }
  .card--horizontal .card-image {
    height: 180px;
  }
}

/* Feature Card (icon-based, no image) */
.feature-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent);
  font-size: 1.4rem;
}

.feature-card h3 {
  color: var(--lighter);
  margin-bottom: 0.6rem;
  font-size: var(--text-xl);
}

.feature-card p {
  color: var(--text-dim);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* Stat Card (metric display) */
.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 0.25rem;
}

.stat-label {
  color: var(--text-dim);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Horizontal Scrolling Carousel (Chester Zoo inspired) */
.h-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.h-scroll::-webkit-scrollbar { height: 6px; }
.h-scroll::-webkit-scrollbar-track { background: transparent; }
.h-scroll::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

.h-scroll > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: 280px;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

.form-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  backdrop-filter: blur(10px);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.4rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: var(--lighter);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.form-select {
  cursor: pointer;
}
.form-select option {
  background: var(--darker);
  color: var(--lighter);
}

.form-input.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-error-text {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════
   BADGES — printed field-guide / ranger tags
   A paper card tag: status ribbon on the left edge, punched tie-hole
   at the top, aged stock texture. Ink-dark text on paper.
   ═══════════════════════════════════════════════════════════════ */

.badge {
  --badge-c: var(--accent);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem 0.28rem 1.05rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  line-height: 1.35;
  color: #33291c;
  background:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.025) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #fbf4e4 0%, #ecdfc3 100%);
  box-shadow: 0 3px 8px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.8);
}

/* status ribbon (left edge) */
.badge::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--badge-c);
  border-radius: 3px 0 0 3px;
}

/* punched tie-hole */
.badge::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--darker, #0f1f17);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.35), 0 0 0 1.5px rgba(80,62,36,0.55);
}

.badge--accent { --badge-c: var(--accent); }
.badge--success { --badge-c: #3fa34d; }
.badge--warning { --badge-c: #d9a021; }
.badge--danger { --badge-c: #d64545; }
.badge--info { --badge-c: #5b8db8; }

/* Conservation status tags */
.badge--least-concern { --badge-c: #3fa34d; }
.badge--near-threatened { --badge-c: #d9b23a; }
.badge--vulnerable { --badge-c: #e07a3c; }
.badge--endangered { --badge-c: #d64545; }
.badge--critically-endangered { --badge-c: #a91d1d; }

/* ═══════════════════════════════════════════════════════════════
   EYEBROW / PAGE BANNER
   ═══════════════════════════════════════════════════════════════ */

.eyebrow {
  display: inline-block;
  padding: 0.3rem 1rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent-glass);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.8rem;
}

.page-banner {
  text-align: center;
  padding: 6rem 2rem 4rem;
  color: var(--lighter);
  position: relative;
  background: linear-gradient(180deg, rgba(8,18,12,0.5) 0%, rgba(8,18,12,0.7) 50%, rgba(8,18,12,0.85) 100%);
}

.page-banner h1 {
  font-family: var(--font-heading);
  color: var(--lighter);
  margin-bottom: 0.8rem;
  font-size: var(--text-3xl);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.page-banner .lede {
  font-size: var(--text-lg);
  max-width: 560px;
  margin: 0 auto;
  opacity: 0.88;
  line-height: 1.7;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* ═══════════════════════════════════════════════════════════════
   MODAL / DIALOG
   ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--darker);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: var(--transition);
}

.modal-close:hover { color: var(--lighter); }

/* ═══════════════════════════════════════════════════════════════
   TOAST / NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--darker);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  color: var(--lighter);
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease-out;
  min-width: 280px;
  max-width: 420px;
}

.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--warning { border-left: 3px solid var(--warning); }
.toast--info { border-left: 3px solid var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-out { animation: toastOut 0.3s ease forwards; }

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADER
   ═══════════════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(90deg, 
    var(--surface) 25%, 
    var(--surface-hover) 50%, 
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 2s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton--text { height: 1rem; margin-bottom: 0.5rem; }
.skeleton--title { height: 1.5rem; width: 60%; margin-bottom: 1rem; }
.skeleton--card { height: 200px; border-radius: var(--radius); }
.skeleton--round { border-radius: 50%; }

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-dim);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  color: var(--lighter);
  margin-bottom: 0.5rem;
}

.empty-state p { max-width: 400px; margin: 0 auto 1.5rem; }

/* ═══════════════════════════════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════════════════════════════ */

.divider {
  border: 0;
  height: 1px;
  background: var(--border-subtle);
  margin: 1.5rem 0;
}

/* ═══════════════════════════════════════════════════════════════
   DARK / LIGHT MODE TOGGLE
   ═══════════════════════════════════════════════════════════════ */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-dim);
  font-size: 1rem;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--accent);
}

/* ── Responsive Adjustments ── */
@media (max-width: 768px) {
  .form-container { padding: 1.5rem; }
  .btn { padding: 0.75rem 1.5rem; }
}