:root {
  /* Brand Colors */
  --color-brand-50:  #f2f8fd;
  --color-brand-100: #deedf9;
  --color-brand-200: #c4def3;
  --color-brand-300: #9fc8ea;
  --color-brand-400: #76afde;
  --color-brand-500: #4f95d1;
  --color-brand-600: #2b7dbc;
  --color-brand-700: #23679f;
  --color-brand-800: #1f5685;
  --color-brand-900: #1e486f;

  /* POP brand aliases (blue-first; purple aliases kept for compatibility) */
  --pop-blue: #2b7dbc;
  --pop-blue-light: #deedf9;
  --pop-purple: var(--pop-blue);
  --pop-purple-light: var(--pop-blue-light);
  --pop-slate: #111827;
  --pop-muted: #64748b;
  --pop-accent-warm: #f28c34;
  --pop-accent-green: #2e9f6b;
  --pop-card-border: rgba(15, 23, 42, 0.12);
  --pop-success: var(--pop-accent-green);
  --pop-warning: var(--pop-accent-warm);
  --pop-error: #ef4444;
  --pop-focus-ring: rgba(43, 125, 188, 0.18);
  --pop-focus-ring-strong: rgba(43, 125, 188, 0.30);

  /* Neutral tones */
  --color-surface: #ffffff;
  --color-surface-alt: #f9fafb;
  --color-border: #e5e7eb;
  --color-text-primary: #111827;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;

  /* Typography */
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

/* Active nav link */
.nav-link.active {
  color: var(--color-brand-600);
}

/* Page transition */
#page-content {
  animation: fadeIn 0.15s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Hide scrollbar for cleaner mobile look */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

.pop-card {
  background: #ffffff;
  border: 1px solid var(--pop-card-border);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
}

.pop-card--soft {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.pop-card--accent {
  border-color: rgba(43, 125, 188, 0.35);
  box-shadow: 0 16px 36px rgba(43, 125, 188, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
}

.pop-card--interactive {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pop-card--interactive:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.pop-card--interactive:focus-within {
  box-shadow: 0 0 0 4px var(--pop-focus-ring), 0 10px 24px rgba(15, 23, 42, 0.10);
}

.pop-card--safe {
  border-color: rgba(43, 125, 188, 0.18);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.10);
  background: linear-gradient(180deg, #ffffff 0%, #f3f9ff 100%);
}

.pop-card--interactive.pop-card--safe:hover {
  border-color: rgba(43, 125, 188, 0.32);
  box-shadow: 0 18px 40px rgba(43, 125, 188, 0.12), 0 18px 40px rgba(15, 23, 42, 0.10);
}

.pop-card--interactive.pop-card--safe:focus-within {
  border-color: rgba(43, 125, 188, 0.42);
  box-shadow: 0 0 0 4px rgba(43, 125, 188, 0.12), 0 12px 26px rgba(15, 23, 42, 0.10);
}

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

.pop-button-primary {
  background: var(--pop-purple);
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--pop-purple);
  box-shadow: 0 10px 20px rgba(43, 125, 188, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.pop-button-primary:hover {
  background: var(--color-brand-700);
  transform: translateY(-1px);
}

.pop-button-primary:active {
  transform: translateY(0);
}

.pop-button-primary:focus-visible {
  box-shadow: 0 0 0 4px var(--pop-focus-ring-strong), 0 10px 20px rgba(43, 125, 188, 0.35);
}

.pop-button-outline {
  border: 1px solid var(--color-brand-300);
  color: var(--pop-purple);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.pop-button-outline:hover {
  background: var(--pop-purple-light);
}

.pop-button-outline:focus-visible {
  box-shadow: 0 0 0 4px var(--pop-focus-ring-strong), 0 6px 16px rgba(43, 125, 188, 0.10);
}

.pop-button-ghost {
  border: 1px solid #e2e8f0;
  color: #475569;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.pop-button-ghost:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.pop-button-ghost:focus-visible {
  box-shadow: 0 0 0 4px var(--pop-focus-ring-strong), 0 6px 16px rgba(15, 23, 42, 0.08);
}

.pop-button-sm {
  padding: 8px 14px;
  font-size: 12px;
  min-height: 44px;
}

/* ═══════════════════════════════════════════════════════════════════
   CHIPS & TAGS
   ═══════════════════════════════════════════════════════════════════ */

.pop-chip {
  border: 1px solid #e2e8f0;
  background: #f3f4f6;
  color: #374151;
  border-radius: 999px;
  font-size: 12px;
  padding: 8px 14px;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.pop-chip--wrap {
  white-space: normal;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  height: auto;
}

.pop-chip:hover {
  border-color: var(--color-brand-300);
  color: var(--pop-purple);
}

.pop-chip:focus-visible {
  box-shadow: 0 0 0 4px var(--pop-focus-ring);
  border-color: rgba(43, 125, 188, 0.55);
}

.pop-chip--filter.is-active {
  border-color: var(--pop-purple);
  color: var(--pop-purple);
  background: var(--color-brand-50);
}

.pop-chip--status {
  border-color: #cbd5f5;
  color: var(--color-brand-900);
  background: var(--pop-purple-light);
  cursor: default;
}

.pop-chip--status[data-status='in-progress'] {
  border-color: #fbbf24;
  color: #92400e;
  background: #fef3c7;
}

.pop-chip--status[data-status='completed'] {
  border-color: #86efac;
  color: #166534;
  background: #dcfce7;
}

/* ═══════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════ */

.pop-input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 12px 18px;
  font-size: 14px;
  color: var(--pop-slate);
  outline: none;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  min-height: 44px;
}

.pop-input::placeholder {
  color: #9ca3af;
}

.pop-input:focus {
  border-color: var(--pop-purple);
  box-shadow: 0 0 0 4px var(--pop-focus-ring), 0 6px 16px rgba(43, 125, 188, 0.12);
}

.pop-textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--pop-slate);
  outline: none;
  resize: none;
  min-height: 80px;
}

.pop-textarea:focus {
  border-color: var(--pop-purple);
  box-shadow: 0 0 0 4px var(--pop-focus-ring);
}

.pop-select {
  width: auto;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  min-height: 44px;
  outline: none;
}

.pop-select:focus {
  border-color: var(--pop-purple);
  box-shadow: 0 0 0 4px var(--pop-focus-ring), 0 6px 16px rgba(43, 125, 188, 0.10);
}

.pop-segmented {
  background: #f3f4f6;
  padding: 4px;
  border-radius: 999px;
  display: flex;
  gap: 4px;
}

.pop-segment {
  min-height: 44px;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   PROGRESS BARS
   ═══════════════════════════════════════════════════════════════════ */

.pop-progress {
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.pop-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pop-purple), var(--color-brand-400));
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════════
   SECTION LABELS
   ═══════════════════════════════════════════════════════════════════ */

.pop-section-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 600;
  color: var(--pop-purple);
}

/* ═══════════════════════════════════════════════════════════════════
   MODALS & SHEETS
   ═══════════════════════════════════════════════════════════════════ */

.pop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.pop-modal-overlay--center {
  align-items: center;
}

.pop-bottom-sheet {
  width: 100%;
  max-width: 410px;
  background: #ffffff;
  border-radius: 20px 20px 16px 16px;
  border: 1px solid var(--pop-card-border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  padding: 16px;
}

.pop-sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: #e5e7eb;
  margin: 0 auto 12px;
}

/* ═══════════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════════ */

.pop-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--pop-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.pop-tab:hover {
  color: var(--pop-slate);
}

.pop-tab.is-active {
  color: var(--pop-purple);
  border-bottom-color: var(--pop-purple);
  font-weight: 700;
}

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

.pop-icon-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
  outline: none;
}

.pop-icon-button:hover {
  background: #f3f4f6;
}

.pop-icon-button:focus-visible {
  box-shadow: 0 0 0 4px var(--pop-focus-ring);
}

/* ═══════════════════════════════════════════════════════════════════
   AVATARS
   ═══════════════════════════════════════════════════════════════════ */

.pop-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--pop-purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--pop-purple);
  font-size: 14px;
  flex-shrink: 0;
}

