/* Upload Page Styles */

/* Section header - matches explore page .recent-posts-header-carousel style */
.create-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.create-section-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.create-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  font-style: italic;
  color: var(--color-text-tertiary, rgba(255, 255, 255, 0.5));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.create-section-link {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-primary, #00a8ff);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.create-section-link:hover {
  color: #4dc3ff;
  opacity: 0.9;
}

.create-section-arrow {
  margin-left: 0.15rem;
  display: inline-block;
  transition: transform 0.2s ease;
}

.create-section-link:hover .create-section-arrow {
  transform: translateX(2px);
}

/* Help button highlights for create page - matches explore page behavior */
.upload-steps,
.import-panel,
.upload-list-section,
.tag-pool-search,
.tag-pool-selected,
.tag-pool-available,
.library-table-view,
.save-summary {
  position: relative;
}

.upload-steps.help-highlight,
.import-panel.help-highlight,
.upload-list-section.help-highlight,
.tag-pool-search.help-highlight,
.tag-pool-selected.help-highlight,
.tag-pool-available.help-highlight,
.library-table-view.help-highlight,
.save-summary.help-highlight {
  outline: 2px solid rgba(0, 168, 255, 0.8);
  outline-offset: 4px;
  border-radius: var(--radius-md, 8px);
  transition: outline 0.3s ease;
  overflow: visible !important;
}

.help-highlight > .panel-help-label {
  opacity: 1;
  visibility: visible;
}

/* Step 4: Read-only save review table - match /portfolio/{user} sizing */
.save-review-table .library-table .col-name {
  width: 200px;
  min-width: 180px;
  max-width: 250px;
  overflow: hidden;
}
.save-review-table .library-table .col-type { width: 70px; white-space: nowrap; }
.save-review-table .library-table .col-tags { width: 240px; min-width: 240px; }
.save-review-table .library-table .col-date { width: 90px; white-space: nowrap; }
.save-review-table .library-table .col-status { width: 80px; white-space: nowrap; }

.save-review-table .library-table-status {
  cursor: default;
  pointer-events: none;
}

/* Hide Tags and Added columns in Step 1 (Import) and redistribute widths */
#stepImport .col-tags,
#stepImport .col-date {
  display: none;
}

#stepImport .library-table .col-name { width: 50%; }
#stepImport .library-table .col-type { width: 20%; }
#stepImport .library-table .col-status { width: 22%; }
#stepImport .library-table .col-actions { width: 8%; }

.upload-page {
  min-height: 100vh;
  padding-bottom: var(--spacing-4xl);
}

/* Page Heading - matches /create page */
.upload-page .create-page-heading {
  text-align: center;
  max-width: 900px;
  margin: 0 auto var(--spacing-2xl);
  padding: 0 var(--spacing-lg);
}

.upload-page .create-page-title-main {
  font-size: 2rem;
  font-weight: 600;
  font-style: italic;
  color: #fff;
  margin: 2.5rem 0 0.5rem 0;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.upload-page .create-page-title-main .topic-highlight {
  color: var(--color-primary, #00a8ff);
  font-style: normal;
  font-weight: 600;
}

.upload-page .create-page-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .upload-page .create-page-heading {
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-xl);
  }

  .upload-page .create-page-title-main {
    font-size: 1.625rem;
    margin-top: 1.5rem;
  }

  .upload-page .create-page-subtitle {
    font-size: 0.9rem;
  }
}

/* Auth Required */
.upload-auth-required {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  padding: var(--spacing-2xl);
}

.auth-required-content {
  text-align: center;
  max-width: 400px;
}

.auth-required-content svg {
  color: var(--color-text-tertiary);
  margin-bottom: var(--spacing-lg);
}

.auth-required-content h2 {
  margin-bottom: var(--spacing-md);
  color: var(--color-text-primary);
}

.auth-required-content p {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-xl);
}

.auth-required-content .btn {
  margin: 0 var(--spacing-sm);
}

/* Upload Container - full width like library grid */
.upload-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-xl) 2rem;
}

/* Import Panel — glassmorphism container that doubles as drop zone */
.import-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  padding-bottom: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  transition: border-color var(--transition-base), background var(--transition-base), box-shadow var(--transition-base);
}

.import-panel.drag-over {
  border-color: rgba(0, 168, 255, 0.7);
  background: rgba(0, 168, 255, 0.06);
  box-shadow: 0 0 30px rgba(0, 168, 255, 0.2), inset 0 0 40px rgba(0, 168, 255, 0.03);
}

/* File upload hint at bottom of panel */
.import-panel-upload-hint {
  text-align: center;
  margin: 0 0 var(--spacing-md) 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.7rem;
}

.import-panel-upload-btn {
  display: inline;
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.import-panel-upload-btn:hover {
  color: var(--color-primary-hover, #33b5ff);
}

/* Link Import */
.link-import-section {
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

.link-import-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.link-import-header h4 {
  margin: 0;
  color: var(--color-text-primary);
}

.link-import-help-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.link-import-help-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(0, 168, 255, 0.1);
}

.link-import-help-icon {
  line-height: 1;
}

.link-import-help-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 12px 16px;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s ease;
}

.link-import-help-btn:hover .link-import-help-tooltip,
.link-import-help-btn:focus .link-import-help-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.link-import-help-tooltip h5 {
  margin: 0 0 8px 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.link-import-help-tooltip ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-import-help-tooltip li {
  padding: 2px 0;
  color: rgba(255, 255, 255, 0.8);
}

/* Import Actions Row */
.import-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-bottom: -6px;
}

/* Browse Collapsible Toggle */
.browse-collapsible-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  padding: var(--spacing-sm) var(--spacing-md);
  min-height: 38px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.browse-collapsible-toggle:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
}

