/* ================================================================
   CATEGORY PANEL - FOLLOW TOGGLE BUTTON
   Matches category modal icon buttons
   ================================================================ */

.category-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-follow-toggle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  background: transparent;
  color: #22c55e;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.category-follow-toggle:hover {
  background: #22c55e;
  color: white;
}

.category-follow-toggle.following {
  background: #22c55e;
  border-color: #22c55e;
  color: white;
}

.category-follow-toggle.following:hover {
  background: #ef4444;
  border-color: #ef4444;
}

/* ================================================================
   SCOPE TOGGLE (All / Following) - Row 2 Left Side
   ================================================================ */
.header-scope-toggle {
  display: flex;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.scope-toggle-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #6b7280);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.scope-toggle-btn:hover {
  color: var(--text-primary, #111827);
}

.scope-toggle-btn.active {
  background: white;
  color: var(--text-primary, #111827);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Mobile: smaller padding */
@media (max-width: 480px) {
  .scope-toggle-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* ================================================================
   APP BANNER (V1 pattern)
   Dismissible announcement banner at top of app
   ================================================================ */
.app-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--vintage-teal) 0%, #2d6b6b 100%);
  color: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  line-height: 1.4;
}

.app-banner-message {
  flex: 1;
  min-width: 0;
}

.app-banner-message a {
  color: white;
  text-decoration: underline;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.app-banner-message a:hover {
  text-decoration: none;
}

.app-banner-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s;
}

.app-banner-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 480px) {
  .app-banner {
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 0;
    margin: -12px -12px 12px -12px;
  }
}

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text, #1f2937);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: calc(100vw - 40px);
}

.toast-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-message {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Success toast (green accent) */
.toast-success {
  background: #059669;
}

/* Error toast (red accent) */
.toast-error {
  background: #dc2626;
}

/* Info toast (blue accent) */
.toast-info {
  background: var(--primary, #4f46e5);
}

/* Warning toast (amber accent) */
.toast-warning {
  background: #d97706;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 0.15s ease;
    transform: translateX(-50%) translateY(0);
  }
}

/* Mobile positioning (avoid FAB overlap) */
@media (max-width: 640px) {
  .toast {
    bottom: 100px;
  }
}

/* ============================================================================
   CATEGORY PANEL - RESPONSIVE
   ============================================================================ */

/* Ensure category panel doesn't overflow on any screen */
.category-panel {
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Stats grid - single column on mobile for readability */
@media (max-width: 600px) {
  .category-stats-grid {
    grid-template-columns: 1fr !important;
  }

  /* Make category panel padding tighter on mobile */
  .category-panel {
    padding: 12px !important;
  }

  /* Smaller header on mobile */
  .category-panel h1 {
    font-size: 24px !important;
  }

  /* Ensure stats cards don't overflow */
  .category-stats-card {
    max-width: 100%;
    word-wrap: break-word;
  }
}

/* ============================================================================
   WELCOME MODAL - First-time user onboarding
   ============================================================================ */

.welcome-modal-content {
  max-width: 480px;
  max-height: 90vh;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Disable the decorative inner border for welcome modal - it overlaps content */
.welcome-modal-content::before {
  display: none;
}

.welcome-header {
  background: linear-gradient(135deg, var(--leather-dark) 0%, var(--leather-mid) 100%);
  color: var(--paper-cream);
  padding: 32px 24px 24px;
  text-align: center;
  position: relative;
}

.welcome-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brass) 0%, var(--brass-shine) 50%, var(--brass) 100%);
}

.welcome-logo {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.welcome-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--paper-cream);
}

.welcome-subtitle {
  font-size: 16px;
  margin: 0;
  opacity: 0.9;
  color: var(--paper-aged);
}

.welcome-body {
  padding: 24px;
}

.welcome-intro {
  text-align: center;
  font-size: 15px;
  color: var(--leather-mid);
  margin: 0 0 24px;
  line-height: 1.5;
}

