/* styles.css - Modern Dark Theme with Glassmorphism and Gold Accents */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0b0d19;
  --bg-secondary: #13172d;
  --bg-tertiary: #1b203e;
  --bg-darker: #07080f;
  
  --accent-gold: #fbbf24;
  --accent-gold-rgb: 251, 191, 36;
  --accent-gold-hover: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --border-color: #242b4d;
  --border-focus: #fbbf24;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(251, 191, 36, 0.15);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  font-weight: 600;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* App Layout */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar Controls */
.sidebar {
  width: 380px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.sidebar-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-hover));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--bg-primary);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.sidebar-title h1 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(to right, var(--text-primary), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.sidebar-title span {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

/* Sections in Sidebar */
.sidebar-section {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-normal);
}

.sidebar-section:hover {
  border-color: rgba(var(--accent-gold-rgb), 0.3);
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group {
  margin-bottom: 12px;
}

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

label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
  width: 100%;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 12px 10px 36px;
  font-size: 14px;
  transition: all var(--transition-fast);
}

.input-wrapper select {
  cursor: pointer;
  appearance: none;
}

.input-wrapper textarea {
  resize: vertical;
  min-height: 80px;
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}

/* API Status Indicator */
.api-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.status-dot.connected {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* Slider and Range */
.slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-group input[type="range"] {
  flex-grow: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-darker);
  outline: none;
  cursor: pointer;
  accent-color: var(--accent-gold);
}

.slider-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 24px;
  text-align: right;
}

/* Main Action Buttons */
.btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all var(--transition-normal);
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-hover));
  color: var(--bg-primary);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(251, 191, 36, 0.35), var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  margin-top: 10px;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(var(--accent-gold-rgb), 0.5);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg-primary);
  overflow: hidden;
}

/* Top Navigation / Tabs */
.top-nav {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.tabs-container {
  display: flex;
  gap: 8px;
  height: 100%;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 15px;
  height: 100%;
  padding: 0 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: color var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-gold);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--accent-gold);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 -2px 10px rgba(251, 191, 36, 0.5);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-export {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
  transition: all var(--transition-normal);
}

.btn-export:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35);
}

.btn-clear {
  background: linear-gradient(135deg, var(--accent-red), #b91c1c);
  color: white;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
  transition: all var(--transition-normal);
}

.btn-clear:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.35);
}

/* Tabs Content Viewports */
.tab-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: none;
}

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

/* Tab 1: Storyboard Canvas Styles */
.storyboard-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100%;
}