.browse-collapsible-toggle svg:first-child {
  opacity: 0.5;
  flex-shrink: 0;
}

.browse-collapsible-toggle span {
  white-space: nowrap;
}

.browse-collapsible-chevron {
  flex-shrink: 0;
  opacity: 0.4;
  transition: transform 0.2s ease;
}

/* Disabled state for coming soon buttons */
.browse-collapsible-toggle.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.browse-collapsible-toggle.disabled:hover {
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* Coming soon wrapper and tooltip */
.coming-soon-wrapper {
  position: relative;
  display: inline-flex;
}

.coming-soon-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  z-index: 10;
}

.coming-soon-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.85);
}

.coming-soon-wrapper:hover .coming-soon-tooltip {
  opacity: 1;
  visibility: visible;
}

.browse-collapsible-toggle.expanded {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

.browse-collapsible-toggle.expanded:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.browse-collapsible-toggle.expanded .browse-collapsible-chevron {
  transform: rotate(180deg);
}

.browse-collapsible-body {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.link-import-input-wrapper {
  display: flex;
  align-items: stretch;
  gap: var(--spacing-sm);
}

.link-import-input {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  min-height: 38px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  font-family: inherit;
  box-sizing: border-box;
}

.link-import-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  opacity: 1;
}

.link-import-input:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
}

.link-import-input:focus,
.link-import-input:focus-visible,
.link-import-input:focus-within {
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
}

.link-import-input:hover::placeholder,
.link-import-input:focus::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.link-import-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  align-self: stretch;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  font-family: inherit;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.link-import-btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

.link-import-btn:focus,
.link-import-btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.7);
}

/* Upload List */
.upload-list-section {
  margin-top: var(--spacing-xl);
}

.upload-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.upload-list-header h4 {
  margin: 0;
  color: var(--color-text-primary);
}

.upload-list-clear {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.upload-list-clear:hover {
  color: var(--color-error);
}

/* Save Actions */
.upload-actions {
  margin-top: var(--spacing-xl);
  display: flex;
  justify-content: center;
}

.btn-lg {
  padding: var(--spacing-md) var(--spacing-2xl);
  font-size: 1rem;
}

/* Preview Modal */
.preview-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
}

.preview-modal {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.preview-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: var(--spacing-sm);
}

.preview-modal-content {
  max-width: 100%;
  max-height: 80vh;
  overflow: auto;
}

.preview-modal-content img,
.preview-modal-content video {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.preview-modal-content iframe {
  width: 560px;
  height: 315px;
  max-width: 100%;
}

/* Bulk Add Modal - matching login popup style */
.bulk-add-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bulk-add-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 20px;
  padding: 32px;
  background: var(--color-bg-elevated, #2a2c34);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.bulk-add-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bulk-add-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.bulk-add-header {
  text-align: center;
  margin-bottom: 24px;
}

.bulk-add-header h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-primary, #fff);
}

.bulk-add-header p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
}

.bulk-add-platform-selector {
  margin-bottom: 16px;
}

.bulk-add-platform-select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s ease;
}

.bulk-add-platform-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
}

.bulk-add-platform-select:focus {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
  outline: none !important;
  box-shadow: none !important;
}

.bulk-add-platform-select option {
  background: #2a2c34;
  color: #fff;
}

.bulk-add-handle-wrapper {
  margin-bottom: 16px;
}

.bulk-add-handle-wrapper .link-import-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Ctext x='1' y='11' font-family='system-ui,sans-serif' font-size='13' fill='rgba(255,255,255,0.5)'%3E%40%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 14px 14px;
  min-height: unset;
  padding: 0 12px 0 28px;
  font-size: 0.8rem;
  height: 38px;
  width: 100%;
}

.bulk-add-handle-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.bulk-add-handle-row .bulk-add-handle-wrapper {
  flex: 1;
  margin-bottom: 0;
}

.bulk-add-queue-btn {
  padding: 0 14px;
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.bulk-add-queue-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary, #fff);
}

.bulk-add-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.bulk-add-queue-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 0.85rem;
}

.bulk-add-queue-item-platform {
  color: rgba(255, 255, 255, 0.45);
  text-transform: capitalize;
}

.bulk-add-queue-item-handle {
  color: var(--color-text-primary, #fff);
}

.bulk-add-queue-item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  top: 1px;
}

.bulk-add-queue-item-remove:hover {
  background: rgba(255, 80, 80, 0.3);
  color: #ff5050;
}

.bulk-add-status {
  padding: 10px 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.6));
  text-align: center;
  margin-bottom: 8px;
}

.bulk-add-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.bulk-add-cancel-btn {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bulk-add-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
}

.bulk-add-save-btn {
  padding: 12px 20px;
  background: transparent;
  border: 2px solid rgba(0, 168, 255, 0.6);
  border-radius: 8px;
  color: #00a8ff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 15px rgba(0, 168, 255, 0.2), inset 0 0 15px rgba(0, 168, 255, 0.05);
}

.bulk-add-save-btn:hover {
  background: rgba(0, 168, 255, 0.1);
  border-color: rgba(0, 168, 255, 0.8);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(0, 168, 255, 0.4), inset 0 0 20px rgba(0, 168, 255, 0.1);
}

/* ============================================================================
   Save Errors Modal
   ============================================================================ */