.welcome-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.welcome-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--paper-aged);
  border-radius: 12px;
  border: 1px solid var(--paper-dark);
}

.welcome-step-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-cream);
  border-radius: 50%;
  border: 2px solid var(--brass);
}

.welcome-step-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--leather-dark);
  margin: 0 0 4px;
}

.welcome-step-content p {
  font-size: 14px;
  color: var(--leather-mid);
  margin: 0;
  line-height: 1.4;
}

.welcome-footer {
  padding: 20px 24px 24px;
  text-align: center;
  border-top: 1px solid var(--paper-dark);
  background: var(--paper-aged);
}

.welcome-start-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
}

.welcome-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--leather-mid);
}

.welcome-hint-icon {
  font-size: 14px;
}

/* Section titles */
.welcome-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--leather-mid);
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--paper-dark);
}

.welcome-section-title:first-of-type {
  margin-top: 0;
}

/* View controls section */
.welcome-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.welcome-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--paper-aged);
  border-radius: 8px;
  border: 1px solid var(--paper-dark);
}

.welcome-control-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 60px;
  justify-content: center;
}

.welcome-control-icon {
  font-size: 18px;
}

.welcome-control-divider {
  color: var(--leather-mid);
  font-size: 12px;
}

.welcome-control-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--leather-dark);
  margin: 0 0 2px;
}

.welcome-control-content p {
  font-size: 13px;
  color: var(--leather-mid);
  margin: 0;
  line-height: 1.3;
}

/* About section */
.welcome-about {
  font-size: 14px;
  line-height: 1.5;
  color: var(--leather-mid);
}

.welcome-about p {
  margin: 0 0 12px;
}

.welcome-tagline {
  font-style: italic;
  color: var(--leather-dark);
  padding: 12px;
  background: var(--paper-aged);
  border-radius: 8px;
  border-left: 3px solid var(--brass);
  margin: 16px 0 !important;
}

.welcome-user-types {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.welcome-user-type {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.welcome-user-type-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.welcome-user-type strong {
  display: block;
  font-size: 13px;
  color: var(--leather-dark);
}

.welcome-user-type span {
  font-size: 12px;
  color: var(--leather-mid);
}

.welcome-examples {
  font-size: 13px;
  padding: 12px;
  background: var(--paper-aged);
  border-radius: 8px;
  margin-top: 16px !important;
  margin-bottom: 0 !important;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .welcome-modal-content {
    width: 95%;
  }

  .welcome-header {
    padding: 24px 20px 20px;
  }

  .welcome-logo {
    font-size: 40px;
  }

  .welcome-title {
    font-size: 20px;
  }

  .welcome-body {
    padding: 20px;
  }

  .welcome-step {
    padding: 12px;
    gap: 12px;
  }

  .welcome-step-icon {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .welcome-footer {
    padding: 16px 20px 20px;
  }
}

/* Landscape / short viewport - compact layout */
@media (max-height: 600px) {
  .welcome-modal-content {
    max-height: 85vh;
  }

  .welcome-header {
    padding: 16px 20px 12px;
  }

  .welcome-logo {
    font-size: 32px;
    margin-bottom: 8px;
  }

  .welcome-title {
    font-size: 18px;
  }

  .welcome-subtitle {
    font-size: 14px;
  }

  .welcome-body {
    padding: 16px;
  }

  .welcome-intro {
    margin-bottom: 16px;
    font-size: 14px;
  }

  .welcome-steps {
    gap: 10px;
  }

  .welcome-step {
    padding: 10px;
    gap: 10px;
  }

  .welcome-step-icon {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .welcome-step-content h3 {
    font-size: 14px;
  }

  .welcome-step-content p {
    font-size: 12px;
  }

  .welcome-footer {
    padding: 12px 16px 16px;
  }

  .welcome-start-btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .welcome-hint {
    margin-top: 10px;
    font-size: 11px;
  }
}

/* ============================================================================
   ONBOARDING CARD - New user first-time experience
   ============================================================================ */

.onboarding-card {
  grid-column: 1 / -1;
  max-width: 500px;
  margin: 40px auto;
  background: var(--paper-cream);
  border-radius: 16px;
  border: 2px solid var(--brass);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.onboarding-header {
  background: linear-gradient(135deg, var(--leather-dark) 0%, var(--leather-mid) 100%);
  color: var(--paper-cream);
  padding: 24px;
  text-align: center;
  position: relative;
}

.onboarding-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brass) 0%, var(--brass-shine) 50%, var(--brass) 100%);
}

.onboarding-greeting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.onboarding-wave {
  font-size: 32px;
  animation: wave 1.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(20deg); }
}

.onboarding-greeting h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--paper-cream);
}