.pop-avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.pop-avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

/* ═══════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════ */

.pop-badge {
  background: var(--pop-purple);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

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

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

/* ═══════════════════════════════════════════════════════════════════
   RATINGS
   ═══════════════════════════════════════════════════════════════════ */

.pop-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pop-star {
  width: 14px;
  height: 14px;
  color: #fbbf24;
}

.pop-star--empty {
  color: #d1d5db;
}

/* ═══════════════════════════════════════════════════════════════════
   NAVIGATION BAR
   ═══════════════════════════════════════════════════════════════════ */

.pop-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #e5e7eb;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

@media (min-width: 768px) {
  .pop-nav-bar {
    position: fixed;
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid #e5e7eb;
    justify-content: center;
    gap: 2rem;
  }
}

.pop-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--pop-muted);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px;
  min-width: 56px;
  min-height: 44px;
  transition: color 0.15s ease;
  border-radius: 12px;
  outline: none;
  text-decoration: none;
}

.pop-nav-item:hover,
.pop-nav-item.is-active {
  color: var(--pop-purple);
}

.pop-nav-item.is-active {
  background: rgba(43, 125, 188, 0.12);
}

.pop-nav-item:focus-visible {
  box-shadow: 0 0 0 4px var(--pop-focus-ring);
}

.pop-nav-item svg {
  width: 24px;
  height: 24px;
}

