/* Premium Modern Stylesheet - Glassmorphism & Sleek Dark Mode */
:root {
  --font-title: 'Outfit', 'Sarabun', sans-serif;
  --font-body: 'Inter', 'Sarabun', sans-serif;
  
  /* Harmonious Color Palette */
  --bg-app: #080b11;
  --card-bg: rgba(17, 25, 40, 0.6);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: rgba(0, 0, 0, 0.5);
  
  --primary: hsl(12, 100%, 55%); /* Shopee Deep Orange */
  --primary-glow: hsla(12, 100%, 55%, 0.4);
  --accent: hsl(345, 100%, 48%); /* Coral Red */
  --accent-glow: hsla(345, 100%, 48%, 0.4);
  
  --indigo: hsl(245, 80%, 65%);
  --indigo-glow: hsla(245, 80%, 65%, 0.3);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.2);
  
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Glowing Background Lights */
.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(150px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
}

.glow-orange {
  top: -100px;
  right: -100px;
  background-color: var(--primary);
}

.glow-indigo {
  bottom: -150px;
  left: -150px;
  background-color: var(--indigo);
}

/* App Container & Layout */
.app-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Header Styles */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.logo-text h1 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text h1 span {
  background: linear-gradient(135deg, #ff9500, #ff2d55);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Session Cookie Indicator */
.session-status {
  padding: 0.75rem 1.25rem !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 250px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background-color: var(--text-muted);
}

.status-dot.active {
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse 1.8s infinite;
}

.status-dot.warning {
  background-color: #ffaa00;
  box-shadow: 0 0 10px #ffaa00;
  animation: pulse 1.8s infinite;
}

.status-dot.inactive {
  background-color: var(--error);
  box-shadow: 0 0 10px var(--error);
}

.status-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Main Grid */
.app-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2rem;
}

@media (max-width: 968px) {
  .app-main-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Styling (Glassmorphism) */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 10px 30px var(--card-shadow);
  padding: 1.5rem;
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.section-card {
  margin-bottom: 2rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.header-icon {
  font-size: 1.25rem;
  color: var(--primary);
  background: rgba(255, 90, 0, 0.1);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.card-header h2 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 600;
}

.header-title-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

/* Textarea & Inputs styling */
.textarea-wrapper {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  padding: 0.5rem;
  transition: var(--transition-smooth);
  margin-bottom: 0.75rem;
}

.textarea-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 90, 0, 0.15);
}

textarea, input[type="text"], input[type="url"] {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

textarea {
  min-height: 80px;
}

input[type="text"], input[type="url"] {
  height: 46px;
  padding: 0 1rem;
}

.input-with-button {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.input-with-button:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 90, 0, 0.15);
}

.input-with-button input {
  flex-grow: 1;
}

/* Forms and Labels */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.label-with-action label {
  margin-bottom: 0;
}

.helper-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  margin-top: -0.25rem;
}

/* Buttons */
.btn {
  font-family: var(--font-title);
  font-weight: 600;
  border: none;
  outline: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  height: 42px;
  padding: 0 1.25rem;
  border-radius: var(--border-radius-md);
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0 1rem;
  height: 46px;
  border-radius: var(--border-radius-md);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-accent {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: var(--border-radius-md);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 90, 0, 0.5);
  filter: brightness(1.1);
}

.btn-accent:active {
  transform: translateY(0);
}

.btn-large {
  width: 100%;
  height: 52px;
  font-size: 1.05rem;
}

.btn-icon {
  background: rgba(255, 90, 0, 0.1);
  color: var(--primary);
  border: none;
  padding: 0 1.25rem;
  height: 46px;
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--primary);
  color: #fff;
}