.onboarding-subtitle {
  font-size: 15px;
  margin: 0;
  opacity: 0.9;
  color: var(--paper-aged);
}

.onboarding-body {
  padding: 24px;
}

.onboarding-explanation {
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.6;
}

.onboarding-explanation p {
  margin: 0 0 8px;
  color: var(--leather-mid);
  font-size: 15px;
}

.onboarding-explanation p:last-child {
  margin-bottom: 0;
}

.onboarding-explanation strong {
  color: var(--leather-dark);
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboarding-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: var(--paper-aged);
  border-radius: 10px;
  border: 1px solid var(--paper-dark);
}

.onboarding-step-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--brass) 0%, var(--brass-shine) 100%);
  color: var(--leather-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.onboarding-step-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.onboarding-step-content strong {
  font-size: 15px;
  color: var(--leather-dark);
}

.onboarding-step-content span {
  font-size: 13px;
  color: var(--leather-mid);
}

.onboarding-actions {
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboarding-cta {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
}

.onboarding-skip {
  width: 100%;
  padding: 12px 24px;
  font-size: 14px;
  background: transparent;
  border: 1px solid var(--paper-dark);
  color: var(--leather-mid);
}

.onboarding-skip:hover {
  background: var(--paper-aged);
  border-color: var(--leather-mid);
  color: var(--leather-dark);
}

/* Mobile adjustments for onboarding card */
@media (max-width: 540px) {
  .onboarding-card {
    margin: 20px 16px;
    max-width: none;
  }

  .onboarding-header {
    padding: 20px;
  }

  .onboarding-greeting h2 {
    font-size: 20px;
  }

  .onboarding-wave {
    font-size: 28px;
  }

  .onboarding-body {
    padding: 20px;
  }

  .onboarding-actions {
    padding: 0 20px 20px;
  }
}

/* ============================================================================
   TUTORIAL CHECKLIST – Inline card + Modal
   ============================================================================ */

/* ---- Inline card (shown on every page until tutorial is complete) ---- */
.tutorial-card {
  margin: 8px 12px 4px;
  background: var(--paper-cream);
  border: 2px solid var(--brass);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: opacity 0.4s, transform 0.4s;
}

.tutorial-card-complete {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}


.tutorial-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--leather-dark) 0%, var(--leather-mid) 100%);
  color: var(--paper-cream);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.tutorial-card-title { flex: 1; }

.tutorial-card-progress {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 600;
}

.tutorial-card-arrow {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s;
}

.tutorial-card-body {
  display: flex;
  flex-direction: column;
  padding: 6px 4px;
  gap: 2px;
  max-height: 60vh;
  overflow-y: auto;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.tutorial-card-body-hidden {
  max-height: 0;
  padding: 0 4px;
  overflow: hidden;
}

/* ---- Welcome intro (shown for brand-new users) ---- */
.tutorial-card-intro {
  padding: 8px 14px 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--leather-mid);
  text-align: center;
}

/* ---- Group headers inside checklist ---- */
.tutorial-group-header {
  padding: 6px 12px 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--leather-mid);
  opacity: 0.7;
}

.tutorial-group-header:first-child {
  padding-top: 4px;
}

