/**
 * DAIS Pagemaker - Shared Styles
 * Common CSS for all pages (index, admin, docs)
 * Note: Edit-mode --fe-* variables are in edit.css
 */

/* =================================
   Theme Utility Classes (Dark Mode Default)
   These classes are used in HTML but need CSS definitions
   ================================= */

/* Background utilities */
.bg-theme-dark {
  background: #111827;
}

.bg-theme-panel {
  background: #1f2937;
}

/* Text utilities */
.text-theme {
  color: #ffffff;
}

.text-theme-muted {
  color: #9ca3af;
}

.text-theme-dim {
  color: #6b7280;
}

/* Border utilities */
.border-theme {
  border-color: #374151;
}

/* =================================
   Light Mode Theme Overrides
   ================================= */
body.light-mode .bg-theme-dark {
  background: #ffffff;
}

body.light-mode .bg-theme-panel {
  background: #f3f4f6;
}

body.light-mode .text-theme {
  color: #111827;
}

body.light-mode .text-theme-muted {
  color: #6b7280;
}

body.light-mode .text-theme-dim {
  color: #9ca3af;
}

body.light-mode .border-theme {
  border-color: #d1d5db;
}

/* Progress bar track - needs contrast with panel */
.bg-theme-track {
  background: #374151;
}

body.light-mode .bg-theme-track {
  background: #e5e7eb;
}

/* =================================
   Action Link Buttons
   Preserves text color in both themes (used for Edit/Download/Delete links)
   ================================= */
.action-link {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-weight: 500;
  padding: 0;
}

/* Auth tabs (Login/Register modal) - preserve theme colors */
.auth-tab {
  background: transparent;
}

/* =================================
   Custom Scrollbar (Dark Theme)
   ================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* =================================
   Button Design System
   ================================= */

/* Base button - compact, uniform width to fit longest label */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;

  gap: 0.375rem;
  height: 37px;
  width: 100px;

  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
  white-space: nowrap;
}


/* Button icon */
.btn-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Button label - can be hidden responsively */
.btn-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* Color variants */
.btn-primary {
  background: #A100FF;
  color: white;
}

.btn-primary:hover {
  background: #8a00d9;
}

.btn-secondary {
  background: #3b82f6;
  color: white;
}

.btn-secondary:hover {
  background: #2563eb;
}

.btn-success {
  background: #16a34a;
  color: white;
}

.btn-success:hover {
  background: #15803d;
}

.btn-neutral {
  background: #374151;
  color: white;
}

.btn-neutral:hover {
  background: #4b5563;
}

/* Disabled state */
.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* =================================
   Layout Containers
   ================================= */

/* Header actions - right aligned button group */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* Header buttons: icon-only on narrow screens */
@media (max-width: 900px) {
  .header-actions .btn-label {
    display: none;
  }

  .header-actions .btn {
    width: 37px;
    padding: 0.5rem;
  }
}


/* Button group with container query for responsive text */
.btn-group {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Container query: hide text when container is narrow */
@container (max-width: 100px) {
  .btn-label {
    display: none;
  }

  .btn {
    padding: 0.5rem;
  }
}


/* Form row - fixed element on right, fill on left */
.form-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.form-row-fill {
  flex: 1;
  display: flex;
  gap: 0.5rem;
}

.form-row-fixed {
  width: 140px;
  flex-shrink: 0;
}

/* Input group - textarea with adjacent button column */
.input-group {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.input-group-fill {
  flex: 1;
}

.input-group-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 140px;
  flex-shrink: 0;
}

/* Buttons in input-group-actions should stretch to fill height */
.input-group-actions .btn {
  flex: 1;
  width: 100%;
}

/* =================================
   Collapsible Section Styling
   ================================= */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  cursor: pointer;
  user-select: none;
}

.section-header .header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.collapse-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collapse-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.collapse-btn svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s;
}

.section-collapsed .collapse-btn svg {
  transform: rotate(-90deg);
}

.section-content {
  transition: all 0.3s ease;
  overflow: hidden;
}

.section-collapsed .section-content {
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0;
}

.section-collapsed {
  flex: 0 0 auto !important;
  min-height: auto !important;
}

/* =================================
   Resize Handles
   ================================= */
.resize-handle-horizontal {
  width: 4px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  flex-shrink: 0;
  z-index: 100;
  pointer-events: auto;
}

