/**
 * DreamLook App - Main Styles
 * Extracted from monolithic index.html for better organization
 */

/* ==========================================
   BASE & RESET
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #0a0a0a;
  color: #fff;
  overflow: hidden;
}

/* ==========================================
   NAVBAR
   ========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.05em;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a;
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.credits-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #fbbf24;
}

.tier-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-badge.tier-free {
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.2);
}

.tier-badge.tier-standard {
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

.tier-badge.tier-pro {
  color: #8b5cf6;
  border-color: rgba(139, 92, 246, 0.2);
}

.tier-badge.tier-ultra {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.2);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(234, 88, 12, 0.1));
}

.user-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

/* ==========================================
   LAYOUT
   ========================================== */
.main-layout {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
}

/* ==========================================
   LEFT SIDEBAR
   ========================================== */
.left-sidebar {
  width: 280px;
  background: #0a0a0a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  overflow-x: visible;
  padding: 20px;
  position: relative;
}

.section {
  margin-bottom: 20px;
  position: relative;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 8px;
}

/* ==========================================
   TAB SWITCHER
   ========================================== */
.tab-switcher {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #888;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ccc;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}

/* ==========================================
   CUSTOM DROPDOWN
   ========================================== */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-trigger {
  width: 100%;
  padding: 9px 12px;
  padding-right: 32px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.dropdown-trigger:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.dropdown-trigger svg {
  flex-shrink: 0;
  color: #999;
}

.dropdown-text {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
  padding: 3px;
}

.dropdown-option {
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.dropdown-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-option.selected {
  background: rgba(255, 255, 255, 0.12);
}

.dropdown-option-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.dropdown-option-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.dropdown-option-icon-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.dropdown-option-emoji {
  font-size: 14px;
  flex-shrink: 0;
}

.dropdown-option-name {
  font-weight: 500;
  font-size: 12px;
}

.dropdown-credit-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  flex-shrink: 0;
}

.credit-icon {
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fbbf24;
  border-radius: 50%;
  color: #000;
  font-size: 8px;
  font-weight: 700;
}

.credit-value {
  font-size: 11px;
  font-weight: 600;
  color: #fbbf24;
}

/* ==========================================
   PROMPT AREA
   ========================================== */
.prompt-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 150px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  resize: vertical;
  transition: all 0.2s;
}

.prompt-textarea:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(255, 255, 255, 0.05);
}

.prompt-textarea::placeholder {
  color: #555;
}

/* ==========================================
   UPLOAD & DROP ZONE
   ========================================== */
.upload-btn {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.upload-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ccc;
}

.drop-zone {
  width: 100%;
  min-height: 50px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.drop-zone:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.2);
}

.drop-zone.drag-over {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  border-style: solid;
}

.drop-zone.drag-over .drop-icon {
  color: #3b82f6;
  transform: scale(1.1);
}

.drop-icon {
  color: #666;
  opacity: 0.6;
  transition: all 0.3s;
  width: 18px;
  height: 18px;
}

.drop-text {
  font-size: 11px;
  font-weight: 500;
  color: #ccc;
  line-height: 1.1;
}

.drop-hint {
  display: none;
}

.drop-limit {
  font-size: 8px;
  color: #666;
  margin-top: 0;
}

/* ==========================================
   PREVIEW CONTAINER
   ========================================== */
.preview-container {
  margin-top: 5px;
  max-height: 44px;
  overflow-y: auto;
  overflow-x: hidden;
}

.preview-container::-webkit-scrollbar {
  width: 4px;
}

.preview-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 2px;
}

.preview-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.preview-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
}

.preview-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  padding: 0;
}

.preview-item:hover .remove-btn {
  opacity: 1;
}

.preview-item .remove-btn:hover {
  background: #ef4444;
  transform: scale(1.05);
}

.preview-item .remove-btn svg {
  width: 10px;
  height: 10px;
  color: #fff;
}