.save-errors-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.save-errors-modal-overlay.closing {
  animation: fadeOut 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.save-errors-modal {
  background: var(--color-bg-base-mid, #1a1a2e);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-xl, 16px);
  padding: 0;
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.1);
  animation: slideUp 0.3s ease;
}

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

.save-errors-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.save-errors-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.save-errors-modal-icon svg {
  color: #ef4444;
}

.save-errors-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary, #fff);
}

.save-errors-modal-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}

.save-error-group {
  margin-bottom: 16px;
}

.save-error-group:last-child {
  margin-bottom: 0;
}

.save-error-type {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  margin-bottom: 8px;
}

.save-error-type svg {
  color: #ef4444;
  flex-shrink: 0;
}

.save-error-type span {
  color: var(--color-text-primary, #fff);
  font-size: 0.85rem;
  font-weight: 500;
}

.save-error-count {
  margin-left: auto;
  padding: 2px 8px;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #ef4444;
}

.save-error-items {
  margin: 0;
  padding: 0 0 0 28px;
  list-style: none;
}

.save-error-items li {
  font-size: 0.75rem;
  color: var(--color-text-secondary, #888);
  padding: 4px 0;
  word-break: break-all;
}

.save-error-items li::before {
  content: '•';
  color: rgba(239, 68, 68, 0.5);
  margin-right: 8px;
}

.save-error-more {
  font-style: italic;
  color: var(--color-text-tertiary, #666) !important;
}

.save-errors-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
}

.save-errors-modal-btn {
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--color-text-primary, #fff);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.save-errors-modal-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Responsive */
@media (max-width: 640px) {
  .upload-container {
    padding: var(--spacing-md) 1rem;
  }

  .import-panel {
    padding: var(--spacing-md);
  }

  .link-import-input-wrapper {
    flex-direction: column;
  }

  .upload-item {
    flex-wrap: wrap;
  }

  .upload-item-progress {
    flex: 1 1 100%;
    order: 10;
    margin-top: var(--spacing-sm);
  }
}

/* ============================================================================
   Selection and Tagging
   ============================================================================ */

/* Upload list header with actions */
.upload-list-actions {
  display: flex;
  gap: var(--spacing-md);
}

.upload-list-select-all {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.upload-list-select-all:hover {
  color: var(--color-primary-hover, #33b5ff);
  text-decoration: underline;
}

/* ============================================================================
   Publish Options Panel
   ============================================================================ */

.upload-publish-panel {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.publish-panel-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-sm);
}

.publish-toggle {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-text-primary);
}

.publish-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.publish-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: -8px;
}

/* ============================================================================
   Mobile Responsive
   ============================================================================ */

@media (max-width: 700px) {
  .publish-panel-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .upload-list-actions {
    flex-wrap: wrap;
  }
}

/* ============================================================================
   Table View - matches library-table styles from profile.css
   ============================================================================ */

.upload-table-view {
  margin-top: var(--spacing-md);
}

.library-table-container {
  display: flex;
  gap: var(--spacing-lg);
  min-height: 400px;
}

.library-table-panel {
  flex: 1;
  overflow-x: auto;
}

.library-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
  font-size: 14px;
  margin: 0;
}

.library-table th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  border: none;
  white-space: nowrap;
}

.library-table th:first-child {
  padding-left: 1rem;
}

.library-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.library-table th.sortable:hover {
  color: rgba(255, 255, 255, 0.8);
}