.storyboard-header-preview {
  width: 100%;
  max-width: 1000px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.storyboard-meta-title h2 {
  font-size: 18px;
  color: var(--accent-gold);
}

.storyboard-meta-title p {
  font-size: 12px;
  color: var(--text-secondary);
}

.storyboard-grid-settings {
  display: flex;
  align-items: center;
  gap: 16px;
}

.grid-cols-select {
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* The actual visual storyboard representing the user's layout */
.storyboard-grid {
  width: 100%;
  max-width: 1000px;
  background-color: #000000; /* Pure black bg matching their export style */
  border: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 1px; /* To make thin white grid separators visible */
  display: grid;
  grid-gap: 1px; /* Thinner border lines */
  background-color: #ffffff; /* Separator lines are white! */
}

/* Columns classes */
.cols-1 { grid-template-columns: repeat(1, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Individual Scene Card */
.scene-card {
  background-color: #070707; /* Dark black base for each card */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.scene-card:hover .scene-card-actions {
  opacity: 1;
}

/* Image section */
.scene-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4; /* Vertical aspect ratio matching their storyboard */
  background-color: #121212;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.scene-card:hover .scene-image {
  transform: scale(1.03);
}

/* Label overlays on top of the image */
.scene-label-left {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--accent-gold);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scene-label-right {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

/* Action hover buttons */
.scene-card-actions {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: 10;
}

.action-btn {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 140px;
  justify-content: center;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background-color: var(--accent-gold);
  color: var(--bg-primary);
  border-color: var(--accent-gold);
  transform: scale(1.05);
}

.action-btn-danger:hover {
  background-color: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

/* Text footer section of the card */
.scene-text-footer {
  padding: 16px;
  background-color: #000000; /* Pure black footer background */
  border-top: 1px solid #1a1a1a;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.scene-footer-title {
  color: var(--accent-gold);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.scene-footer-desc {
  color: #c5c5c5;
  font-size: 11px;
  line-height: 1.4;
}

/* Image generation loader */
.image-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(11, 13, 25, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 5;
  padding: 20px;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(251, 191, 36, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-gold);
  animation: spin 1s linear infinite;
  box-shadow: var(--shadow-glow);
}

.loading-text {
  font-size: 12px;
  color: var(--accent-gold);
  font-weight: 500;
}

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

/* Drag & Drop Overlays */
.image-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 10px;
  padding: 20px;
  cursor: pointer;
  width: 100%;
  height: 100%;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.image-upload-placeholder:hover {
  border-color: var(--accent-gold);
  color: var(--text-primary);
  background-color: rgba(251, 191, 36, 0.02);
}

.image-upload-placeholder i {
  font-size: 28px;
}

.image-upload-placeholder span {
  font-size: 11px;
  font-weight: 500;
}

/* Tab 2: Seedance Prompts Hub Styles */
.prompts-hub-container {
  max-width: 1000px;
  margin: 0 auto;
}

.prompts-hub-header {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prompts-hub-info h2 {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.prompts-hub-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prompt-row {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-normal);
}

.prompt-row:hover {
  border-color: rgba(var(--accent-gold-rgb), 0.3);
}

.prompt-row-thumbnail {
  width: 120px;
  height: 160px;
  background-color: var(--bg-darker);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
}

.prompt-row-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prompt-row-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
}

.prompt-row-content {
  flex-grow: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.prompt-row-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.prompt-row-title-grp {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prompt-row-title-grp h3 {
  font-size: 15px;
  color: var(--accent-gold);
}

.prompt-row-time {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
}

.prompt-row-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  border-left: 2px solid var(--border-color);
  padding-left: 10px;
}

.prompt-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 16px;
}

.prompt-field-box {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  position: relative;
}

.prompt-field-title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.prompt-field-text {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
  padding-right: 32px;
}

.btn-copy-inline {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.btn-copy-inline:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--accent-gold);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-footer .btn {
  width: auto;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--accent-gold);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  z-index: 1000;
  transition: all var(--transition-normal);
}

.toast.active {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-left-color: var(--accent-green);
}

.toast.error {
  border-left-color: var(--accent-red);
}

.toast i {
  font-size: 18px;
}

.toast.success i { color: var(--accent-green); }
.toast.error i { color: var(--accent-red); }
.toast.info i { color: var(--accent-gold); }

/* Empty state screen when storyboard is empty */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  max-width: 500px;
  margin: 100px auto 0;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background-color: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Modal Styling */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(7, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
}
.modal-content {
  transform: translateY(-20px);
  transition: transform var(--transition-normal);
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.freebeat-key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}
.freebeat-key-item:last-child {
  border-bottom: none;
}
.freebeat-key-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}
.freebeat-key-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.freebeat-key-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.freebeat-key-active-badge {
  font-size: 9px;
  background-color: var(--accent-gold);
  color: var(--bg-primary);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
}
.freebeat-key-masked {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}
.freebeat-key-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.freebeat-key-balance-input {
  width: 75px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--accent-gold);
  padding: 4px 6px;
  font-size: 12px;
  text-align: right;
  font-weight: 600;
}
.freebeat-key-balance-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}
.btn-delete-key {
  background: none;
  border: none;
  color: var(--accent-red);
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}
.btn-delete-key:hover {
  opacity: 1;
}

/* ----------------------------------------------------
   Login Screen Overlay
   ---------------------------------------------------- */
#login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(19, 23, 45, 0.96), rgba(7, 8, 15, 0.99));
  backdrop-filter: blur(16px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-normal);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(19, 23, 45, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  text-align: center;
  backdrop-filter: blur(8px);
}
.login-logo {
  font-size: 48px;
  color: var(--accent-gold);
  margin-bottom: 16px;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}
.login-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
}
.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* ----------------------------------------------------
   Sidebar Tab Navigation Menu
   ---------------------------------------------------- */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}
.sidebar-nav-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}
.sidebar-nav-item.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--accent-gold);
  font-weight: 600;
}
.sidebar-nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* ----------------------------------------------------
   Tab Layout Display Control
   ---------------------------------------------------- */
.app-tab {
  display: none;
}
.app-tab.active {
  display: block;
}

/* ----------------------------------------------------
   Data Tables (Users and Keys Management)
   ---------------------------------------------------- */
.table-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.data-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background-color: rgba(251, 191, 36, 0.02);
  color: var(--text-primary);
}

/* ----------------------------------------------------
   Spacious History Layout Cards
   ---------------------------------------------------- */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 10px;
}
.history-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  border: 1px solid var(--border-color);
}
.history-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-md);
}
.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.history-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  font-family: 'Outfit', sans-serif;
}
.history-card-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.history-card-meta {
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.meta-tag {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11px;
}
.history-card-prompt {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
  background: var(--bg-darker);
  border-radius: var(--radius-sm);
  padding: 10px;
  max-height: 80px;
  overflow-y: auto;
  font-family: monospace;
}
.history-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* ----------------------------------------------------
   Responsive Mobile Layout Styles
   ---------------------------------------------------- */
@media (max-width: 992px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }
  .app-container {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: none;
  }
  .main-content {
    height: auto;
    overflow: visible;
  }
  .storyboard-wrapper {
    gap: 16px;
    padding: 0 8px;
  }
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
  }
  .nav-actions {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav-actions button {
    margin-right: 0 !important;
  }
  .history-grid {
    grid-template-columns: 1fr;
  }
  .data-table {
    display: block;
    overflow-x: auto;
  }
}

/* ----------------------------------------------------
   Individual Scene Cards (Per-Frame Storyboard)
   ---------------------------------------------------- */
.scene-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color var(--transition-normal);
  text-align: left;
}
.scene-card:hover {
  border-color: rgba(var(--accent-gold-rgb), 0.3);
}
.scene-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}
.scene-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-gold);
}
.scene-card-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}
@media (max-width: 768px) {
  .scene-card-body {
    grid-template-columns: 1fr;
  }
}
.scene-card-image-box {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.scene-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scene-card-image-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.scene-card-prompts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.scene-card-badge {
  background: rgba(var(--accent-gold-rgb), 0.1);
  color: var(--accent-gold);
  border: 1px solid rgba(var(--accent-gold-rgb), 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}