.ref-count {
  font-size: 10px;
  color: #666;
  font-weight: 500;
  text-transform: none;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================
   GENERATE BUTTON
   ========================================== */
.generate-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.generate-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.generate-btn:disabled {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================
   COMPACT CONTROLS
   ========================================== */
.compact-controls {
  position: relative;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.control-btn {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.control-btn svg {
  width: 11px;
  height: 11px;
}

.control-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.control-value {
  width: 36px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.control-setting {
  height: 32px;
  min-width: 60px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #e5e5e5;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.control-setting svg {
  width: 12px;
  height: 12px;
}

.control-setting:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.control-setting.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.control-setting.readonly {
  color: #ccc;
  cursor: default;
  pointer-events: none;
}

.video-info {
  height: 32px;
  min-width: 60px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: default;
}

/* ==========================================
   SETTING POPUP
   ========================================== */
.setting-popup {
  position: fixed;
  min-width: 140px;
  max-width: 200px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  padding: 4px;
  max-height: 400px;
  overflow-y: auto;
}

.setting-popup[style*="display: block"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.popup-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.popup-option {
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #ccc;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  display: block;
}

.popup-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.popup-option.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.popup-option-text {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
}

.popup-option-label {
  font-size: 12px;
  font-weight: 600;
  color: #e5e5e5;
  white-space: nowrap;
  min-width: 35px;
}

.popup-option-desc {
  font-size: 11px;
  color: #888;
  font-weight: 400;
  white-space: nowrap;
}

/* ==========================================
   RIGHT PANEL (GALLERY)
   ========================================== */
.right-panel {
  flex: 1;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gallery-sticky-header {
  flex-shrink: 0;
  padding: 16px 16px 0 16px;
  background: #0a0a0a;
  z-index: 10;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.gallery-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px 16px;
}

.gallery-title {
  font-size: 14px;
  font-weight: 600;
  color: #999;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-count {
  font-size: 12px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  color: #666;
}

/* Gallery Type Dropdown */
.gallery-type-dropdown {
  position: relative;
}

.gallery-type-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #ccc;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gallery-type-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.gallery-type-btn svg {
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.gallery-type-dropdown.open .gallery-type-btn svg {
  transform: rotate(180deg);
}

.gallery-type-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 140px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 100;
  padding: 4px;
  overflow: hidden;
}

.gallery-type-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  color: #999;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gallery-type-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.gallery-type-option.active {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.type-count {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #666;
}

.gallery-type-option.active .type-count {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.gallery-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ==========================================
   MASONRY GRID - Pinterest-style layout
   Using CSS Grid for better space filling
   ========================================== */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 6px;
  gap: 6px;
}

@media (max-width: 1800px) {
  .masonry-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 1400px) {
  .masonry-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1100px) {
  .masonry-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 800px) {
  .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .masonry-grid {
    grid-template-columns: 1fr;
  }
}

.masonry-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}

.masonry-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.masonry-item:hover img {
  transform: scale(1.03);
}

.masonry-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
}

.masonry-item:hover .overlay {
  opacity: 1;
}

.overlay-prompt {
  font-size: 11px;
  color: #fff;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================
   GALLERY ITEM (New with Lightbox + Selection)
   Pinterest-style masonry layout with CSS Grid
   ========================================== */
.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #111;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 80px;
}

.gallery-item img {
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
}

/* Skeleton loading effect for lazy loaded images */
.gallery-item img.img-loading {
  min-height: 100px;
  background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  opacity: 0.7;
}

.gallery-item img.img-error {
  min-height: 100px;
  background: #1a1a1a;
  opacity: 0.5;
}

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

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.gallery-item:hover img {
  transform: scale(1.02);
}

/* Video in gallery */
.gallery-item video,
.gallery-item .gallery-video {
  width: 100%;
  min-height: 120px;
  height: auto;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border-radius: 8px;
}

/* Ensure video has proper aspect ratio before metadata loads */
.gallery-item video:not([data-loaded="true"]) {
  aspect-ratio: 16/9;
  min-height: 100px;
}

.gallery-item:hover video,
.gallery-item:hover .gallery-video {
  transform: scale(1.02);
}

/* Media type badge (Video/Image) - top left */
.gallery-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.gallery-type-badge.video {
  background: rgba(139, 92, 246, 0.8);
}

.gallery-type-badge.image {
  background: rgba(59, 130, 246, 0.8);
}

.gallery-type-badge svg {
  width: 12px;
  height: 12px;
}

/* Model badge - top right */
.gallery-model-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #e5e5e5;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  z-index: 10;
  backdrop-filter: blur(4px);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Video badge - legacy, keep for compatibility */
.video-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
  backdrop-filter: blur(4px);
}

/* Video error placeholder */
.video-error-placeholder {
  width: 100%;
  height: 100%;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
  color: #a78bfa;
  border-radius: 8px;
}

.video-error-placeholder svg {
  opacity: 0.6;
}

.video-error-placeholder span {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.8;
}

/* Gallery video play button overlay - smaller for compact gallery */
.gallery-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 5;
  transition: all 0.2s;
  pointer-events: none;
}

.gallery-video-play svg {
  width: 18px;
  height: 18px;
}

.gallery-item:hover .gallery-video-play {
  background: rgba(139, 92, 246, 0.8);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Video Info Banner */
.video-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  margin-bottom: 12px;
}

.video-info-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.2);
  border-radius: 6px;
  color: #818cf8;
}