.library-table th.sortable .th-content {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.library-table th .sort-indicator {
  color: var(--color-text-tertiary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.library-table th.sorted-asc .sort-indicator,
.library-table th.sorted-desc .sort-indicator {
  opacity: 1;
  color: var(--color-primary);
}

.library-table td {
  padding: 0.625rem 0.5rem;
  color: var(--color-text-primary);
  vertical-align: middle;
  border: none;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.2s ease;
}

.library-table td:first-child {
  padding-left: 1rem;
}

.library-table tbody tr {
  cursor: pointer;
  transition: all 0.2s ease;
}

.library-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.06);
}

.library-table tbody tr.hovered td {
  background: rgba(255, 255, 255, 0.04);
}

.library-table tbody tr.selected td {
  background: rgba(0, 168, 255, 0.15);
}

.library-table tbody tr.selected:hover td {
  background: rgba(0, 168, 255, 0.2);
}

.library-table tbody tr.selected td:first-child {
  box-shadow: inset 3px 0 0 0 #00a8ff;
}

/* Apply border-radius to first and last cells */
.library-table tbody tr td:first-child {
  border-radius: 8px 0 0 8px;
}

.library-table tbody tr td:last-child {
  border-radius: 0 8px 8px 0;
  padding-right: 0.5rem;
}

.library-table th:last-child {
  padding-right: 0.5rem;
}

/* Table cell widths */
.library-table .col-name { width: 30%; }
.library-table .col-type { width: 12%; }
.library-table .col-tags { width: 28%; }
.library-table .col-date { width: 10%; }
.library-table .col-status { width: 12%; }
.library-table .col-actions { width: 8%; text-align: right; }

/* Name cell with editable textarea */
.library-table-name {
  display: flex;
  align-items: center;
}

.library-table-name-input {
  flex: 1;
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 8px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  outline: none;
}

.library-table-name-input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.library-table-name-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

/* Type badge with icon */
.library-table-type {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
}

.library-table-type svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.library-table-type.twitter { color: #1da1f2; }
.library-table-type.youtube { color: #ff0000; }
.library-table-type.tiktok { color: #00f2ea; }
.library-table-type.instagram { color: #e4405f; }
.library-table-type.substack { color: #ff6719; }
.library-table-type.espn { color: #ff0000; }
.library-table-type.uploaded_media { color: white; }
.library-table-type.data_table { color: white; }
.library-table-type.generic { color: #6b7280; }
/* Sports Index native types - white text */
.library-table-type.sports_index,
.library-table-type.sports_index_timeline,
.library-table-type.sports_index_collection,
.library-table-type.sports_index_page,
.library-table-type.sports_index_topic,
.library-table-type.sports_index_author { color: white; }

/* Tags in table - editable with drag handles */
.library-table-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  position: relative;
}

.library-table-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.6rem;
  color: white;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: grab;
}

.library-table-tag:hover {
  background: rgba(0, 168, 255, 0.2);
  border-color: rgba(0, 168, 255, 0.5);
}

/* Drag handle for tag reordering */
.tag-drag-handle {
  color: rgba(255, 255, 255, 0.3);
  font-size: 8px;
  letter-spacing: -2px;
  user-select: none;
  cursor: grab;
}

.library-table-tag:hover .tag-drag-handle {
  color: rgba(255, 255, 255, 0.5);
}

.tag-drag-handle:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* Tag text */
.tag-text {
  line-height: 1;
}

/* Dragging state */
.library-table-tag.dragging {
  opacity: 0.5;
  cursor: grabbing;
  background: rgba(0, 168, 255, 0.2);
}

.library-table-tag.dragging .tag-drag-handle {
  cursor: grabbing;
}

/* Tag remove button */
.library-table-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  margin-left: 2px;
  transition: all 0.15s ease;
}

.library-table-tag-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Add tag button */
.library-table-add-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 6px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.15s ease;
}

.library-table-add-tag:hover {
  background: rgba(0, 168, 255, 0.1);
  border-color: rgba(0, 168, 255, 0.4);
  color: rgba(255, 255, 255, 0.8);
}

/* Tag dropdown menu */
.tag-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  max-width: 280px;
  background: rgba(20, 30, 48, 0.98);
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  margin-top: 4px;
}

.tag-dropdown-search {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-dropdown-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 6px 10px;
  color: white;
  font-size: 0.8rem;
  outline: none;
}

.tag-dropdown-input:focus {
  border-color: rgba(0, 168, 255, 0.5);
}

.tag-dropdown-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.tag-dropdown-results {
  max-height: 200px;
  overflow-y: auto;
}

.tag-dropdown-item {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.15s ease;
}

.tag-dropdown-item:hover {
  background: rgba(0, 168, 255, 0.15);
}

.tag-dropdown-item.add-new {
  color: var(--color-primary);
  font-style: italic;
}

.tag-dropdown-empty {
  padding: 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.library-table-no-tags {
  color: var(--color-text-tertiary);
}

/* Date column */
.library-table-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

/* Status badge */
.upload-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.upload-status-badge.ready {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
}

.upload-status-badge.uploading {
  background: rgba(0, 168, 255, 0.15);
  color: var(--color-primary);
}

.upload-status-badge.resolving {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

.upload-status-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.status-spinner-small {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Actions cell */
.library-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.library-table tr:hover .library-table-actions {
  opacity: 1;
}

.library-table-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s ease;
}

.library-table-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.library-table-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.library-table-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================================================
   Preview Panel - Clean, no container styling
   ============================================================================ */

.library-preview-panel {
  flex: 0 0 400px;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: stretch;
  position: sticky;
  top: 100px;
  overflow: visible;
}

.library-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: var(--spacing-sm);
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
  text-align: center;
}

.library-preview-empty svg {
  opacity: 1;
}

.library-preview-empty p {
  font-size: 0.8rem;
}

.library-preview-content {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

/* Preview media */
.preview-media {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-media img,
.preview-media video {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

/* Preview embeds */
.preview-embed {
  overflow: visible;
}

/* Twitter embed - matches portfolio page styling */
.library-preview-content .tweet-container,
.browse-preview-content .tweet-container {
  width: 100%;
  min-height: 150px;
  border-radius: 12px;
  overflow: hidden;
}

/* Twitter white corners fix */
.library-preview-content .tweet-container .twitter-tweet,
.library-preview-content .tweet-container .twitter-tweet-rendered,
.browse-preview-content .tweet-container .twitter-tweet,
.browse-preview-content .tweet-container .twitter-tweet-rendered {
  margin: 0 !important;
  background: transparent !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

.library-preview-content .tweet-container iframe,
.browse-preview-content .tweet-container iframe {
  border: none !important;
  border-radius: 12px !important;
  color-scheme: light !important;
}

.preview-embed.youtube-preview .youtube-wrapper,
.library-preview-content .youtube-wrapper,
.library-preview-content .youtube-responsive-wrapper {
  width: 100%;
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
}

.preview-embed.youtube-preview .youtube-wrapper iframe,
.library-preview-content .youtube-wrapper iframe,
.library-preview-content .youtube-responsive-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  /* Render at 150% size so YouTube serves higher quality thumbnail, then scale to fit */
  width: 150%;
  height: 150%;
  border: none;
  transform: scale(0.6667);
  transform-origin: top left;
}

.preview-embed.tiktok-preview .tiktok-iframe-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  /* Force new stacking context to properly clip iframe content */
  isolation: isolate;
  transform: translateZ(0);
}

.preview-embed.tiktok-preview .tiktok-iframe-container iframe {
  display: block;
  width: 100%;
  height: 740px; /* TikTok videos are 9:16 vertical - this accommodates full video + controls */
  border: none;
  border-radius: 12px;
  /* Clip sides to reduce white space, with rounded corners */
  clip-path: inset(0 10% round 12px);
}

.preview-embed.instagram-preview .instagram-container {
  min-height: 200px;
}

/* Preview placeholder */
.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  color: var(--color-text-tertiary);
}

.preview-placeholder svg {
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

/* Preview status (for incomplete items) */
.preview-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  color: var(--color-text-secondary);
}

.preview-status .status-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--spacing-md);
}

/* Preview info - hidden on upload page */
.preview-info {
  display: none;
}

/* ============================================================================
   Table View Responsive
   ============================================================================ */

@media (max-width: 1000px) {
  .library-table-container {
    flex-direction: column;
  }

  .library-preview-panel {
    flex: none;
    position: static;
    width: 100%;
  }
}

@media (max-width: 700px) {
  .library-table {
    font-size: 12px;
    border-spacing: 0 0.375rem;
  }

  .library-table .col-tags,
  .library-table .col-date {
    display: none;
  }

  .library-table th,
  .library-table td {
    padding: 0.5rem 0.375rem;
  }

  .library-table th:first-child,
  .library-table td:first-child {
    padding-left: 0.75rem;
  }

  .library-table-name-input {
    max-width: 120px;
    font-size: 12px;
    padding: 2px 4px;
  }

  .library-preview-panel {
    display: none;
  }

  .library-table-actions {
    opacity: 1;
  }

  .library-table-action-btn {
    width: 24px;
    height: 24px;
  }

  .library-table-action-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
}

/* ============================================================================
   Bulk Actions Toolbar
   ============================================================================ */

.library-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 168, 255, 0.08);
  border: 1px solid rgba(0, 168, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  gap: 16px;
}

.bulk-actions-left,
.bulk-actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bulk-selection-count {
  font-size: 0.875rem;
  font-weight: 500;
  color: #00a8ff;
}

.bulk-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.15s ease;
}

.bulk-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.bulk-action-dropdown {
  position: relative;
}

.bulk-action-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: rgba(20, 30, 48, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  margin-top: 4px;
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
}

.bulk-action-dropdown-option {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.15s ease;
}

.bulk-action-dropdown-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.bulk-action-dropdown-option.bulk-action-new-tag {
  color: #00a8ff;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Bulk tag input */
.bulk-tag-input-wrapper {
  display: flex;
  padding: 8px;
  gap: 8px;
}

.bulk-tag-input {
  flex: 1;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

.bulk-tag-input:focus {
  border-color: rgba(0, 168, 255, 0.5);
}

.bulk-tag-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.bulk-tag-input-submit {
  padding: 8px 14px;
  background: rgba(0, 168, 255, 0.2);
  border: 1px solid rgba(0, 168, 255, 0.4);
  border-radius: 4px;
  color: #00a8ff;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bulk-tag-input-submit:hover {
  background: rgba(0, 168, 255, 0.3);
  border-color: rgba(0, 168, 255, 0.6);
}

/* Responsive bulk actions */
@media (max-width: 700px) {
  .library-bulk-actions {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }

  .bulk-actions-left,
  .bulk-actions-right {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .bulk-action-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}

/* ============================================================================
   ESPN Preview Styles - matches profile.css
   ============================================================================ */

/* ESPN type badge color */
.library-table-type.espn { color: #d00; }

/* ESPN Preview - matches portfolio page */
.library-preview-content .espn-preview {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.library-preview-content .espn-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.library-preview-content .espn-preview-overlay {
  position: absolute;
  inset: -2px;
  padding: 24px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9) 80%, rgba(0, 0, 0, 1));
}

.library-preview-content .espn-preview-overlay h3 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.library-preview-content .espn-preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.library-preview-content .espn-preview-link:hover {
  color: #fff;
  opacity: 0.8;
}

.library-preview-content .espn-preview-no-image {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.library-preview-content .espn-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.library-preview-content .espn-preview-placeholder svg {
  opacity: 0.5;
}

.library-preview-content .espn-preview-placeholder h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
}

/* Generic Link Preview Styles - now in profile.css */

/* ============================================================================
   Sports Index Internal Link Preview Styles
   ============================================================================ */

/* Sports Index Internal Link Preview - uses featured-embed component */
/* Styles for the upload preview panel context */

.si-internal-preview.featured-embed {
  /* Make it a block-level element with proper dimensions */
  position: relative;
  display: block;
  width: 100%;
  max-width: 380px;
  height: 280px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.si-internal-preview.featured-embed:hover {
  transform: scale(1.02);
}

.si-internal-preview.featured-embed:hover .featured-embed-bg {
  transform: scale(1.05);
}

/* ============================================================================
   Data Table (CSV) Preview Styles
   ============================================================================ */

.data-table-preview {
  padding: 16px;
}

.data-table-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.data-table-name {
  font-size: 1rem;
  font-weight: 600;
  color: white;
}

.data-table-stats {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.data-table-preview-table {
  overflow-x: auto;
}

.data-table-preview-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.data-table-preview-table th,
.data-table-preview-table td {
  padding: 8px 12px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table-preview-table th {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.data-table-preview-table td {
  color: rgba(255, 255, 255, 0.9);
}

.data-table-preview-table .more-rows td {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* ============================================================================
   Substack Preview Styles
   ============================================================================ */

.substack-preview {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

.substack-preview img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 300px;
  object-fit: cover;
}

.substack-preview-overlay {
  position: absolute;
  inset: -2px;
  padding: 24px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9) 80%, rgba(0, 0, 0, 1));
}

.substack-preview-overlay h3 {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.substack-preview-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.substack-preview-no-image {
  background: rgba(255, 103, 25, 0.1);
  padding: 32px;
  text-align: center;
}

.substack-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.substack-preview-placeholder svg {
  color: #ff6719;
}

.substack-preview-placeholder h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.substack-preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #ff6719;
  text-decoration: none;
  transition: color 0.2s ease;
}

.substack-preview-link:hover {
  color: #ff8c4d;
}

/* Substack Profile Card (for notes without content images) */
.substack-preview-profile {
  background: linear-gradient(135deg, rgba(255, 103, 25, 0.15) 0%, rgba(255, 103, 25, 0.05) 100%);
  border: 1px solid rgba(255, 103, 25, 0.2);
  border-radius: 12px;
  padding: 32px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.substack-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  max-width: 400px;
}

.substack-profile-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 103, 25, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.substack-profile-icon svg {
  color: #ff6719;
}

.substack-profile-icon .substack-profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.substack-profile-author {
  font-size: 0.9rem;
  color: #ff6719;
  font-weight: 500;
}

.substack-profile-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.substack-profile-desc {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

/* ============================================================================
   Multi-Step Upload Wizard
   ============================================================================ */

/* Step Indicator */
.upload-steps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-2xl);
  position: relative;
}

.upload-steps-row .link-import-help-btn {
  margin-left: var(--spacing-xs);
}

.upload-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 var(--spacing-md);
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: default;
  transition: all 0.2s ease;
}

.step.clickable {
  cursor: pointer;
}

.step.clickable:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
}

.step-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s ease;
}

.step-check {
  display: none;
  color: #28a745;
}

/* Active step */
.step.active {
  background: rgba(0, 168, 255, 0.1);
  border-color: rgba(0, 168, 255, 0.5);
}

.step.active .step-number {
  background: rgba(0, 168, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 168, 255, 0.4);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.4), 0 0 4px rgba(0, 168, 255, 0.2), inset 0 0 8px rgba(0, 168, 255, 0.1);
}

.step.active .step-label {
  color: #fff;
}

/* Completed step */
.step.completed {
  background: rgba(40, 167, 69, 0.1);
  border-color: rgba(40, 167, 69, 0.3);
}

.step.completed .step-number {
  display: none;
}

.step.completed .step-check {
  display: flex;
}

.step.completed .step-label {
  color: #28a745;
}

/* Step connector */
.step-connector {
  width: 32px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.step-connector.completed {
  background: rgba(40, 167, 69, 0.5);
}

/* Step content containers */
.step-content {
  display: none;
}

.step-content.active {
  display: block;
}

/* Step Navigation */
.step-navigation {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.step-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.step-nav-back {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

.step-nav-back:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.step-nav-next,
.step-nav-save {
  background: transparent;
  border: 2px solid rgba(0, 168, 255, 0.6);
  color: #00a8ff;
  box-shadow: 0 0 15px rgba(0, 168, 255, 0.2), inset 0 0 15px rgba(0, 168, 255, 0.05);
}

.step-nav-next:hover:not(:disabled),
.step-nav-save:hover:not(:disabled) {
  background: rgba(0, 168, 255, 0.1);
  border-color: rgba(0, 168, 255, 0.8);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(0, 168, 255, 0.4), inset 0 0 20px rgba(0, 168, 255, 0.1);
}

.step-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.step-nav-save {
  padding: 12px 32px;
}

.step-nav-save .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.step-nav-save .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Save Progress Bar */
#saveProgressContainer {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary, #f8fafc);
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
}

.save-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
}

#saveProgressText {
  font-weight: 500;
}

.save-progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--border-color, #e2e8f0);
  border-radius: 4px;
  overflow: hidden;
}

.save-progress-bar-fill {
  height: 100%;
  background: var(--accent-color, #3b82f6);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.save-progress-errors {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #ef4444;
}

/* Step Section Styling */
.step-section {
  max-width: 900px;
  margin: 0 auto;
}

/* Old step section titles (kept for backwards compatibility) */
.step-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem 0;
  text-align: center;
}

.step-section-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 var(--spacing-xl) 0;
  text-align: center;
}