.btn-text-action {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-text-action:hover {
  color: #fff;
  transform: scale(1.03);
}

/* Product Tag Pills */
.product-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.product-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.product-pill i {
  color: var(--text-secondary);
  cursor: pointer;
}

.product-pill i:hover {
  color: var(--error);
}

/* Job Cards & Queue */
.scrollable-card {
  max-height: 800px;
  overflow-y: auto;
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 0.9rem;
}

/* Job Card Details */
.job-item {
  background: rgba(30, 41, 59, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.job-item:hover {
  background: rgba(30, 41, 59, 0.45);
  border-color: rgba(255, 90, 0, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

/* Job Status Glow Left border decoration */
.job-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-muted);
}

.job-item.pending::before { background: var(--warning); }
.job-item.processing::before { background: var(--indigo); }
.job-item.posting::before { background: var(--primary); }
.job-item.completed::before { background: var(--success); }
.job-item.failed::before { background: var(--error); }

.job-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.job-id {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.job-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.job-badge.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.job-badge.processing { background: rgba(99, 102, 241, 0.15); color: var(--indigo); }
.job-badge.posting { background: rgba(255, 90, 0, 0.15); color: var(--primary); }
.job-badge.completed { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.job-badge.failed { background: rgba(239, 68, 68, 0.15); color: var(--error); }

.delete-single-job-btn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  padding: 0;
}
.delete-single-job-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
  transform: scale(1.05);
}
.collapse-job-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 0 8px;
  height: 26px;
  font-size: 0.7rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.collapse-job-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}
.job-item.collapsed {
  padding-bottom: 0.75rem;
  padding-top: 0.75rem;
  gap: 0;
}

.job-url {
  font-size: 0.85rem;
  color: var(--indigo);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.job-caption-text {
  font-size: 0.92rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  line-height: 1.6;
  white-space: pre-wrap;
}

.job-products-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.job-product-tag {
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: var(--text-secondary);
}

.job-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.job-error-msg {
  color: var(--error);
  font-size: 0.8rem;
  background: var(--error-glow);
  padding: 0.5rem;
  border-radius: 4px;
  border-left: 2px solid var(--error);
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.modal-content {
  width: 100%;
  max-width: 900px;
  z-index: 1001;
  padding: 1.5rem;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: #fff;
}

.modal-body img {
  width: 100%;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.6);
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* Card Collapse / Expand Toggle Styles */
.btn-card-toggle {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.18), rgba(255, 160, 0, 0.12));
  color: #ff9d54;
  border: 1px solid rgba(255, 157, 84, 0.4);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  margin-left: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  outline: none;
}

.btn-card-toggle:hover {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.4), rgba(255, 150, 0, 0.4));
  color: #ffffff;
  border-color: rgba(255, 175, 95, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.4);
}

.btn-card-toggle:active {
  transform: translateY(0);
}

.btn-card-toggle.is-collapsed {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-card-toggle.is-collapsed:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.35);
}

.section-card.collapsed .card-body,
.section-card.card.collapsed .card-body,
.card.collapsed .card-body {
  display: none !important;
}

.section-card.collapsed,
.section-card.card.collapsed,
.card.collapsed {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
  opacity: 0.92;
  transition: all 0.3s ease;
}

.section-card.collapsed .card-header,
.section-card.card.collapsed .card-header,
.card.collapsed .card-header {
  border-bottom: none !important;
  border-radius: var(--border-radius-lg);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Semi-Auto UI & Mode Selector Styling */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.mode-option {
  position: relative;
  cursor: pointer;
}
.mode-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-md);
  text-align: center;
  transition: var(--transition-smooth);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.mode-option input[type="radio"]:checked + .mode-card {
  background: rgba(255, 90, 0, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(255, 90, 0, 0.15);
  color: #fff;
}
.mode-card i {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}
.mode-option input[type="radio"]:checked + .mode-card i {
  color: var(--primary);
}
.mode-card span.mode-desc {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.mode-option input[type="radio"]:checked + .mode-card span.mode-desc {
  color: var(--text-secondary);
}

/* Semi-Auto UI in Job items */
.job-actions-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(17, 24, 39, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 0.75rem;
  gap: 0.75rem;
  width: 100%;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 10px 25px rgba(0, 0, 0, 0.25);
}
.qr-code-img {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: var(--transition-smooth);
}
.qr-code-img:hover {
  transform: scale(1.05);
}
.qr-label {
  font-size: 0.82rem;
  color: var(--text-primary);
  text-align: center;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}
.qr-label i {
  color: var(--primary);
  filter: drop-shadow(0 0 5px var(--primary-glow));
}
.copy-tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 90, 0, 0.07);
  border: 1px solid rgba(255, 90, 0, 0.15);
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}
.copy-tag-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px var(--primary-glow);
}