/* Rich group headers (with emoji + description) */
.tutorial-group-header-rich {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  opacity: 1;
  font-size: inherit;
  letter-spacing: normal;
  text-transform: none;
  background: linear-gradient(135deg, var(--leather-dark) 0%, var(--leather-mid) 100%);
  border-radius: 8px;
  margin: 0 4px;
}

.tutorial-group-header-rich:not(:first-child) {
  margin-top: 8px;
  border-top: none;
  padding-top: 8px;
}

.tutorial-group-emoji {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  border: 1.5px solid var(--brass);
}

.tutorial-group-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.tutorial-group-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--paper-cream);
}

.tutorial-group-desc {
  font-size: 11px;
  font-weight: 400;
  color: var(--paper-aged);
  line-height: 1.3;
  opacity: 0.85;
}

/* ---- Shared item button (inline + modal) ---- */
.tutorial-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--leather-dark);
  transition: background 0.15s, border-color 0.15s;
}

.tutorial-item:hover {
  background: rgba(184, 134, 11, 0.08);
  border-color: var(--brass);
}

.tutorial-item:active {
  background: rgba(184, 134, 11, 0.16);
}

.tutorial-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--leather-mid);
  font-size: 12px;
  font-weight: 700;
  color: var(--leather-mid);
  transition: all 0.2s;
}

.tutorial-item-done .tutorial-check {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-color: #16a34a;
  color: white;
}

.tutorial-item-locked .tutorial-check {
  border-color: #D1D5DB;
  background: #F3F4F6;
  font-size: 10px;
}

.tutorial-emoji {
  flex-shrink: 0;
  font-size: 16px;
}

.tutorial-label {
  font-weight: 600;
  line-height: 1.3;
}

.tutorial-item-done .tutorial-label {
  opacity: 0.55;
}

.tutorial-item-locked .tutorial-label {
  opacity: 0.5;
}

/* ---- Modal-specific item styles ---- */
.tutorial-item-modal {
  padding: 10px 14px;
  font-size: 14px;
}

.tutorial-item-modal .tutorial-check {
  width: 26px;
  height: 26px;
  font-size: 14px;
}

.tutorial-item-modal .tutorial-emoji {
  font-size: 20px;
}

.tutorial-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tutorial-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--leather-mid);
  opacity: 0.7;
}

/* Completed items in modal: keep readable (no strikethrough) */
.tutorial-item-modal.tutorial-item-done .tutorial-label {
  text-decoration: none;
  opacity: 0.8;
}

/* ---- Tutorial modal chrome ---- */
.tutorial-modal-content {
  max-width: 420px;
  width: calc(100% - 24px);
  max-height: 85vh;
  overflow-y: auto;
}

/* Remove the decorative inner-frame border from the tutorial modal —
   it only extends to the visible height and cuts through checklist items. */
.tutorial-modal-content::before {
  display: none;
}

.tutorial-modal-header {
  text-align: center;
  padding: 24px 20px 16px;
  background: linear-gradient(135deg, var(--leather-dark) 0%, var(--leather-mid) 100%);
  color: var(--paper-cream);
  position: relative;
}

.tutorial-modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brass) 0%, var(--brass-shine) 50%, var(--brass) 100%);
}

.tutorial-modal-logo {
  font-size: 36px;
  margin-bottom: 6px;
}

.tutorial-modal-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.tutorial-modal-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  opacity: 0.85;
}

.tutorial-modal-hint {
  opacity: 0.7;
  font-size: 12px;
  margin-top: 4px;
}

.tutorial-modal-intro {
  padding: 14px 20px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--leather-dark);
  opacity: 0.85;
}

.tutorial-modal-intro p {
  margin: 0;
}

.tutorial-modal-intro-tagline {
  margin-top: 8px !important;
  font-style: italic;
  font-weight: 600;
  opacity: 0.9;
}

.tutorial-modal-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tutorial-modal-footer {
  padding: 12px 20px 20px;
  text-align: center;
}

