/* Inline Style Fixes - Consolidate repeated inline styles into CSS classes */

/* ========================================
   Flex & Layout Utilities
   ======================================== */

.flex-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.flex-container-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-gap-8 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flex-1 {
  flex: 1;
}

/* ========================================
   Margin & Spacing Utilities
   ======================================== */

.margin-bottom-18 {
  margin-bottom: 18px;
}

.margin-bottom-20 {
  margin-bottom: 20px;
}

.margin-0 {
  margin: 0;
}

.margin-top-0 {
  margin-top: 0;
}

.margin-top-4 {
  margin-top: 4px;
}

.margin-bottom-4 {
  margin-bottom: 4px;
}

.margin-bottom-8 {
  margin-bottom: 8px;
}

.padding-top-20 {
  padding-top: 20px;
}

.padding-left-1-5rem {
  padding-left: 1.5rem;
}

/* ========================================
   Hero & Header Sections
   ======================================== */

.hero-no-margin {
  margin: 0;
}

.page-header-title {
  margin: 0 0 8px 0;
}

.page-header-subtitle {
  margin: 0;
  color: var(--text-muted, var(--muted, #666));
}

/* ========================================
   Form Labels & Fields
   ======================================== */

.form-label {
  color: var(--text-muted, var(--muted, #666));
  font-size: 0.9rem;
  display: block;
  margin-bottom: 4px;
}

.form-label-small {
  color: var(--text-muted, var(--muted, #666));
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.form-field-value {
  font-size: 1.05rem;
}

.field-edit {
  display: none;
}

.field-edit.active {
  display: block;
}

/* ========================================
   Grid Layouts
   ======================================== */

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.grid-auto-fit-200 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.grid-gap-16 {
  gap: 16px;
}

.grid-gap-8 {
  gap: 8px;
}

/* ========================================
   Card Styles
   ======================================== */

.card-gap-16 {
  gap: 16px;
}

.card-padding {
  padding: 1rem;
}

/* ========================================
   List Styles
   ======================================== */

.list-no-style {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.list-item-text {
  margin: 0.25rem 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted, var(--muted, #666));
}

/* ========================================
   Text Utilities
   ======================================== */

.text-muted {
  color: var(--text-muted, var(--muted, #666));
}

.text-muted-small {
  color: var(--text-muted, var(--muted, #666));
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.text-muted-tiny {
  color: var(--text-muted, var(--muted, #666));
  font-size: 0.85rem;
  margin-top: 4px;
}

.text-center {
  text-align: center;
}

.text-large {
  font-size: 1.8rem;
  font-weight: bold;
}

.text-large-neon {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--neon, #00ffff);
}

.text-bold {
  font-weight: bold;
}

/* ========================================
   Badge & Status Indicators
   ======================================== */

.badge-disabled {
  border-color: rgba(249, 115, 22, 0.35);
}

.badge-regular {
  border-color: rgba(100, 100, 100, 0.35);
}

/* ========================================
   Section Headers
   ======================================== */

.section-header {
  margin: 0 0 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header-title {
  margin: 0;
}

/* ========================================
   Edit Mode Controls
   ======================================== */

.edit-controls-container {
  display: none;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 255, 255, 0.2);
}

.edit-controls-container.active {
  display: block;
}

.edit-controls-btn {
  margin-right: 10px;
}

/* ========================================
   Stat Boxes / Cards
   ======================================== */

.stat-label {
  color: var(--text-muted, var(--muted, #666));
  font-size: 0.9rem;
  margin-bottom: 8px;
}

/* ========================================
   Global Responsive Rescue Layer
   ======================================== */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  position: relative;
}

img,
video,
canvas,
svg,
iframe {
  max-width: 100%;
  height: auto;
}

.main-content,
.main-content > *,
.container,
.card,
.hero,
.panel,
.listing-container {
  min-width: 0;
}

main table {
  display: table;
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  white-space: normal;
}

main table tbody,
main table thead,
main table tr {
  width: auto;
  min-width: 0;
}

main th,
main td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.responsive-scroll,
.table-responsive,
.mobile-scroll {
  overflow-x: hidden;
  max-width: 100%;
}

.mobile-stack,
.stack-on-mobile {
  display: inherit;
}

@media (max-width: 960px) {
  .mobile-stack,
  .stack-on-mobile {
    display: grid;
    grid-template-columns: 1fr !important;
  }

  main :is(
    [style*="grid-template-columns: 1fr 400px"],
    [style*="grid-template-columns:1fr 400px"],
    [style*="grid-template-columns: 400px 1fr"],
    [style*="grid-template-columns:400px 1fr"],
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns:2fr 1fr"],
    [style*="grid-template-columns: 1fr 2fr"],
    [style*="grid-template-columns:1fr 2fr"],
    [style*="grid-template-columns: 1.5fr 1fr"],
    [style*="grid-template-columns:1.5fr 1fr"],
    [style*="grid-template-columns: 1fr 1.2fr"],
    [style*="grid-template-columns:1fr 1.2fr"],
    [style*="grid-template-columns: 1.3fr 0.7fr"],
    [style*="grid-template-columns:1.3fr 0.7fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns:repeat(2,"],
    [style*="grid-template-columns: repeat(2,"],
    [style*="grid-template-columns: repeat(auto-fit, minmax(240px, 1fr))"],
    [style*="grid-template-columns: repeat(auto-fit, minmax(300px, 1fr))"]
  ) {
    grid-template-columns: 1fr !important;
  }

  main :is(
    [style*="display: flex"],
    [style*="display:flex"]
  )[style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  main :is(
    [style*="min-width: 220px"],
    [style*="min-width:220px"],
    [style*="min-width: 200px"],
    [style*="min-width:200px"],
    [style*="min-width: 150px"],
    [style*="min-width:150px"]
  ) {
    min-width: 0 !important;
  }
}

@media (max-width: 768px) {
  .grid,
  .grid-auto,
  .grid-auto-fit,
  .grid-auto-fit-200,
  .grid-5col,
  .products-grid,
  .view-grid,
  .view-card,
  .icon-view,
  .listings-grid,
  .inventory-grid,
  .stats-grid,
  .filters-grid-200,
  .footer-menu-grid,
  .hero-highlight,
  .trending-strip {
    grid-template-columns: 1fr !important;
  }

  .section-header,
  .flex-container-between,
  .quick-actions,
  .dashboard-actions,
  .listing-actions,
  .detail-actions,
  .contact-buttons-grid,
  .dashboard-vendor-flex,
  .dashboard-vendor-pills,
  .collection-stats-inline,
  .collection-status-summary,
  .sale-item-header {
    flex-direction: column;
    align-items: stretch;
  }

  .section-header,
  .flex-container-between,
  .quick-actions,
  .dashboard-actions,
  .listing-actions,
  .detail-actions,
  .dashboard-vendor-pills,
  .collection-stats-inline,
  .collection-status-summary {
    gap: 0.75rem;
  }

  .listing-header,
  .detail-header,
  .panel-header-flex,
  .trending-hero-header,
  .filters-button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .listing-header .back-link,
  .listing-header .admin-toggle {
    width: 100%;
  }

  .beta-program-banner,
  .top-movers,
  .trending-hero,
  .hero,
  .card {
    overflow: clip;
  }

  .trending-strip .card,
  .listing-card,
  .listing-list-view,
  .icon-view-card {
    min-width: 0 !important;
    width: 100%;
  }

  main :is(
    [style*="overflow-x: auto"],
    [style*="overflow-x:auto"],
    [style*="white-space: nowrap"],
    [style*="white-space:nowrap"]
  ) {
    overflow-x: hidden !important;
    white-space: normal !important;
  }
}

@media (max-width: 640px) {
  .trending-hero-actions,
  .beta-actions,
  .header-actions {
    flex-wrap: wrap;
  }

  .top-movers-track,
  .top-movers-bar,
  .category-tabs,
  .horizontal-scroll-container {
    white-space: normal;
    overflow-x: hidden;
    flex-wrap: wrap;
  }

  .trending-hero-actions > *,
  .beta-actions > *,
  .quick-actions > *,
  .dashboard-actions > *,
  .detail-actions > *,
  .contact-buttons-grid > * {
    width: 100%;
  }

  main :is([style*="padding: 24px"], [style*="padding:24px"]) {
    padding: 16px !important;
  }
}

@media (max-width: 480px) {
  .hero,
  .card,
  .panel {
    border-radius: 12px;
  }

  .listing-image,
  .image-main {
    width: 100%;
    max-width: 100%;
  }

  .collection-status-summary,
  .dashboard-vendor-flex {
    padding: 0.875rem;
  }
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--neon, #00ffff);
}

.stat-tooltip {
  color: var(--text-muted, var(--muted, #666));
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ========================================
   Specific Component Fixes
   ======================================== */

.hero-grid {
  margin-bottom: 18px;
}

.hero-description {
  max-width: 70ch;
}

.category-card {
  padding: 1rem;
}

.category-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.category-item-description {
  margin: 0.25rem 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted, var(--muted, #666));
}

.btn-category-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========================================
   Stats Grid Container
   ======================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card-earnings .stat-value {
  color: #10b981;
}

.stat-card-inventory .stat-value {
  color: #f59e0b;
}

/* ========================================
   Active Listings Section
   ======================================== */

.listings-grid {
  display: grid;
  grid-auto-flow: row;
  gap: 12px;
}

.listing-card {
  padding: 12px;
}

.listing-card-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

.listing-card-title {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.listing-card-price {
  color: var(--neon, #00ffff);
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.listing-card-category {
  color: var(--muted, #666);
  font-size: 0.85rem;
}

.no-listings-message {
  margin-top: 12px;
  text-align: center;
  color: var(--muted, #666);
}

/* ========================================
   Table Styles
   ======================================== */

.table-scroll-container {
  overflow-x: auto;
}

.table-base {
  width: 100%;
  border-collapse: collapse;
}

.table-header-row {
  border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.table-header-cell {
  padding: 10px;
  text-align: left;
  color: var(--muted, #666);
}

.table-body-row {
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.table-body-cell {
  padding: 10px;
}

.table-body-cell-item {
  padding: 10px;
}

.table-body-cell-price {
  padding: 10px;
  color: var(--neon, #00ffff);
}

.table-body-cell-payout {
  padding: 10px;
  color: #10b981;
  font-weight: bold;
}

.table-body-cell-status {
  padding: 10px;
}

.table-body-cell-date {
  padding: 10px;
  color: var(--muted, #666);
}

.table-body-cell-muted {
  padding: 10px;
  color: var(--muted, #666);
}

.section-header-with-padding {
  margin: 0 0 16px 0;
  padding: 0;
}

/* ========================================
   Admin Affiliate Products Section
   ======================================== */

.sync-from-ebay-card {
  margin-bottom: 1.5rem;
}

.sync-section-description {
  margin: 0.5rem 0 1rem 0;
  color: var(--text-muted, #888);
}

.sync-collection-choice {
  margin-bottom: 1rem;
}

.sync-choice-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.sync-choice-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.sync-radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.sync-muted-text {
  color: var(--text-muted, #888);
}

.sync-pasted-ids {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #ddd);
}

.sync-description-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.sync-description-text {
  margin: 0 0 0.5rem 0;
  color: var(--text-muted, #888);
  font-size: 0.9rem;
}

.sync-textarea {
  width: 100%;
  max-width: 480px;
  padding: 0.5rem;
  font-family: monospace;
  font-size: 0.9rem;
}

.sync-button-margin {
  margin-top: 0.5rem;
}

.card-section-margin {
  margin-bottom: 1.5rem;
}

/* ========================================
   Personal Collection Items
   ======================================== */

.personal-collection-card {
  padding: 12px;
}

.personal-collection-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

.personal-collection-title {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.personal-collection-price {
  color: var(--neon, #00ffff);
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.personal-collection-category {
  color: var(--muted, #666);
  font-size: 0.85rem;
}

.personal-collection-status-group {
  margin-top: 6px;
}

.personal-collection-status {
  font-size: 0.75rem;
}

.personal-collection-more-items {
  margin-top: 12px;
  text-align: center;
  color: var(--muted, #666);
}

/* ========================================
   Form Label & Control Styling
   ======================================== */

.form-label-group {
  display: block;
}

.form-control {
  width: 100%;
}

.form-control[type="text"],
.form-control[type="email"],
.form-control[type="tel"],
.form-control[type="password"],
.form-control[type="number"] {
  padding: 8px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 4px;
  font-size: 1rem;
}

select.form-control {
  padding: 8px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 4px;
  font-size: 1rem;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
  .flex-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-auto-fit,
  .grid-auto-fit-200 {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Additional Admin Affiliate Product Styles
   ======================================== */

.ebay-url-description {
  margin: 0.5rem 0 1rem 0;
  color: var(--text-muted, #888);
}

.ebay-url-input-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.ebay-url-input {
  flex: 1;
  min-width: 280px;
  padding: 0.5rem 0.75rem;
}

.product-image-table-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border, #333);
}

.json-load-heading {
  margin-top: 1rem;
}

.json-load-description {
  margin: 0.5rem 0 0 0;
}

.product-form-hidden {
  display: none;
}

.product-form-flex {
  display: flex;
  gap: 8px;
  align-items: center;
}

.product-form-input-flex {
  flex: 1;
}

.product-form-button-padding {
  padding: 8px 12px;
}

.video-upload-description {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

.image-preview-margin {
  margin-top: 12px;
}

.label-checkbox-flex {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