.video-info-content {
  flex: 1;
  min-width: 0;
}

.video-info-title {
  font-size: 12px;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 6px;
}

.video-info-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.video-info-item {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.4;
}

.video-info-item strong {
  color: #e5e7eb;
  font-weight: 600;
}

.video-badge svg {
  width: 12px;
  height: 12px;
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 40px 20px;
  color: #666;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-text {
  font-size: 14px;
  margin-bottom: 8px;
}

.empty-hint {
  font-size: 12px;
  color: #444;
}

/* ==========================================
   SCROLLBAR
   ========================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

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

/* ==========================================
   MODALS
   ========================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 32px;
  width: 90%;
  max-width: 400px;
}

.modal-content-wide {
  max-width: 500px;
}

.modal-content-avatar {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.modal-subtitle {
  font-size: 13px;
  color: #999;
  text-align: center;
  margin-bottom: 24px;
}

.input-field {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* ==========================================
   PROFILE STYLES
   ========================================== */
.profile-section {
  margin-bottom: 24px;
}

.profile-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 12px;
}

.profile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-info-row:last-child {
  border-bottom: none;
}

.profile-info-label {
  font-size: 13px;
  color: #999;
}

.profile-info-value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.profile-avatar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0;
}

.profile-avatar-display {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s;
}

.profile-avatar-display:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.tier-badge-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tier-badge-lg.tier-free {
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.2);
}

.tier-badge-lg.tier-standard {
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.1);
}

.tier-badge-lg.tier-pro {
  color: #8b5cf6;
  border-color: rgba(139, 92, 246, 0.2);
  background: rgba(139, 92, 246, 0.1);
}

.tier-badge-lg.tier-ultra {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.2);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 88, 12, 0.15));
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  width: 100%;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #ef4444;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* ==========================================
   AVATAR PICKER
   ========================================== */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 16px 0;
  margin-top: 8px;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.avatar-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.avatar-option.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: #6366f1;
}

.avatar-image-container {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.avatar-image-option {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-name {
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  color: #999;
}

.avatar-option.selected .avatar-name {
  color: #fff;
}

/* ==========================================
   UPGRADE BUTTONS & LOCKED FEATURES
   ========================================== */
.upgrade-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.upgrade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.upgrade-btn-sm {
  padding: 6px 12px;
  font-size: 11px;
  gap: 4px;
}

.upgrade-btn svg {
  width: 14px;
  height: 14px;
}

.locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  border-radius: 8px;
}

.locked-icon {
  width: 32px;
  height: 32px;
  color: #fbbf24;
}

.locked-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-align: center;
}

.locked-hint {
  font-size: 12px;
  color: #999;
  text-align: center;
}

/* Enhanced locked overlay for FREE tier */
.locked-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  max-width: 280px;
}

