/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
  /* Force entire container chain to stay within viewport on mobile */
  #main-content {
    max-width: 100vw;
    box-sizing: border-box;
  }

  #yoink-app {
    max-width: 100vw;
    box-sizing: border-box;
  }

  .user-panel-container {
    max-width: calc(100vw - 24px); /* viewport minus #main-content padding */
    padding: 12px; /* Reduce from 20px to save horizontal space on mobile */
  }

  .dashboard-row {
    max-width: 100%;
  }

  .dashboard-column {
    max-width: 100%;
  }

  .yoinks-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 100%;
  }

  /* V1 pattern: Enforce fixed dimensions and hidden overflow on mobile */
  .yoink-card {
    height: 440px;
    max-height: 440px;
    overflow: hidden;
  }

  .yoink-card-image {
    height: 200px;
    max-height: 200px;
    min-height: 200px;
  }

  .category-card {
    height: 280px;
  }

  .auth-modal-body {
    padding: 32px 24px 24px;
  }

  .modal-content {
    width: 95%;
  }

  /* Move close button to left on mobile to avoid GTranslate plugin overlay */
  .modal-close {
    right: auto;
    left: 16px;
  }

  /* Push category picker title past the close button (now on the left) */
  .cat-picker-title {
    padding-left: 36px;
  }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

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

.yoink-card {
  animation: fadeIn 0.3s ease-out;
}

/* Pill appear animation */
@keyframes pillFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.category-pill {
  animation: pillFadeIn 0.2s ease-out;
}

/* Stagger animation for pills */
.category-pill:nth-child(1) { animation-delay: 0.02s; }
.category-pill:nth-child(2) { animation-delay: 0.04s; }
.category-pill:nth-child(3) { animation-delay: 0.06s; }
.category-pill:nth-child(4) { animation-delay: 0.08s; }
.category-pill:nth-child(5) { animation-delay: 0.10s; }
.category-pill:nth-child(6) { animation-delay: 0.12s; }
.category-pill:nth-child(7) { animation-delay: 0.14s; }
.category-pill:nth-child(8) { animation-delay: 0.16s; }
.category-pill:nth-child(9) { animation-delay: 0.18s; }
.category-pill:nth-child(10) { animation-delay: 0.20s; }

/* Panel transition animation */
.context-panel {
  animation: fadeIn 0.2s ease-out;
}

/* ============================================================================
   REDUCED MOTION - Accessibility
   Respects user's system preference for reduced motion
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .yoink-card:hover {
    transform: none;
  }
  
  .yoink-card-placeholder-emoji {
    animation: none;
  }
  
  .yoink-card:hover .yoink-card-placeholder-emoji {
    transform: none;
  }
  
  .category-card:hover {
    transform: none;
  }

  .category-card::before,
  .category-card::after {
    transform: none;
  }

  .category-pill:hover {
    transform: none;
  }
  
  .category-pill-cta:hover {
    transform: none;
  }
  
  .category-pill-cta:hover .category-pill-emoji {
    transform: none;
  }
  
  .btn-core:hover,
  .btn-secondary:hover,
  #login-btn:hover,
  .btn-primary:hover,
  .auth-btn-primary:hover {
    transform: none;
  }
  
  .logo-button:hover {
    transform: none;
  }
  
  .user-avatar:hover {
    transform: none;
  }
  
  .fab:hover {
    transform: none;
  }
  
  .fab:active {
    transform: none;
  }
}

/* ============================================================================
   PRINT
   ============================================================================ */

@media print {
  #main-header,
  .fab,
  .modal,
  .filter-bar {
    display: none !important;
  }
  
  .yoinks-grid {
    display: block;
  }
  
  .yoink-card {
    page-break-inside: avoid;
    margin-bottom: 20px;
  }
}