/* =========================================================================
   Create Step Header - Explore page style (grey text + separator line)
   ========================================================================= */

.create-step-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.75rem 0;
  margin-bottom: var(--spacing-lg);
}

.create-step-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.create-step-header-title {
  font-size: 0.75rem;
  font-weight: 600;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.create-step-header-desc {
  font-size: 0.7rem;
  font-weight: 400;
  font-style: normal;
  color: rgba(255, 255, 255, 0.7);
  margin: 0.25rem 0 0 0;
  text-transform: none;
  letter-spacing: 0;
}

/* ============================================================================
   Step 2: Tag Pool Selection
   ============================================================================ */

.tag-pool-search {
  margin-bottom: var(--spacing-lg);
}

/* Upload tag search discovery bar overrides */
.upload-tag-search-section {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  margin: 0;
  padding: 0;
  z-index: 10;
}

.upload-tag-search-section .discovery-bar-wrapper {
  padding: 0;
}

.upload-tag-search-section .discovery-bar {
  padding: 0.3rem 0.5rem;
  gap: 0.35rem;
  min-height: 32px;
}

.upload-tag-search-section .discovery-link {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
}

.upload-tag-search-section .discovery-search-pill {
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
}

.upload-tag-search-section .discovery-search-pill svg {
  width: 11px;
  height: 11px;
}

.upload-tag-search-section .discovery-search-pill .discovery-search-input {
  font-size: 0.65rem;
}

.upload-tag-search-section .discovery-search-pill.expanded .discovery-search-input {
  width: 150px;
}

.upload-tag-search-section .tag-pool-create-link {
  color: rgba(0, 168, 255, 1);
  border-color: rgba(0, 168, 255, 0.4);
}



.tag-pool-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--spacing-sm);
}