.locked-icon-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.locked-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.locked-features {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.locked-features-title {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.locked-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.locked-features-list li {
  font-size: 12px;
  color: #aaa;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.upgrade-btn-locked {
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: 8px;
}

.upgrade-btn-locked:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.upgrade-btn-locked svg {
  width: 16px;
  height: 16px;
}

.locked-explore-hint {
  font-size: 11px;
  color: #666;
  text-align: center;
  margin-top: 4px;
}

.locked-explore-hint span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Free tier locked state for sidebar - allow browsing */
.free-tier-locked {
  position: relative;
}

/* Don't block sections - let users browse */
.free-tier-locked .prompt-section {
  opacity: 0.6;
}

/* Free tier info banner (non-blocking) */
.free-tier-banner {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}

.free-tier-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.free-tier-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.free-tier-banner-text {
  flex: 1;
  min-width: 0;
}

.free-tier-banner-title {
  font-size: 12px;
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 2px;
}

.free-tier-banner-subtitle {
  font-size: 11px;
  color: #999;
}

.free-tier-banner-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.free-tier-banner-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
}

.free-tier-banner-hint {
  font-size: 10px;
  color: #666;
  margin-top: 8px;
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Model locked badge for FREE tier */
.model-locked {
  position: relative;
}

.model-locked-badge {
  font-size: 10px;
  margin-left: 6px;
  opacity: 0.8;
}

.dropdown-option.model-locked:hover::after {
  content: 'Upgrade to use';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fbbf24;
}

/* ==========================================
   MODAL ANIMATIONS
   ========================================== */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
  .modal-content-avatar {
    max-width: 90%;
    padding: 24px;
  }

  .avatar-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .avatar-image-container {
    width: 50px;
    height: 50px;
  }

  .avatar-name {
    font-size: 9px;
  }

  .avatar-option {
    padding: 10px 6px;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .avatar-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .avatar-image-container {
    width: 45px;
    height: 45px;
  }

  .avatar-name {
    font-size: 8px;
  }
}

/* ==========================================
   QUEUE PANEL - Floating Button & Panel
   ========================================== */
.queue-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: all 0.3s;
  z-index: 1000;
}

.queue-floating-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.queue-floating-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.queue-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: #ef4444;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.queue-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 360px;
  max-height: 500px;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
}

.queue-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

.queue-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.queue-count {
  font-size: 12px;
  color: #666;
  font-weight: 400;
}

.queue-panel-actions {
  display: flex;
  gap: 8px;
}

.queue-clear-btn,
.queue-close-btn {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  transition: all 0.2s;
}

.queue-clear-btn:hover,
.queue-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.queue-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.queue-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  color: #555;
  font-size: 13px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.queue-item-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.queue-item-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.queue-item-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-item-prompt {
  font-size: 12px;
  color: #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.queue-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.queue-item-model {
  color: #888;
}

.queue-item-status {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
}