/* Modern Select Dropdown Styling */
select {
  width: 100%;
  height: 46px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  padding: 0 1rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3f4f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2em;
}

select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 90, 0, 0.15);
}

select option {
  background-color: #0b0f19;
  color: var(--text-primary);
  padding: 0.5rem;
}

/* SweetAlert2 Dark Custom Styling */
.swal2-popup.swal2-dark-custom {
  background: rgba(17, 25, 40, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: var(--border-radius-lg) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
}

.swal2-title {
  font-family: var(--font-title) !important;
  color: var(--text-primary) !important;
}

.swal2-html-container {
  font-family: var(--font-body) !important;
  color: var(--text-secondary) !important;
}

.swal2-confirm.swal2-styled {
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  border-radius: var(--border-radius-md) !important;
  font-family: var(--font-body) !important;
  font-weight: 500 !important;
  box-shadow: 0 4px 12px var(--primary-glow) !important;
  transition: var(--transition-smooth) !important;
}

.swal2-confirm.swal2-styled:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px var(--primary-glow) !important;
}

.swal2-cancel.swal2-styled {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: var(--border-radius-md) !important;
  font-family: var(--font-body) !important;
  color: var(--text-primary) !important;
  transition: var(--transition-smooth) !important;
}

.swal2-cancel.swal2-styled:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

.swal2-timer-progress-bar {
  background: var(--primary) !important;
}

/* Customize focus behavior for button */
.swal2-styled:focus {
  box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.4) !important;
}

/* Trending Product Grid & Items */
.affiliate-product-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  transition: var(--transition-smooth);
}
.affiliate-product-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 90, 0, 0.2);
  transform: translateY(-1px);
}
.affiliate-product-img {
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius-sm);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.affiliate-product-info {
  flex-grow: 1;
  min-width: 0;
}
.affiliate-product-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}
.affiliate-product-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  align-items: center;
}
.affiliate-product-price {
  color: #ff9500;
  font-weight: 700;
}
.affiliate-product-comm {
  color: var(--success);
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}
.affiliate-product-actions {
  display: flex;
  gap: 0.3rem;
}
.affiliate-product-actions button, .affiliate-product-actions a {
  height: 28px;
  font-size: 0.68rem;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* AI Product Rank Badge */
.affiliate-product-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
.affiliate-product-rank-badge.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ffa500);
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
  color: #0b0f19;
}
.affiliate-product-rank-badge.rank-2 {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  border-color: #cbd5e1;
  box-shadow: 0 0 8px rgba(226, 232, 240, 0.3);
  color: #0b0f19;
}
.affiliate-product-rank-badge.rank-3 {
  background: linear-gradient(135deg, #d97706, #78350f);
  border-color: #f59e0b;
  box-shadow: 0 0 8px rgba(217, 119, 6, 0.3);
}

/* AI Product Card Layout styling (Super Compact Version) */
.affiliate-product-item-card {
  background: rgba(30, 41, 59, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  min-width: 0;
  overflow: hidden;
}

.affiliate-product-item-card:hover {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(255, 90, 0, 0.3);
  box-shadow: 0 6px 20px rgba(255, 90, 0, 0.1);
  transform: translateY(-1px);
}

.prod-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.prod-card-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-grow: 1;
  min-width: 0;
}

.prod-card-left .affiliate-product-img {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.prod-card-left .affiliate-product-rank-badge {
  min-width: 20px;
  height: 20px;
  font-size: 0.65rem;
}

.prod-title-and-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-grow: 1;
  min-width: 0;
}

.prod-title-and-meta .affiliate-product-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Meta Row inside Title Area */
.prod-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.meta-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.meta-pill.price {
  color: #ffa500;
  background: rgba(255, 165, 0, 0.1);
}

.meta-pill.comm {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.meta-pill.sold {
  color: var(--indigo);
  background: rgba(99, 102, 241, 0.1);
}

/* Actions Row styling */
.prod-card-right-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.action-btn-compact {
  height: 26px;
  width: 26px;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.action-btn-compact:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.action-btn-compact.use-btn {
  width: auto;
  padding: 0 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 3px 8px var(--primary-glow);
}

.action-btn-compact.use-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(255, 90, 0, 0.3);
}

/* AI Insights styling (super compact) */
.prod-card-ai-compact {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
}

.ai-label-pill {
  font-size: 0.65rem;
  font-weight: 700;
  color: #ff9500;
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.2);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.ai-insight-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

/* ===== Filter Chip Bar ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem 1rem;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  user-select: none;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(255, 90, 0, 0.15), rgba(255, 45, 85, 0.12));
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 90, 0, 0.2), 0 0 4px rgba(255, 45, 85, 0.15);
}

.filter-chip.active:hover {
  box-shadow: 0 0 18px rgba(255, 90, 0, 0.3), 0 0 6px rgba(255, 45, 85, 0.2);
}

.filter-chip-count {
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.05rem 0.35rem;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 700;
}

.filter-chip.active .filter-chip-count {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
}

/* Filter bar spacer pushes toggle to right */
.filter-bar-spacer {
  flex-grow: 1;
}

/* Toggle button for used products */
.toggle-used-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.toggle-used-btn:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--text-secondary);
}