.resize-handle-horizontal::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 100px;
  background: #4b5563;
  border-radius: 2px;
  opacity: 1;
  transition: background 0.2s;
}

.resize-handle-horizontal:hover::after,
.resize-handle-horizontal.resizing::after {
  background: #9ca3af;
}

.resize-handle-vertical {
  height: 10px;
  cursor: row-resize;
  background: transparent;
  position: relative;
  flex-shrink: 0;
}

.resize-handle-vertical::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 5px;
  background: #4b5563;
  border-radius: 2px;
  opacity: 1;
  transition: background 0.2s;
}

.resize-handle-vertical:hover::after,
.resize-handle-vertical.resizing::after {
  background: #9ca3af;
}

/* Panel styling for resize */
.resizable-panel {
  overflow: hidden;
  min-width: 100px;
  min-height: 50px;
}

/* Prevent text selection during resize */
body.resizing {
  user-select: none;
  cursor: col-resize;
}

body.resizing-vertical {
  cursor: row-resize;
}

/* =================================
   Animations
   ================================= */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.recording-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.mic-processing {
  animation: spin 1s linear infinite;
}

/* =================================
   Token/Admin Specific
   ================================= */
.token-cell {
  font-family: monospace;
  font-size: 0.85rem;
}

/* =================================
   Theme Toggle Switch
   ================================= */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle-label {
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theme-switch {
  position: relative;
  width: 64px;
  height: 37px;
  background: #374151;
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.3s;
}

.theme-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 31px;
  height: 31px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-switch.light::after {
  transform: translateX(27px);
}

.theme-switch.light {
  background: #A100FF;
}

/* Sun/Moon icons in toggle */
.theme-switch .icon-sun,
.theme-switch .icon-moon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  transition: opacity 0.3s;
}

.theme-switch .icon-moon {
  left: 8px;
  opacity: 1;
}

.theme-switch .icon-sun {
  right: 8px;
  opacity: 0.4;
}

.theme-switch.light .icon-moon {
  opacity: 0.4;
}

.theme-switch.light .icon-sun {
  opacity: 1;
}

/* =================================
   Light Mode Overrides
   ================================= */
body.light-mode {
  background: #f3f4f6 !important;
  color: #1f2937 !important;
}

/* Default 75% zoom for all frontend pages */
html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  zoom: 0.75;
  /* Compensate: 100vh at 75% zoom = 133.33vh visual height needed */
  min-height: 133.33vh;
}

body.light-mode .bg-gray-900 {
  background: #ffffff !important;
}

body.light-mode .bg-gray-800 {
  background: #f9fafb !important;
}

body.light-mode .bg-accenture-black {
  background: #f3f4f6 !important;
}

body.light-mode .text-white:not(.btn):not(button):not(a) {
  color: #1f2937 !important;
}

body.light-mode .btn,
body.light-mode .btn *,
body.light-mode .bg-accenture-blue,
body.light-mode .bg-accenture-blue *,
body.light-mode .bg-accenture-green,
body.light-mode .bg-accenture-green *,
body.light-mode .bg-accenture-purple,
body.light-mode .bg-accenture-purple *,
body.light-mode .bg-blue-500,
body.light-mode .bg-blue-500 * {
  color: white !important;
}

body.light-mode .text-gray-200 {
  color: #374151 !important;
}

body.light-mode .text-gray-300 {
  color: #4b5563 !important;
}

body.light-mode .text-gray-400 {
  color: #6b7280 !important;
}

body.light-mode .text-gray-500 {
  color: #9ca3af !important;
}

body.light-mode .border-gray-700 {
  border-color: #e5e7eb !important;
}

body.light-mode .border-gray-600 {
  border-color: #d1d5db !important;
}

/* Additional background overrides from audit findings (docs.js, admin.js) */
body.light-mode .bg-gray-600 {
  background: #e5e7eb !important;
}

body.light-mode .bg-gray-700 {
  background: #f3f4f6 !important;
}

/* Hover states - used by docs.js row.className = 'hover:bg-gray-800' */
body.light-mode .hover\:bg-gray-800:hover {
  background: #f3f4f6 !important;
}

body.light-mode .hover\:bg-gray-700:hover {
  background: #e5e7eb !important;
}