.queue-item-status.queued,
.queue-item-status.processing {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.queue-item-status.completed {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.queue-item-status.failed {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.queue-item-status.refunded {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.queue-item-status.retrying {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
}

/* Queue item extra info (retry/refund messages) */
.queue-item-extra {
  margin-top: 4px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.queue-item-extra.retry-info {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

.queue-item-extra.refund-info {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}

.queue-item-extra.error-info {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Retry badge on spinner */
.queue-item-placeholder {
  position: relative;
}

.retry-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #f97316;
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Retry spinner color */
.spinner.retry {
  border-color: rgba(249, 115, 22, 0.3);
  border-top-color: #f97316;
}

.queue-item-remove {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  opacity: 0;
  transition: all 0.2s;
}

.queue-item:hover .queue-item-remove {
  opacity: 1;
}

.queue-item-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Spinner animation */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================
   LIGHTBOX - Full-screen Image Viewer
   ========================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-modal.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-modal .lightbox-overlay {
  transition: backdrop-filter 0.3s ease;
}

.lightbox-modal .lightbox-container {
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox-modal.open .lightbox-container {
  transform: scale(1);
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.lightbox-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  align-items: stretch;
  z-index: 1;
  padding: 20px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.2s;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.2s;
  z-index: 10;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}

.lightbox-content {
  flex: 1;
  display: flex;
  gap: 24px;
  max-height: 80vh;
  margin: 0 60px;
}

.lightbox-image-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.lightbox-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-image-wrapper video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-type-badge {
  font-size: 11px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  color: #a78bfa;
  border-radius: 6px;
  font-weight: 600;
}

.lightbox-details {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  overflow-y: auto;
}

.lightbox-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.lightbox-counter {
  font-size: 12px;
  color: #888;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
}

.lightbox-info {
  flex: 1;
}

.lightbox-info-row {
  margin-bottom: 16px;
}

.lightbox-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin-bottom: 6px;
}

.lightbox-prompt {
  font-size: 13px;
  color: #ddd;
  line-height: 1.5;
  max-height: 150px;
  overflow-y: auto;
}

.lightbox-value {
  font-size: 13px;
  color: #fff;
}

.lightbox-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-btn {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lightbox-btn.download {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.lightbox-btn.download:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* ==========================================
   GALLERY FILTER BAR
   ========================================== */
.gallery-filter-bar {
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

.filter-select {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #ccc;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.filter-select:hover,
.filter-select:focus {
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-select option {
  background: #1a1a1a;
  color: #fff;
}

.custom-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #888;
  font-size: 12px;
}

.date-input {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  outline: none;
}

.date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

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

.filter-btn {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #888;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.filter-btn.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.filter-btn.reset-filter {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.filter-btn.reset-filter:hover {
  background: rgba(239, 68, 68, 0.2);
}

.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.selection-info {
  font-size: 12px;
  color: #777;
}

.selection-info span {
  color: #6366f1;
  font-weight: 600;
}

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

.selection-btn {
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  color: #888;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.selection-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.selection-btn.delete {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.selection-btn.delete:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Gallery Item Selection */
.masonry-grid.select-mode .gallery-item {
  cursor: pointer;
}

.gallery-select-checkbox {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.gallery-select-checkbox:hover {
  background: rgba(99, 102, 241, 0.5);
  border-color: #6366f1;
}

.masonry-grid.select-mode .gallery-select-checkbox {
  display: flex;
}

.gallery-select-checkbox svg {
  display: none;
  width: 12px;
  height: 12px;
}

.gallery-item.selected .gallery-select-checkbox {
  background: #6366f1;
  border-color: #6366f1;
}

.gallery-item.selected .gallery-select-checkbox svg {
  display: block;
  color: #fff;
}

.gallery-item.selected {
  outline: 2px solid #6366f1;
  outline-offset: -2px;
}

/* Gallery overlay for prompt preview */
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-prompt {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Gallery placeholder for processing/failed items */
.gallery-placeholder {
  width: 100%;
  height: 100%;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #666;
  font-size: 12px;
}

.gallery-placeholder.error {
  color: #ef4444;
}

/* ==========================================
   RESPONSIVE - Queue & Lightbox
   ========================================== */
@media (max-width: 768px) {
  .queue-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 80px;
  }

  .queue-floating-btn {
    right: 12px;
    bottom: 16px;
    width: 48px;
    height: 48px;
  }

  .lightbox-content {
    flex-direction: column;
    margin: 0 20px;
  }

  .lightbox-details {
    width: 100%;
    max-height: 200px;
  }

  .lightbox-nav.prev {
    left: 10px;
  }

  .lightbox-nav.next {
    right: 10px;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    justify-content: flex-start;
  }

  .selection-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .selection-actions {
    justify-content: flex-end;
  }
}


/* ==========================================
   HEADER NOTIFICATION PILL (Inside Navbar)
   ========================================== */
.header-notif-pill {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  user-select: none;
  white-space: nowrap;
  max-width: 600px;
  overflow: hidden;
}

.header-notif-pill.hidden {
  display: none;
}

.header-notif-pill .notif-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-notif-pill .notif-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Promotion - Green */
.header-notif-pill.promotion {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Warning - Amber */
.header-notif-pill.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Info - Blue */
.header-notif-pill.info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}



/* ==========================================
   HISTORY BUTTON & MODAL
   ========================================== */
.history-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  color: #10b981;
  cursor: pointer;
  transition: all 0.2s;
}

.history-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.25));
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.history-btn.has-active {
  animation: history-pulse 2s ease-in-out infinite;
}

@keyframes history-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.history-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* History Modal */
.history-modal-content {
  max-width: 700px;
  width: 95%;
  max-height: 85vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.history-title svg {
  color: #10b981;
}

.history-total {
  font-size: 14px;
  font-weight: 400;
  color: #666;
}

.history-close-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  transition: all 0.2s;
}

.history-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* History Filters */
.history-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.history-filters .filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-filter-select {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ccc;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.history-filter-select:hover,
.history-filter-select:focus {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.history-filter-select option {
  background: #1a1a1a;
  color: #fff;
}

.history-refresh-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  transition: all 0.2s;
  flex-shrink: 0;
}

.history-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Active Batches Section */
.active-batches-section {
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  flex-shrink: 0;
}

.active-batches-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14px;
}

.active-batches-hint {
  font-size: 11px;
  color: #888;
  font-weight: 400;
}

.active-batches-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.active-batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.batch-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.batch-jobs {
  font-weight: 600;
  font-size: 13px;
}

.batch-status {
  font-size: 11px;
  color: #888;
}

.batch-progress-bar {
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.batch-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Pulse animation for single jobs processing */
.batch-progress-fill.processing-pulse {
  animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% {
    opacity: 0.6;
    width: 30%;
  }
  50% {
    opacity: 1;
    width: 70%;
  }
}

/* Single jobs item styling */
.active-batch-item.single-jobs {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.active-batch-item.single-jobs .batch-progress-fill {
  background: linear-gradient(90deg, #22c55e, #10b981);
}

.batch-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  min-width: 40px;
  text-align: right;
}

/* History Stats */
.history-stats {
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
}

.stat-item:first-child .stat-value {
  color: #3b82f6;
}

.stat-item:nth-child(2) .stat-value {
  color: #22c55e;
}

.stat-item:nth-child(3) .stat-value {
  color: #fbbf24;
}

/* History List */
.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.history-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: #666;
  font-size: 13px;
}

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: #555;
  font-size: 14px;
  text-align: center;
}

.history-empty-hint {
  font-size: 12px;
  color: #444;
}

.history-retry-btn {
  margin-top: 8px;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  color: #6366f1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.history-retry-btn:hover {
  background: rgba(99, 102, 241, 0.25);
}

/* History Item */
.history-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.history-item.queued,
.history-item.processing {
  border-left: 3px solid #3b82f6;
}

.history-item.completed {
  border-left: 3px solid #22c55e;
}

.history-item.failed {
  border-left: 3px solid #ef4444;
}

.history-item.refunded {
  border-left: 3px solid #fbbf24;
}

.history-item-preview {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
  position: relative;
}

.history-item-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
}

.history-item-preview img:hover {
  transform: scale(1.05);
}

.history-item-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.history-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item-prompt {
  font-size: 13px;
  color: #e5e5e5;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-item-model {
  font-size: 11px;
  color: #888;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.history-item-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 4px;
}

.history-item-status.queued,
.history-item-status.processing {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.history-item-status.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.history-item-status.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.history-item-status.refunded {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.history-item-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.history-item-credits {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #fbbf24;
}

.history-item-date {
  font-size: 11px;
  color: #666;
}

.history-item-extra {
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-item-extra.refund-info {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}

.history-item-extra.error-info {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.history-item-extra.video-hint {
  background: rgba(139, 92, 246, 0.1);
  color: #a78bfa;
}

/* Video Item Styles */
.history-item.video-item {
  border-left: 3px solid #8b5cf6;
}

/* History video thumbnail - static, no interaction */
.history-video-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
  color: #a78bfa;
  border-radius: 8px;
}

/* History video preview - actual video thumbnail */
.history-video-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
}

/* Play icon overlay for history video - smaller size */
.history-video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  pointer-events: none;
  transition: all 0.2s ease;
}

.history-video-play-icon svg {
  width: 12px;
  height: 12px;
}

.history-item:hover .history-video-play-icon {
  background: rgba(139, 92, 246, 0.8);
  transform: translate(-50%, -50%) scale(1.1);
}

.history-item-preview .video-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.history-item-placeholder.video-placeholder {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
}

/* Clickable history items */
.history-item.clickable {
  cursor: pointer;
}

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

.history-item.clickable .history-item-preview:hover img,
.history-item.clickable .history-item-preview:hover .history-video-preview {
  transform: scale(1.05);
}

.type-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  font-weight: 600;
}

.type-badge.video {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

/* Loading Spinner (replaces progress bar) */
.loading-spinner {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner .spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spinnerRotate 1s linear infinite;
}

.loading-spinner.video-loading .spinner-ring {
  border-color: rgba(139, 92, 246, 0.2);
  border-top-color: #8b5cf6;
}

.loading-spinner .spinner-icon {
  color: #8b5cf6;
  z-index: 1;
}

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

/* Responsive */
@media (max-width: 600px) {
  .history-modal-content {
    max-height: 90vh;
  }
  
  .history-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .history-filters .filter-group {
    justify-content: space-between;
  }
  
  .history-stats {
    gap: 8px;
  }
  
  .stat-item {
    padding: 10px 8px;
  }
  
  .stat-value {
    font-size: 16px;
  }
  
  .history-item {
    padding: 12px;
  }
  
  .history-item-preview {
    width: 56px;
    height: 56px;
  }
}


/* ==========================================
   BATCH CONFIRMATION MODAL
   ========================================== */

.batch-confirm-modal .modal-content {
  max-width: 520px;
  padding: 0;
  overflow: hidden;
}

.batch-confirm-content {
  display: flex;
  flex-direction: column;
}

.batch-confirm-header {
  padding: 24px 24px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.batch-confirm-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.batch-confirm-icon svg {
  stroke: white;
}

.batch-confirm-header h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.batch-confirm-subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

.batch-confirm-body {
  padding: 20px 24px;
  max-height: 400px;
  overflow-y: auto;
}

/* Summary Stats */
.batch-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.batch-stat {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
}

.batch-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #8b5cf6;
  margin-bottom: 4px;
}

.batch-stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Settings Info */
.batch-settings-info {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.batch-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.batch-setting-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

.setting-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
}

/* Prompt Preview */
.batch-prompt-preview {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.prompt-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.875rem;
  font-weight: 500;
}

.prompt-preview-count {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.prompt-preview-list {
  padding: 8px 16px;
  max-height: 160px;
  overflow-y: auto;
}

.prompt-preview-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.prompt-preview-item:last-child {
  border-bottom: none;
}

.prompt-number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: rgba(139, 92, 246, 0.2);
  color: #8b5cf6;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.prompt-text {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
  word-break: break-word;
}

.prompt-preview-more {
  padding: 12px 0 8px;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

/* Info Note */
.batch-info-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
}

.batch-info-note svg {
  flex-shrink: 0;
  stroke: #3b82f6;
  margin-top: 1px;
}

.batch-info-note span {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

/* Footer */
.batch-confirm-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.batch-cancel-btn {
  flex: 1;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.batch-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.batch-confirm-btn {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.batch-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

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

/* Scrollbar for prompt preview */
.prompt-preview-list::-webkit-scrollbar {
  width: 6px;
}

.prompt-preview-list::-webkit-scrollbar-track {
  background: transparent;
}

.prompt-preview-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.prompt-preview-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}


/* ==========================================
   GALLERY LOADING & SKELETON IMPROVEMENTS
   ========================================== */

/* Gallery loading transition */
.gallery-grid.gallery-loading {
  opacity: 0.6;
  pointer-events: none;
}

.gallery-grid {
  transition: opacity 0.15s ease;
}

/* Better skeleton loading for gallery items - extends base .gallery-item */
.gallery-item img.loading {
  opacity: 0;
}

.gallery-item img.loaded {
  opacity: 1;
}

/* Skeleton placeholder while image/video loads */
.gallery-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  z-index: 0;
  border-radius: inherit;
}

.gallery-item.image-loaded::before,
.gallery-item.video-loaded::before {
  display: none;
}

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

/* Ensure media elements are above skeleton */
.gallery-item img,
.gallery-item video {
  position: relative;
  z-index: 1;
}

/* Loading spinner for gallery refresh */
.gallery-refresh-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10;
}


/* ==========================================
   DELETE CONFIRMATION MODAL
   ========================================== */

.delete-confirm-modal .modal-content {
  max-width: 400px;
  padding: 0;
  overflow: hidden;
}

.delete-confirm-content {
  display: flex;
  flex-direction: column;
}

.delete-confirm-header {
  padding: 24px 24px 16px;
  text-align: center;
}

.delete-confirm-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-confirm-icon svg {
  stroke: #ef4444;
}

.delete-confirm-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.delete-confirm-body {
  padding: 0 24px 20px;
  text-align: center;
}

.delete-confirm-message {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

.delete-confirm-message strong {
  color: #fff;
}

.delete-confirm-warning {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: #fbbf24;
}

.delete-confirm-warning svg {
  flex-shrink: 0;
  stroke: #fbbf24;
}

.delete-confirm-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.delete-cancel-btn {
  flex: 1;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.delete-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.delete-cancel-btn:focus {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

.delete-confirm-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: #ef4444;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.delete-confirm-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

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

.delete-confirm-btn svg {
  stroke: currentColor;
}


/* ==========================================
   QUEUE STATUS INDICATOR
   ========================================== */
.queue-status-indicator {
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.queue-status-indicator.queue-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.queue-status-indicator.queue-full {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.queue-status-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.queue-status-header svg {
  color: #666;
}

.queue-status-indicator.queue-warning .queue-status-header,
.queue-status-indicator.queue-warning .queue-status-header svg {
  color: #f59e0b;
}

.queue-status-indicator.queue-full .queue-status-header,
.queue-status-indicator.queue-full .queue-status-header svg {
  color: #ef4444;
}

.queue-status-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.queue-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.queue-status-indicator.queue-warning .queue-progress-fill {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.queue-status-indicator.queue-full .queue-progress-fill {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.queue-status-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.queue-status-text span:first-child {
  color: #ccc;
  font-weight: 500;
}

.queue-available {
  color: #22c55e;
  font-weight: 500;
}

.queue-status-indicator.queue-warning .queue-available {
  color: #f59e0b;
}

.queue-status-indicator.queue-full .queue-available {
  color: #ef4444;
}

/* Queue Full Message */
.queue-full-message {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  font-size: 11px;
  color: #fca5a5;
  line-height: 1.4;
}

.queue-full-message strong {
  color: #ef4444;
  font-weight: 600;
}

/* Batch Queue Status */
.batch-queue-status {
  margin-top: 8px;
  padding: 10px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 6px;
}

.batch-queue-status.batch-queue-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.batch-queue-status.batch-queue-full {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.batch-queue-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 6px;
}

.batch-queue-status.batch-queue-warning .batch-queue-header {
  color: #fbbf24;
}

.batch-queue-status.batch-queue-full .batch-queue-header {
  color: #fca5a5;
}

.batch-queue-info {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.4;
}

.batch-queue-info strong {
  color: #e5e7eb;
}



/* ==========================================
   VIRTUAL GALLERY - High Performance Scrolling
   ========================================== */

.virtual-gallery-content {
  position: relative;
  width: 100%;
}

.virtual-gallery-content .gallery-item {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  contain: layout style paint;
}

.virtual-gallery-content .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #1a1a1a;
}

.virtual-gallery-content .gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
}

/* Smooth transitions for virtual items */
.virtual-gallery-content .gallery-item {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

/* Loading skeleton for virtual gallery */
.virtual-gallery-content .gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  z-index: 0;
}

.virtual-gallery-content .gallery-item img,
.virtual-gallery-content .gallery-item video {
  position: relative;
  z-index: 1;
}