.toggle-used-btn.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.toggle-used-btn .used-count-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  padding: 0.05rem 0.3rem;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* ===== Used Product Card Overlay ===== */
.affiliate-product-item-card.used-product {
  opacity: 0.45;
  border-color: rgba(16, 185, 129, 0.2);
  position: relative;
}

.affiliate-product-item-card.used-product .use-btn {
  display: none;
}

.used-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--success);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  z-index: 2;
}

/* ===== Fade-out Slide-down Animation ===== */
@keyframes fadeOutSlideDown {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 200px;
    margin-bottom: 0.65rem;
    padding: 0.6rem 0.85rem;
  }
  40% {
    opacity: 0.5;
    transform: translateY(5px) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
    max-height: 0;
    margin-bottom: 0;
    padding: 0;
    border-width: 0;
    overflow: hidden;
  }
}

.affiliate-product-item-card.fade-out-used {
  animation: fadeOutSlideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

/* ===== Filter Results Empty State ===== */
.filter-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.filter-empty-state i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
  color: var(--text-muted);
  opacity: 0.6;
}

.filter-empty-state p {
  font-size: 0.85rem;
  line-height: 1.5;
}


/* ===== Video Spin Settings Accordion ===== */
.spin-settings-accordion {
  margin-bottom: 1.25rem;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  background: rgba(17, 25, 40, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

.spin-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-smooth);
}

.spin-settings-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.spin-settings-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.spin-settings-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.spin-settings-arrow.open {
  transform: rotate(180deg);
}

.spin-settings-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.spin-settings-body.open {
  max-height: 700px;
}

.spin-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0 1rem 1rem 1rem;
}

.spin-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
}

.spin-option-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.spin-option-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex-grow: 1;
}

.spin-option-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.spin-option-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* iOS-style Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  transition: var(--transition-smooth);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: var(--transition-smooth);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #fff;
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(255, 90, 0, 0.25);
}

/* Speed Selector inside grid */
.spin-option-speed {
  grid-column: 1 / -1;
}

.spin-speed-select {
  width: 170px;
  height: 36px;
  font-size: 0.82rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-sm);
  padding: 0 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3f4f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1em;
}

.spin-speed-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 90, 0, 0.15);
}

.spin-speed-select option {
  background-color: #0b0f19;
  color: var(--text-primary);
}

/* Responsive: stack to 1 column on mobile */
@media (max-width: 768px) {
  .spin-options-grid {
    grid-template-columns: 1fr;
  }
  .spin-speed-select {
    width: 100%;
  }
}

/* Progress Bar styling */
.job-progress-container {
  margin-top: 0.8rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-sm);
  padding: 0.65rem 0.8rem;
}

.job-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  align-items: center;
}

.job-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.job-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 3px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--primary-glow);
  position: relative;
}

/* Add a dynamic shine animation effect to the progress bar filling */
.job-progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: progress-shimmer 1.5s infinite linear;
  background-size: 200% 100%;
}

@keyframes progress-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}


/* ==========================================
   10K/DAY UPGRADES: TABS & LAYOUTS STYLING
   ========================================== */

/* Tab Navigation Bar */
.app-nav-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
  overflow-x: auto;
}