.tutorial-modal-close-btn {
  min-width: 160px;
}

/* ---- Header pulse for non-logged-in visitors (collapsed card) ---- */
.tutorial-card-header-pulse {
  animation: headerPulse 2s ease-in-out infinite;
}

@keyframes headerPulse {
  0%   { box-shadow: 0 0 4px 2px rgba(255, 180, 0, 0.3); }
  50%  { box-shadow: 0 0 16px 8px rgba(255, 180, 0, 0.7); }
  100% { box-shadow: 0 0 4px 2px rgba(255, 180, 0, 0.3); }
}

/* ---- Universal pulse class (applied by tutorial JS) ---- */
.tutorial-pulse {
  animation: tutorialPulse 1.2s ease-in-out infinite;
  z-index: 100;
  position: relative;
  outline: 3px solid rgba(255, 180, 0, 0.9);
  outline-offset: 3px;
  border-radius: 8px;
}

@keyframes tutorialPulse {
  0%   { box-shadow: 0 0 8px 4px rgba(255, 180, 0, 0.4); transform: scale(1.0); }
  50%  { box-shadow: 0 0 28px 14px rgba(255, 180, 0, 0.8); transform: scale(1.07); }
  100% { box-shadow: 0 0 8px 4px rgba(255, 180, 0, 0.4); transform: scale(1.0); }
}

/* ---- Coach-mark popup (tutorial walkthrough) ---- */
.tutorial-coach-mark {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.tutorial-coach-mark.active {
  opacity: 1;
  pointer-events: auto;
}

.tutorial-coach-mark-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.tutorial-coach-mark-card {
  position: relative;
  width: calc(100% - 32px);
  max-width: 380px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--paper-cream, #faf6ef);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(184, 134, 11, 0.15);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.tutorial-coach-mark.active .tutorial-coach-mark-card {
  transform: translateY(0);
}

.tutorial-coach-mark-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tutorial-coach-mark-emoji {
  font-size: 22px;
  flex-shrink: 0;
}

.tutorial-coach-mark-title {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: var(--leather-dark, #3e2c1a);
}

.tutorial-coach-mark-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--leather-mid, #8b6f47);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.6;
}
.tutorial-coach-mark-close:hover {
  opacity: 1;
}

.tutorial-coach-mark-why {
  font-size: 14px;
  line-height: 1.5;
  color: var(--leather-dark, #3e2c1a);
  margin: 0 0 8px;
}

.tutorial-coach-mark-how {
  font-size: 13px;
  line-height: 1.5;
  color: var(--leather-mid, #8b6f47);
  margin: 0 0 16px;
  font-style: italic;
}

.tutorial-coach-mark-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.tutorial-coach-mark-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: var(--brass, #b8860b);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.tutorial-coach-mark-btn:hover {
  background: var(--leather-mid, #8b6f47);
}

.tutorial-coach-mark-dismiss {
  padding: 8px 16px;
  border: 1px solid var(--brass, #b8860b);
  border-radius: 8px;
  background: transparent;
  color: var(--brass, #b8860b);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.tutorial-coach-mark-dismiss:hover {
  background: rgba(184, 134, 11, 0.08);
}

/* ============================================================================
   CONTACT MODAL
   ============================================================================ */

.contact-modal-content {
  max-width: 360px;
  padding: 0;
}

.contact-modal-content::before {
  display: none;
}

.contact-header {
  padding: 24px 24px 16px;
  text-align: center;
  border-bottom: 1px solid var(--paper-dark);
}

.contact-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--leather-dark);
  margin: 0 0 4px;
}

.contact-subtitle {
  font-size: 14px;
  color: var(--leather-mid);
  margin: 0;
}

.contact-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--paper-aged);
  border-radius: 8px;
  border: 1px solid var(--paper-dark);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.contact-link:hover {
  background: var(--paper-cream);
  border-color: var(--brass);
  transform: translateY(-1px);
}

.contact-link-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.contact-link-content {
  display: flex;
  flex-direction: column;
}

.contact-link-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--leather-dark);
}

.contact-link-value {
  font-size: 12px;
  color: var(--leather-mid);
}

/* ============================================================================
   ACTIVITY TICKER - Global Activity Notifications
   ============================================================================ */

.activity-ticker-container {
  position: fixed;
  top: 80px; /* Below header */
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

@media (max-width: 768px) {
  .activity-ticker-container {
    top: 70px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}

.activity-ticker-notification {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--leather-mid) 0%, var(--leather-dark) 100%);
  color: var(--paper-cream);
  border-radius: 10px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 14px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 360px;
  /* Leather texture */
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='leather'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.4' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23leather)' opacity='0.03'/%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--leather-mid) 0%, var(--leather-dark) 100%);
}