/* Text color overrides for dynamically created content (admin.js, docs.js) */
body.light-mode .text-gray-600 {
  color: #4b5563 !important;
}

body.light-mode ::-webkit-scrollbar-track {
  background: #f3f4f6;
}

body.light-mode ::-webkit-scrollbar-thumb {
  background: #d1d5db;
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

body.light-mode .resize-handle-horizontal::after,
body.light-mode .resize-handle-vertical::after {
  background: #d1d5db;
}

body.light-mode .resize-handle-horizontal:hover::after,
body.light-mode .resize-handle-vertical:hover::after {
  background: #9ca3af;
}

body.light-mode #json-preview {
  background: #1f2937 !important;
}

/* =================================
   Content Area Isolation (Edit Page)
   Prevent light mode styles from affecting the presentation content
   ================================= */
body.light-mode .edit-content-wrapper,
body.light-mode .edit-content-wrapper * {
  /* Reset all inheritable light mode overrides */
  color: inherit;
  background: inherit;
}

/* Ensure presentation content uses its own theme from base.html */
.edit-content-wrapper {
  /* The content has its own theme toggle - don't inherit frontend styles */
  isolation: isolate;
}

/* =================================
   Mode Tabs (Input Mode Selector)
   ================================= */
.mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  border: 1px solid #4b5563;
  border-bottom: 2px solid #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: #1f2937;
  color: #9ca3af;
  border-radius: 0.375rem 0.375rem 0 0;
  margin-bottom: -1px;
}

.mode-tab:first-child {
  border-radius: 0.375rem 0 0 0;
}

.mode-tab:nth-child(2) {
  border-radius: 0;
}

.mode-tab:last-child {
  border-radius: 0 0.375rem 0 0;
}

.mode-tab:hover:not(:disabled) {
  background: #374151;
  color: white;
}

.mode-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mode-tab-active {
  background: #111827;
  border-color: #A100FF;
  border-bottom-color: #111827;
  color: white;
}

.mode-tab-active:hover {
  background: #111827;
}

/* Non-active tabs should also have purple bottom when adjacent to active */
#mode-tabs {
  border-bottom: 2px solid #A100FF;
}

/* Toggle buttons (PPTX/Images) */
.btn-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #4b5563;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: #374151;
  color: #9ca3af;
  min-width: 60px;
}

.btn-toggle:hover {
  background: #4b5563;
  color: white;
}

.btn-toggle-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

/* Action buttons (compact) */
.btn-action {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 52px;
}

.btn-blue {
  background: #3b82f6;
  color: white;
}

.btn-blue:hover {
  background: #2563eb;
}

.btn-purple {
  background: #A100FF;
  color: white;
}

.btn-purple:hover {
  background: #8a00d9;
}

/* Upload button (icon only) */
.btn-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #4b5563;
  background: #374151;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-upload:hover {
  background: #4b5563;
  color: white;
}

/* Mode panels */
.mode-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mode-panel.hidden {
  display: none;
}

/* Tab content container - surrounds all content below tabs */
.tab-content-container {
  background: #111827;
  border: 2px solid #A100FF;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 1rem;
}

/* File preview section above tabs */
.file-preview-section {
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.file-preview-section.hidden {
  display: none;
}

/* Dropzone for Import mode */
.dropzone {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  border: 2px dashed #4b5563;
  border-radius: 0.5rem;
  padding: 2rem;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
  background: #1f2937;
  /* Same as text input bg-gray-800 */
}

/* Compact dropzone for inline use */
.dropzone-sm {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  height: 37px;
  box-sizing: border-box;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #A100FF;
  background: rgba(161, 0, 255, 0.1);
  color: #A100FF;
}

/* File preview chips */
.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  background: #374151;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: #d1d5db;
}

.file-chip-remove {
  color: #ef4444;
  cursor: pointer;
  font-weight: bold;
}

.file-chip-remove:hover {
  color: #f87171;
}

.file-chip-chat {
  font-size: 0.75rem;
  padding: 2px 8px;
  opacity: 0.85;
  pointer-events: none;
}

/* =================================
   Transient Agent Messages
   (ChatGPT/Antigravity style)
   ================================= */
.transient-message {
  background: rgba(55, 65, 81, 0.5);
  position: relative;
  overflow: hidden;
  animation: opacityPulse 2s ease-in-out infinite;
}

.transient-message::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  animation: shimmerSweep 2s ease-in-out infinite;
  pointer-events: none;
}