/* Selected Tags Pool */
.tag-pool-selected {
  margin-bottom: var(--spacing-xl);
}

.tag-pool-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pool-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 5px 10px;
  height: 28px;
  background: rgba(0, 168, 255, 0.1);
  border: 1px solid rgba(0, 168, 255, 0.4);
  border-radius: 4px;
  font-size: 0.75rem;
  line-height: 1.2;
  color: #fff;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.tag-pool-pill:hover {
  background: rgba(0, 168, 255, 0.2);
  border-color: rgba(0, 168, 255, 0.6);
}

.tag-pool-pill-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-pool-pill-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.tag-pool-empty {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  font-style: italic;
}

/* Available Tags Grid */
.tag-pool-available {
  margin-bottom: var(--spacing-lg);
}

.tag-pool-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pool-option {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 5px 10px;
  height: 28px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.75rem;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.tag-pool-option:hover {
  background: rgba(0, 168, 255, 0.2);
  border-color: rgba(0, 168, 255, 0.5);
  color: #fff;
}

.tag-pool-option.selected {
  background: rgba(0, 168, 255, 0.15);
  border-color: rgba(0, 168, 255, 0.5);
  color: #00a8ff;
}

.tag-pool-option .tag-add-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.tag-pool-create {
  color: #00a8ff;
  border-style: dashed;
}

.tag-pool-create:hover {
  background: rgba(0, 168, 255, 0.1);
}

.tag-pool-loading {
  padding: var(--spacing-lg);
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================================================
   Step 3: Assignment Table (uses .library-table-* classes from profile.css)
   ============================================================================ */

/* Assignment tag dropdown (used by showAssignmentTagDropdown) */
.assignment-tag-dropdown {
  position: relative;
  display: inline-block;
}

.assignment-tag-dropdown-menu {
  position: fixed;
  min-width: 220px;
  background: rgba(20, 30, 48, 0.98);
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.assignment-tag-search-input {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px 8px 0 0;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  box-sizing: border-box;
}

.assignment-tag-search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.assignment-tag-dropdown-list {
  max-height: 180px;
  overflow-y: auto;
}

.assignment-tag-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.15s ease;
}

.assignment-tag-dropdown-item:hover {
  background: rgba(0, 168, 255, 0.15);
  color: #fff;
}

.assignment-tag-create {
  color: rgba(0, 168, 255, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.assignment-tag-dropdown-empty {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
}

}

/* ============================================================================
   Step 4: Save Summary
   ============================================================================ */

.save-summary {
  display: flex;
  justify-content: center;
  gap: var(--spacing-2xl);
  padding: var(--spacing-xl);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: var(--spacing-xl);
}

.save-summary-stat {
  text-align: center;
}

.save-summary-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: #00a8ff;
  line-height: 1;
  margin-bottom: 8px;
}

.save-summary-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================================
   Light Mode - Multi-Step Wizard
   ============================================================================ */

/* ============================================================================
   Content Browse Panel
   ============================================================================ */

.browse-filter-toggles {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin: 4px 0 -12px 0;
}

.browse-filter-toggles-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 400px - var(--spacing-lg));
}