.tab-btn {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-radius: var(--border-radius-md);
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  white-space: nowrap;
  outline: none;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.tab-btn.active {
  background: rgba(255, 90, 0, 0.12);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 90, 0, 0.15);
}

/* Tab Content Visibility */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

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

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

/* Sourcing & ROI Tables */
.roi-table {
  width: 100%;
  border-collapse: collapse;
}

.roi-table th {
  font-family: var(--font-title);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1rem;
}

.roi-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.roi-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Campaign Checklist steps styling */
.campaign-checklist-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklist-step {
  display: flex;
  gap: 0.75rem;
  align-items: start;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.85rem 1rem;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: var(--transition-smooth);
}

.checklist-step:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.checklist-step input[type="checkbox"]:checked + .step-details .step-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-step input[type="checkbox"]:checked + .step-details .step-desc {
  color: var(--text-muted);
  opacity: 0.6;
}

/* KPI Summary Cards adjustments */
.roi-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.roi-stat-card {
  padding: 1.5rem !important;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.roi-stat-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.roi-stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  margin-top: 0.35rem;
  font-family: var(--font-title);
  letter-spacing: -0.5px;
}

.roi-stat-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Custom Table scroll wrappers */
.sourcing-table-wrapper, .roi-table-wrapper {
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-queue-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-main);
  font-family: monospace;
  font-size: 0.85rem;
  resize: vertical;
  transition: var(--transition-smooth);
  outline: none;
}

.custom-queue-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 90, 0, 0.15);
}

.btn:disabled, .btn-accent:disabled {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-muted) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
  filter: grayscale(1) brightness(0.6) !important;
  opacity: 0.35 !important;
}

/* ============================================================
   📱 FULL COMPREHENSIVE MOBILE & TABLET RESPONSIVE SYSTEM
   ============================================================ */