@media (max-width: 768px) {
  .activity-ticker-notification {
    max-width: none;
    transform: translateY(-20px);
  }
}

.activity-ticker-notification.show {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 768px) {
  .activity-ticker-notification.show {
    transform: translateY(0);
  }
}

.activity-ticker-notification.hide {
  opacity: 0;
  transform: translateX(100%);
}

@media (max-width: 768px) {
  .activity-ticker-notification.hide {
    transform: translateY(-20px);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .activity-ticker-notification {
    transition: opacity 0.2s ease;
    transform: none !important;
  }

  .activity-ticker-notification.show {
    transform: none !important;
  }

  .activity-ticker-notification.hide {
    transform: none !important;
  }
}

.activity-ticker-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.activity-ticker-text {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  line-height: 1.4;
}

.activity-ticker-action {
  color: rgba(245, 240, 230, 0.8);
}

.activity-ticker-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--brass-light);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.activity-ticker-link:hover,
.activity-ticker-link:focus {
  color: var(--brass-shine);
  text-decoration: underline;
}

.activity-ticker-link:focus-visible {
  outline: 2px solid var(--brass-shine);
  outline-offset: 2px;
  border-radius: 2px;
}

.activity-ticker-close {
  background: none;
  border: none;
  padding: 4px;
  margin: -4px -4px -4px 4px;
  font-size: 18px;
  color: rgba(245, 240, 230, 0.6);
  cursor: pointer;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.activity-ticker-close:hover,
.activity-ticker-close:focus {
  color: var(--paper-cream);
  background: rgba(255, 255, 255, 0.1);
}

.activity-ticker-close:focus-visible {
  outline: 2px solid var(--brass-shine);
  outline-offset: 1px;
}

/* Milestone celebration notifications */
.activity-ticker-milestone {
  background: linear-gradient(135deg, var(--brass) 0%, var(--brass-light) 100%);
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='leather'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.4' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23leather)' opacity='0.03'/%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--brass) 0%, var(--brass-light) 100%);
}

.activity-ticker-milestone-text {
  color: var(--leather-dark);
}

.activity-ticker-milestone-text strong {
  color: var(--leather-dark);
  font-weight: 700;
}

.activity-ticker-milestone .activity-ticker-close {
  color: rgba(61, 41, 20, 0.6);
}

.activity-ticker-milestone .activity-ticker-close:hover,
.activity-ticker-milestone .activity-ticker-close:focus {
  color: var(--leather-dark);
  background: rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   CHILD CATEGORY FILTER PILLS (Category Panel)
   Reuses .category-pill styles from Discover/Profile views
   ============================================================================= */

.child-category-pills-section .category-pills-container {
  gap: 10px;
}

/* Responsive: horizontal scroll on mobile for category panel pills */
@media (max-width: 640px) {
  .child-category-pills-section .category-pills-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .child-category-pills-section .category-pills-container::-webkit-scrollbar {
    height: 4px;
  }

  .child-category-pills-section .category-pills-container::-webkit-scrollbar-thumb {
    background: var(--border-color, #D1D5DB);
    border-radius: 2px;
  }
}