.browse-search-wrapper {
  flex: 1;
  min-width: 0;
}

.browse-search-wrapper .link-import-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 14px 14px;
}

.browse-search-wrapper .link-import-input {
  min-height: unset;
  padding: 0 12px 0 34px;
  font-size: 0.8rem;
  height: 38px;
}

.browse-filters,
.browse-topics-filter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.browse-type-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.browse-type-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
}

.browse-type-toggle.open .browse-type-chevron {
  transform: rotate(180deg);
}

.browse-type-chevron {
  transition: transform 0.2s ease;
  opacity: 0.5;
}

.browse-type-label strong {
  color: #fff;
}

.browse-filter-options {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Browse topics panel - discovery bar overrides */
.browse-topics-panel {
  margin-top: -8px;
  margin-bottom: 8px;
}

.browse-discovery-bar-section {
  padding: 0;
  margin: 0;
  z-index: auto;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
}

.browse-discovery-bar-section .discovery-bar-wrapper {
  padding: 0;
}

.browse-discovery-bar-section .discovery-bar {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}

.browse-discovery-bar-section .discovery-link {
  font-size: 0.7rem;
  padding: 4px 10px;
}

.browse-discovery-bar-section .discovery-search-pill {
  padding: 4px 10px;
}

.browse-discovery-bar-section .discovery-search-input {
  font-size: 0.7rem;
}

.browse-discovery-bar-section .active-filters-row {
  margin-top: 6px;
}

.browse-filter-label {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
  font-weight: 500;
  margin-right: 2px;
}

.browse-filter-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm, 4px);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.browse-filter-btn:hover {
  background: rgba(0, 168, 255, 0.12);
  border-color: rgba(0, 168, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
}

.browse-filter-btn.active {
  background: rgba(0, 168, 255, 0.2);
  border-color: rgba(0, 168, 255, 0.5);
  color: white;
}

.browse-results-row {
  display: flex;
  gap: var(--spacing-lg);
  min-height: 220px;
}

.browse-results {
  flex: 1;
  min-height: 0;
  max-height: 500px;
  overflow-y: auto;
  align-self: stretch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.browse-results::-webkit-scrollbar {
  display: none;
}

/* Added row: persistent green checkmark */
.browse-row-added .browse-result-add-btn {
  border-color: var(--color-success, #34d058) !important;
  color: var(--color-success, #34d058) !important;
  pointer-events: none;
  opacity: 1 !important;
}

.browse-row-added .library-table-actions {
  opacity: 1 !important;
}


.browse-results .library-table-panel {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

.browse-results .library-table-panel::-webkit-scrollbar {
  display: none;
}


.browse-preview-pane {
  flex: 0 0 400px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  overflow: visible;
}

.browse-preview-pane.has-preview {
  border-color: transparent;
  background: transparent;
}

.browse-preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
}

.browse-preview-content {
  overflow: visible;
}


.browse-empty-state,
.browse-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-2xl);
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
}

.browse-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.browse-result-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  cursor: pointer;
  transition: background var(--transition-base);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.browse-result-item:last-child {
  border-bottom: none;
}

.browse-result-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.browse-result-type {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  white-space: nowrap;
  text-transform: capitalize;
}

.browse-result-info {
  flex: 1;
  min-width: 0;
}

.browse-result-title {
  font-size: 0.8rem;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browse-result-meta {
  font-size: 0.65rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browse-result-add-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
  line-height: 1;
}

.browse-result-add-btn:hover {
  background: var(--color-primary);
  color: var(--color-bg-primary);
}

.browse-result-add-btn.added {
  border-color: var(--color-success, #34d058);
  color: var(--color-success, #34d058);
  pointer-events: none;
}

.browse-no-results {
  padding: var(--spacing-xl);
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
}

/* Ghost row for browse hover preview */
.browse-ghost-row {
  outline: 1px dashed rgba(0, 168, 255, 0.4);
  outline-offset: -1px;
  opacity: 0.55;
  background: rgba(0, 168, 255, 0.04);
}

.browse-ghost-row td {
  color: var(--color-text-secondary);
}

.ghost-tag {
  opacity: 0.6;
}

/* ============================================================================
   Responsive - Multi-Step Wizard
   ============================================================================ */

@media (max-width: 768px) {
  .upload-steps {
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
  }

  .step {
    padding: 8px 10px;
    flex-shrink: 0;
  }

  .step-label {
    display: none;
  }

  .step-number {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .step-connector {
    width: 20px;
  }

  .step-section-title {
    font-size: 1.25rem;
  }

  .step-section-desc {
    font-size: 0.875rem;
  }

  .tag-pool-selected {
    padding: var(--spacing-md);
  }

  .save-summary {
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
  }

  .save-summary-number {
    font-size: 2rem;
  }

  .step-navigation {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .step-nav-btn {
    width: 100%;
    justify-content: center;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* =========================================================================
   Date Wheel Picker (matches /portfolio page)
   ========================================================================= */

.date-edit-popover {
  background: var(--color-bg-base-mid, #1a1a2e);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  min-width: 240px;
}

.date-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.date-edit-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

/* Date wheel picker container */
.date-wheel-container {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.date-wheel-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.date-wheel-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.date-wheel {
  position: relative;
  height: 120px;
  width: 100%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.date-wheel-scroll {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: y mandatory;
  padding: 48px 0;
}

.date-wheel-scroll::-webkit-scrollbar {
  display: none;
}

.date-wheel-option {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  scroll-snap-align: center;
  transition: color 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.date-wheel-option:hover {
  color: rgba(255, 255, 255, 0.5);
}

.date-wheel-option.selected {
  color: #fff;
  font-weight: 600;
  transform: scale(1.1);
}

/* Selection highlight overlay */
.date-wheel::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 28px;
  transform: translateY(-50%);
  background: rgba(0, 168, 255, 0.15);
  border-top: 1px solid rgba(0, 168, 255, 0.3);
  border-bottom: 1px solid rgba(0, 168, 255, 0.3);
  pointer-events: none;
  z-index: 1;
}

/* Fade overlays for wheel edges */
.date-wheel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    var(--color-bg-base-mid, #1a1a2e) 0%,
    transparent 30%,
    transparent 70%,
    var(--color-bg-base-mid, #1a1a2e) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* Direct date input */
.date-direct-input-wrapper {
  margin-bottom: 12px;
}

.date-direct-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  outline: none;
  text-align: center;
  letter-spacing: 1px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.date-direct-input:focus {
  border-color: rgba(0, 168, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.date-direct-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0;
}

.date-direct-input.invalid {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
}

.date-edit-actions {
  display: flex;
  gap: 6px;
}

.date-edit-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.date-edit-btn:hover {
  opacity: 0.9;
}

.date-edit-save {
  background: rgba(0, 168, 255, 0.3);
  color: #00a8ff;
  border: 1px solid rgba(0, 168, 255, 0.3);
}

.date-edit-save:hover {
  background: rgba(0, 168, 255, 0.4);
}

.date-edit-clear {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.date-edit-clear:hover {
  background: rgba(239, 68, 68, 0.25);
}

.date-edit-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.date-edit-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Admin Seed Bar */
.admin-seed-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: rgba(255, 165, 0, 0.08);
  border: 1px solid rgba(255, 165, 0, 0.2);
  border-radius: 8px;
  font-size: 0.85rem;
  color: rgba(255, 165, 0, 0.8);
}

.admin-seed-bar select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 6px;
  color: #fff;
  padding: 6px 10px;
  font-size: 0.85rem;
}