.final-message {
  background: rgb(55, 65, 81);
  animation: fadeIn 0.4s ease-out forwards;
  opacity: 0;
}

/* Chat agent conversational messages (persistent, not transient) */
.chat-agent-message {
  background: rgba(55, 65, 81, 0.8);
  animation: fadeIn 0.3s ease-out forwards;
}

/* Expandable summary for completed phases */
.phase-summary {
  background: rgba(55, 65, 81, 0.3);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.phase-summary:hover {
  background: rgba(55, 65, 81, 0.5);
}

.phase-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #9ca3af;
  font-size: 0.75rem;
}

.phase-summary-content {
  display: none;
  padding-top: 0.5rem;
  color: #d1d5db;
  font-size: 0.875rem;
}

.phase-summary.expanded .phase-summary-content {
  display: block;
}

.phase-summary-toggle {
  transition: transform 0.2s;
}

.phase-summary.expanded .phase-summary-toggle {
  transform: rotate(180deg);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* Left-to-right shimmer sweep (overlay only, no element resize) */
@keyframes shimmerSweep {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* Opacity pulse for text/box fade effect */
@keyframes opacityPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* Simple fade in for final message */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Feedback mode header */
.feedback-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #374151;
  margin-bottom: 0.5rem;
}

/* Light mode overrides for new styles */
body.light-mode .mode-tab {
  background: #f3f4f6;
  border-color: #d1d5db;
  border-bottom-color: #d1d5db;
  color: #1f2937 !important;
}

body.light-mode .mode-tab:hover {
  background: #e5e7eb;
  color: #1f2937;
}

body.light-mode .mode-tab-active {
  background: #ffffff;
  border-color: #A100FF;
  border-bottom-color: #ffffff;
  color: #1f2937 !important;
}

body.light-mode #mode-tabs {
  border-bottom: 2px solid #A100FF;
}

body.light-mode .tab-content-container {
  background: #ffffff;
  border: 2px solid #A100FF;
  border-top: none;
}

body.light-mode .file-preview-section {
  background: #f3f4f6;
  border-color: #d1d5db;
}

body.light-mode .dropzone {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #6b7280;
}

body.light-mode .transient-message {
  background: rgba(229, 231, 235, 0.7);
}

body.light-mode .chat-agent-message {
  background: rgba(229, 231, 235, 0.9);
  border-left-color: #A100FF;
}

body.light-mode .final-message {
  background: rgb(229, 231, 235);
}

body.light-mode .phase-summary {
  background: rgba(229, 231, 235, 0.5);
}

/* =================================
   Placeholder Select Styling
   ================================= */
/* When placeholder is showing (empty value selected) */
.placeholder-select {
  color: #9ca3af;
}

