/* ============================================
   LIBRARY PANEL
   Saved decks, deck cards, import/export
   ============================================ */

/* Mobile Overrides */
@media (max-width: 768px) {

   /* Library header: restructure for mobile */
   .library-header {
      gap: 8px !important;
   }

   /* The first row (title + badge + tabs): make it wrap properly */
   .library-header>div:first-child {
      flex-wrap: wrap;
      gap: 8px !important;
      justify-content: flex-start !important;
   }

   /* Title container: full width to force badge and tabs to new rows */
   .library-header>div:first-child>div:first-child {
      width: 100%;
      flex-wrap: wrap;
      gap: 8px;
   }

   /* Move tabs to their own row, full width */
   .library-view-toggle {
      width: 100%;
      order: 1;
      justify-content: center;
   }

   /* Hide tab text on mobile - show icons only */
   .lib-tab-text {
      display: none !important;
   }

   /* Smaller padding for icon-only tabs */
   .lib-tab-btn {
      padding: 8px 10px !important;
      flex: 1;
      justify-content: center;
   }

   /* Deck grid: single column on mobile */
   .library-panel .deck-card-widget {
      min-width: 100% !important;
   }

   /* ============================================
      DISCOVER VIEW - Filter row on mobile
      ============================================ */

   /* Discover header: keep all filters on one row */
   .discover-header {
      gap: 6px !important;
      flex-wrap: nowrap !important;
   }

   /* Search: reduce min-width */
   .discover-header>div:first-child {
      min-width: 80px !important;
      flex: 1 !important;
   }

   /* Selects: compact */
   .discover-header select {
      padding: 6px 6px !important;
      font-size: 11px !important;
      max-width: 80px;
   }

   /* Refresh button: compact */
   .discover-header button {
      padding: 6px 8px !important;
   }

   /* ============================================
      UNIFIED SCROLL - Remove nested scroll containers
      ============================================ */

   /* Library content: let it grow naturally */
   .library-content {
      overflow-y: visible !important;
      height: auto !important;
   }

   /* Discover view: let it grow naturally */
   .discover-view {
      height: auto !important;
      overflow: visible !important;
   }

   /* Discover deck list: no nested scroll */
   .discover-view>div:last-child {
      overflow-y: visible !important;
      flex: none !important;
   }

   /* My Decks grid container: no nested scroll */
   .library-panel [style*="overflow-y: auto"] {
      overflow-y: visible !important;
   }
}