@media (max-width: 968px) {
  .app-main-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

@media (max-width: 768px) {
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .app-container {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 0.85rem 0.6rem !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Header & Logo */
  .app-header {
    flex-direction: column !important;
    align-items: stretch !important;
    margin-bottom: 1.25rem !important;
    gap: 1rem !important;
  }

  .logo-area {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  .logo-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.4rem !important;
    border-radius: 12px !important;
    flex-shrink: 0 !important;
  }

  .logo-text {
    flex: 1 !important;
    min-width: 0 !important;
  }

  .logo-text h1 {
    font-size: 1.25rem !important;
    line-height: 1.2 !important;
  }

  .logo-text p {
    font-size: 0.75rem !important;
    margin-top: 2px !important;
    line-height: 1.3 !important;
  }

  .session-status {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.65rem 0.85rem !important;
    border-radius: 12px !important;
  }

  /* Tab Navigation */
  .app-nav-tabs {
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 1.25rem !important;
    width: 100% !important;
  }

  .tab-btn {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 0.85rem !important;
    padding: 0.75rem 0.85rem !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
  }

  /* Cards & Sections */
  .app-main-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  .column-left, .column-right {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .card, .section-card {
    padding: 1rem 0.75rem !important;
    border-radius: 14px !important;
    margin-bottom: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .card-header {
    gap: 0.5rem !important;
    margin-bottom: 0.85rem !important;
    padding-bottom: 0.65rem !important;
    flex-wrap: wrap !important;
  }

  .card-header h2 {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
  }

  .header-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.95rem !important;
    flex-shrink: 0 !important;
  }

  .btn-card-toggle {
    font-size: 0.7rem !important;
    padding: 3px 8px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }

  /* Form Controls, Inputs, Selects, Buttons */
  input, select, textarea, button {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  select {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 0.85rem !important;
    height: 42px !important;
    padding: 0 8px !important;
  }

  select option {
    font-size: 0.82rem !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .form-group {
    margin-bottom: 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .form-group label {
    font-size: 0.85rem !important;
    word-break: break-word !important;
  }

  .helper-text {
    font-size: 0.75rem !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
  }

  .input-with-button {
    flex-direction: column !important;
    border-radius: var(--border-radius-md) !important;
    width: 100% !important;
  }

  .input-with-button input {
    width: 100% !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .input-with-button .btn {
    width: 100% !important;
    border-radius: 0 !important;
    height: 42px !important;
  }

  .btn {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .btn-large {
    height: 48px !important;
    font-size: 0.95rem !important;
  }

  /* Job items & Tables */
  .job-item {
    padding: 0.85rem 0.65rem !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .job-header-row, .job-footer-row {
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }

  .job-url {
    font-size: 0.75rem !important;
  }

  .job-caption-text {
    font-size: 0.82rem !important;
    padding: 0.65rem 0.75rem !important;
  }

  .sourcing-table-wrapper, .roi-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    display: block !important;
  }

  .roi-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.65rem !important;
  }

  .roi-stat-card {
    padding: 0.85rem 0.65rem !important;
  }

  .roi-stat-value {
    font-size: 1.3rem !important;
  }
}

@media (max-width: 480px) {
  .roi-stats-grid {
    grid-template-columns: 1fr !important;
  }

  .logo-text h1 {
    font-size: 1.1rem !important;
  }
}


/* ==========================================================
   Modern Sleek Queue & History Header Design
   ========================================================== */
.queue-card-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
  padding: 0.85rem 1rem !important;
  background: linear-gradient(135deg, rgba(255, 90, 0, 0.06) 0%, rgba(30, 30, 42, 0.6) 100%) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin-bottom: 1rem !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

.queue-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 200px;
}

.modern-queue-icon {
  background: linear-gradient(135deg, rgba(255, 90, 0, 0.25) 0%, rgba(255, 140, 0, 0.1) 100%) !important;
  color: #ff8c42 !important;
  border: 1px solid rgba(255, 140, 0, 0.3) !important;
  box-shadow: 0 0 12px rgba(255, 90, 0, 0.25) !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.queue-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.queue-title-block h2 {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  letter-spacing: -0.01em;
}

.queue-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
}

.queue-status-badge .pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.queue-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-queue-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  outline: none;
}

.btn-cancel-queue {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.btn-cancel-queue:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-cancel-queue:active {
  transform: translateY(0);
}

.btn-clear-queue {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.btn-clear-queue:hover {
  background: rgba(255, 140, 0, 0.12);
  border-color: rgba(255, 140, 0, 0.4);
  color: #ff8c42;
  box-shadow: 0 0 14px rgba(255, 140, 0, 0.2);
  transform: translateY(-1px);
}

.btn-clear-queue:active {
  transform: translateY(0);
}


/* ==========================================================
   Beacon Pulsing Indicator Badges (ไฟกระพริบชี้เป้าช่องกรอก)
   ========================================================== */
.beacon-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.beacon-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Orange Beacon (Video) */
.beacon-orange {
  background: rgba(255, 90, 0, 0.12);
  border: 1px solid rgba(255, 90, 0, 0.4);
  color: #ff9500;
  box-shadow: 0 0 10px rgba(255, 90, 0, 0.2);
}
.beacon-orange .beacon-light {
  background-color: #ff5722;
  box-shadow: 0 0 10px #ff5722;
  animation: beaconPulseOrange 1.4s infinite ease-in-out;
}
@keyframes beaconPulseOrange {
  0%, 100% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px #ff5722; }
  50% { opacity: 0.3; transform: scale(0.7); box-shadow: 0 0 3px #ff5722; }
}

/* Green Beacon (Affiliate) */
.beacon-green {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.beacon-green .beacon-light {
  background-color: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: beaconPulseGreen 1.4s infinite ease-in-out;
}
@keyframes beaconPulseGreen {
  0%, 100% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px #10b981; }
  50% { opacity: 0.3; transform: scale(0.7); box-shadow: 0 0 3px #10b981; }
}

/* Blue Beacon (Product Name) */
.beacon-blue {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}
.beacon-blue .beacon-light {
  background-color: #0284c7;
  box-shadow: 0 0 10px #38bdf8;
  animation: beaconPulseBlue 1.4s infinite ease-in-out;
}
@keyframes beaconPulseBlue {
  0%, 100% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px #38bdf8; }
  50% { opacity: 0.3; transform: scale(0.7); box-shadow: 0 0 3px #38bdf8; }
}

/* Focused input pulsing outline */
#tiktokUrl:focus, #affiliateUrlInput:focus, #productName:focus {
  border-color: #ff5722 !important;
  box-shadow: 0 0 15px rgba(255, 87, 34, 0.35) !important;
  outline: none;
}