/* ═══════════════════════════════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════════════════════════════ */

.pop-skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 8px;
}

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

.pop-skeleton-line {
  height: 12px;
  border-radius: 8px;
}

.pop-skeleton-line--sm {
  height: 10px;
}

.pop-skeleton-line--lg {
  height: 14px;
}

.pop-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.pop-skeleton-button {
  height: 44px;
  border-radius: 999px;
}

/* ═══════════════════════════════════════════════════════════════════
   EMPTY / ERROR STATE BLOCKS
   ═══════════════════════════════════════════════════════════════════ */

.pop-state-block {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.pop-state-block--error {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.18);
}

.pop-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--pop-slate);
}

.pop-state-help {
  margin-top: 4px;
  font-size: 14px;
  color: #475569;
}

.pop-state-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   ACCORDION
   ═══════════════════════════════════════════════════════════════════ */

.pop-accordion {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.pop-accordion__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  background: white;
  transition: background 0.15s ease;
  min-height: 44px;
}

.pop-accordion__header:hover {
  background: #f9fafb;
}

.pop-accordion__icon {
  transition: transform 0.2s ease;
}

.pop-accordion.is-open .pop-accordion__icon {
  transform: rotate(180deg);
}

.pop-accordion__content {
  display: none;
  padding: 0 16px 16px;
  background: white;
}

.pop-accordion.is-open .pop-accordion__content {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   STICKY HELPERS
   ═══════════════════════════════════════════════════════════════════ */

.pop-sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: white;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.pop-sticky-tabs {
  position: sticky;
  top: 56px;
  z-index: 19;
  background: white;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

/* ═══════════════════════════════════════════════════════════════════
   GRID PATTERNS
   ═══════════════════════════════════════════════════════════════════ */

.pop-suggested-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .pop-suggested-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pop-directory-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .pop-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .pop-directory-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.pop-community-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1024px) {
  .pop-community-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pop-learning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 640px) {
  .pop-learning-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.pop-gallery-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pop-gallery-item {
  width: 80px;
  height: 80px;
  flex: 0 0 auto;
}

@media (min-width: 1024px) {
  .pop-gallery-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    overflow: visible;
  }
  .pop-gallery-item {
    width: 100%;
    height: 96px;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   TEXT UTILITIES
   ═══════════════════════════════════════════════════════════════════ */

.pop-line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pop-line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pop-line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pop-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pop-break-words {
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* Generic 44px tap target helper */
.pop-tap-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .pop-card--interactive,
  .pop-button-primary,
  .pop-button-outline,
  .pop-button-ghost {
    transition: none !important;
  }
  .pop-card--interactive:hover {
    transform: none !important;
  }
}