/* When a real value is selected — green border + bg + white text */
.placeholder-select.has-value {
  color: white;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

/* Number input with value (slides) */
#input-slides.has-value {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

/* Textarea with content (chat input) */
#chat-input.has-value {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

/* Light mode */
body.light-mode .placeholder-select {
  color: #6b7280;
}

body.light-mode .placeholder-select.has-value {
  color: #1f2937;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

body.light-mode #input-slides.has-value {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

body.light-mode #chat-input.has-value {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

/* =================================
   Unified Dropzone (all file types)
   ================================= */
.dropzone-unified {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  border: 2px dashed #4b5563;
  border-radius: 0.5rem;
  padding: 1rem;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
  background: #1f2937;
}

.dropzone-unified:hover,
.dropzone-unified.dragover {
  border-color: #A100FF;
  background: rgba(161, 0, 255, 0.1);
  color: #A100FF;
}

.dropzone-unified.has-files {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

body.light-mode .dropzone-unified.has-files {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

body.light-mode .dropzone-unified {
  border-color: #d1d5db;
  background: #f9fafb;
  color: #6b7280;
}

body.light-mode .dropzone-unified:hover,
body.light-mode .dropzone-unified.dragover {
  border-color: #A100FF;
  background: rgba(161, 0, 255, 0.1);
  color: #A100FF;
}

/* =================================
   Examples Modal
   ================================= */
.example-category {
  margin-bottom: 1rem;
}

.example-category-title {
  font-size: 1rem;
  font-weight: 600;
  color: #a855f7;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Grid layout: all examples visible at a glance */
#examples-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.example-item {
  padding: 0.75rem;
  background: #374151;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
}

.example-item:hover {
  background: #4b5563;
  border-color: #A100FF;
}

.example-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.375rem;
}

.example-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.375rem;
  flex: 1;
}

.example-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.example-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem 0.375rem;
  background: rgba(161, 0, 255, 0.2);
  border-radius: 0.25rem;
  font-size: 0.7rem;
  color: #c4b5fd;
  white-space: nowrap;
}

.example-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.example-file {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem 0.375rem;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 0.25rem;
  font-size: 0.7rem;
  color: #93c5fd;
  white-space: nowrap;
}

.example-section {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.25rem;
}

.example-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.example-preview {
  font-size: 0.8rem;
  color: #d1d5db;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  transition: all 0.2s;
}

.example-item.expanded .example-preview {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  display: block;
  white-space: pre-wrap;
}

.example-expand-hint {
  font-size: 0.6rem;
  color: #6b7280;
  margin-top: 0.25rem;
  font-style: italic;
  text-transform: uppercase;
}

.example-prompt-box {
  flex: 1;
  background: rgba(34, 84, 61, 0.5);
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  border: 1px solid rgba(52, 211, 153, 0.3);
  transition: border-color 0.2s;
}

.example-prompt-box:hover {
  border-color: #34d399;
}

.example-use-hint {
  font-size: 0.6rem;
  color: #6b7280;
  margin-top: 0.5rem;
  text-align: center;
  font-style: italic;
  text-transform: uppercase;
}

body.light-mode .example-item {
  background: #f3f4f6;
}

body.light-mode .example-item:hover {
  background: #e5e7eb;
}

body.light-mode .example-title {
  color: #1f2937;
}

body.light-mode .example-badge {
  background: rgba(161, 0, 255, 0.1);
  color: #7c3aed;
}

body.light-mode .example-file {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

body.light-mode .example-preview {
  color: #4b5563;
}

/* =================================
   Deep Research Dropdown
   ================================= */
.deep-research-select {
  width: 200px;
  min-width: 160px;
  flex-shrink: 0;
}

.deep-research-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =================================
   Input Container Box
   ================================= */
.input-container-box {
  background: #111827;
  border: 2px solid #A100FF;
  border-radius: 0.5rem;
  padding: 1rem;
}

body.light-mode .input-container-box {
  background: #ffffff;
  border-color: #A100FF;
}

/* Compact dropzone - matches height of select/input row */
.dropzone-compact {
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Slides input - flexible width with min/max */
.input-slides-width {
  width: 140px;
  min-width: 60px;
  max-width: 144px;
  flex-shrink: 1;
}

/* =================================
   Footer Hyperlink (Dark Mode Fix)
   ================================= */
footer a.text-accenture-purple {
  color: #c084fc !important;
  /* Lighter purple for dark mode visibility */
}

footer a.text-accenture-purple:hover {
  color: #e9d5ff !important;
}

/* =================================
   Examples Modal Z-Index
   ================================= */
#examples-modal,
#confirmation-modal {
  z-index: 200 !important;
  /* Above resize handle (z-100) */
}

/* =================================
   Resizable Input Row
   ================================= */
.input-row-resizable {
  min-height: 37px;
}

.input-row-resizable select,
.input-row-resizable input[type="number"] {
  min-width: 80px;
  flex-shrink: 1;
}

/* Preview buttons flex */
.preview-buttons-row {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preview-buttons-row a,
.preview-buttons-row button {
  flex: 1 1 auto;
  min-width: 100px;
}

/* =================================
   Preview Tabs (Editable/Preview)
   ================================= */
.preview-tabs {
  display: flex;
  gap: 0;
  align-items: flex-end;
}




.preview-tab {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;

  width: 230px;



  border: 1px solid #4b5563;
  border-radius: 0.375rem;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.preview-tab:first-child {
  border-radius: 0.375rem 0 0 0;
}

.preview-tab:last-child {
  border-radius: 0 0.375rem 0 0;
}

.preview-tab:hover {
  background: #374151;
  color: white;
}

.preview-tab.active {
  background: #111827;
  color: white;
  border: 2px solid #A100FF;
  border-bottom: 2px solid #111827;
}


.preview-panel {
  display: none;
}

.preview-panel.active {
  display: block;
}

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

/* Content container embedded under tabs */
.preview-content-container {
  background: #111827;
  border: 2px solid #A100FF;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 0.5rem;
}

/* Light mode overrides for preview tabs */
body.light-mode .preview-tabs {
  border-bottom-color: #A100FF;
}

body.light-mode .preview-tab {
  background: #f9fafb;
  color: #6b7280;
  border-color: #e5e7eb;
}

body.light-mode .preview-tab:hover {
  background: #f3f4f6;
  color: #374151;
}

body.light-mode .preview-tab.active {
  background: #ffffff;
  color: #1f2937;
  border-color: #A100FF;
  border-bottom-color: #ffffff;
}

body.light-mode .preview-content-container {
  background: #ffffff;
  border-color: #A100FF;
}

body.light-mode #html-preview-frame {
  background: #f9fafb;
}

/* =================================
   Driver.js Onboarding Tour Overrides
   ================================= */
.driver-popover {
  background: #1f2937 !important;
  color: #ffffff !important;
  border: 1px solid #374151 !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
  max-width: 560px !important;
  min-width: 500px !important;
  padding: 1.25rem !important;
}

.driver-popover .driver-popover-title {
  color: #A100FF !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
}

.driver-popover .driver-popover-description {
  color: #d1d5db !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
}

/* Footer layout: [Don't show again]  ...  [1 of 8] [Back] [Next] */
.driver-popover-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
  margin-top: 0.75rem !important;
}

.driver-popover .driver-popover-progress-text {
  color: #ffffff !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
}

.driver-popover .driver-popover-navigation-btns {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-left: auto !important;
}

/* Checkbox label injected into footer - stays far left */
.driver-popover-footer .onboarding-dismiss {
  order: -1 !important;
  flex-shrink: 0 !important;
}

.driver-popover .driver-popover-navigation-btns button {
  border-radius: 0.375rem !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  padding: 0.4rem 0.85rem !important;
  transition: all 0.2s !important;
}

.driver-popover .driver-popover-next-btn {
  background: #A100FF !important;
  color: white !important;
  border: none !important;
  text-shadow: none !important;
}

.driver-popover .driver-popover-next-btn:hover {
  background: #8a00d9 !important;
}

.driver-popover .driver-popover-prev-btn {
  background: #374151 !important;
  color: #d1d5db !important;
  border: 1px solid #4b5563 !important;
  text-shadow: none !important;
}

.driver-popover .driver-popover-prev-btn:hover {
  background: #4b5563 !important;
  color: white !important;
}

.driver-popover .driver-popover-close-btn {
  color: #6b7280 !important;
}

.driver-popover .driver-popover-close-btn:hover {
  color: #ffffff !important;
}

.driver-popover .driver-popover-arrow-side-left.driver-popover-arrow,
.driver-popover .driver-popover-arrow-side-right.driver-popover-arrow,
.driver-popover .driver-popover-arrow-side-top.driver-popover-arrow,
.driver-popover .driver-popover-arrow-side-bottom.driver-popover-arrow {
  border-color: #1f2937 !important;
}

/* Light mode overrides for tour */
body.light-mode .driver-popover {
  background: #ffffff !important;
  color: #1f2937 !important;
  border: 1px solid #d1d5db !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

body.light-mode .driver-popover .driver-popover-description {
  color: #4b5563 !important;
}

body.light-mode .driver-popover .driver-popover-progress-text {
  color: #9ca3af !important;
}

body.light-mode .driver-popover .driver-popover-prev-btn {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border: 1px solid #d1d5db !important;
}

body.light-mode .driver-popover .driver-popover-prev-btn:hover {
  background: #e5e7eb !important;
  color: #1f2937 !important;
}

body.light-mode .driver-popover .driver-popover-close-btn {
  color: #9ca3af !important;
}

body.light-mode .driver-popover .driver-popover-close-btn:hover {
  color: #1f2937 !important;
}

body.light-mode .driver-popover .driver-popover-arrow-side-left.driver-popover-arrow,
body.light-mode .driver-popover .driver-popover-arrow-side-right.driver-popover-arrow,
body.light-mode .driver-popover .driver-popover-arrow-side-top.driver-popover-arrow,
body.light-mode .driver-popover .driver-popover-arrow-side-bottom.driver-popover-arrow {
  border-color: #ffffff !important;
}