/* Variables */
:root {
  --font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --primary: #f61f77;
  --secondary-blue: #0d92d0;
  --secondary-yellow: #fae112;
  --bg-json: #d1c8c5;
  --input-height: 3.5rem;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-xxl: 4rem;
  --error: #f7931e;
  --success: #22c55e;
  --text: #333333;
  --text-light: #666666;
}

/* Base styles */
* { 
  box-sizing: border-box;
}

html {
  font-family: var(--font-family);
}

body {
  font-family: var(--font-family) !important;
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 2rem;
  background: white;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02", "cv01", "cv02";
}

/* Layout */
.container {
  background: white;
  padding: 3rem;
  border: 4px solid black;
  position: relative;
}

.container::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 100%;
  height: 100%;
  background: var(--bg-json);
  z-index: -1;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  position: relative;
}

.header::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: black;
  z-index: 2;
}

.header img {
  width: 50px;
  height: 50px;
}

.header h1 {
  margin: 0;
  font-weight: 600;
  font-size: 2rem;
  color: black;
}

/* Action Tabs */
.action-tab-wrapper.hidden {
  display: none;
}

.action-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.action-tab-wrapper {
  flex: 1;
  position: relative;
}

.action-tab-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-json);
  z-index: 1;
  display: none;
}

.action-tab-wrapper:not(:has(.active))::after {
  display: block;
}

.action-tab {
  padding: 1.5rem;
  background: white;
  border: 3px solid black;
  font-weight: 500;
  font-size: 1.1rem;
  font-family: var(--font-family);
  cursor: pointer;
  position: relative;
  z-index: 2;
  transform: translate(-4px, -4px);
  transition: transform 0.2s;
  text-align: center;
  width: 100%;
}

.action-tab:hover {
  transform: translate(0, 0);
}

.action-tab.active {
  background: var(--secondary-blue);
  color: white;
  border: none;
  transform: translate(0, 0);
  box-shadow: none;
}

/* Add new rule to ensure active tab wrapper doesn't show overlay */
.action-tab-wrapper:has(.active)::after {
  display: none !important;
}

/* Form Elements */
/* .form-section {
  margin-top: var(--spacing-xl);
} */

.form-group {
  margin-bottom: 1rem;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: #374151;
}

/* Input and Textarea Styling */
input[type="url"],
select,
textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid black;
  font-size: 1.1rem;
  background: white;
  border-radius: 0;
  font-family: var(--font-family) !important;
  line-height: 1.5;
  resize: vertical;
  overflow-y: auto;
}

/* Modern inputs for studio pages */
body.studio-layout input[type="url"],
body.studio-layout input[type="text"],
body.studio-layout select,
body.studio-layout textarea {
  border: 1.5px solid #d1d5db !important;
  font-size: 0.9375rem !important;
  border-radius: 6px !important;
  padding: 0.625rem 0.75rem !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

body.studio-layout input[type="url"]:focus,
body.studio-layout input[type="text"]:focus,
body.studio-layout select:focus,
body.studio-layout textarea:focus {
  outline: none !important;
  border-color: var(--secondary-blue) !important;
  box-shadow: 0 0 0 3px rgba(13, 146, 208, 0.1) !important;
}

/* Single line textarea */
textarea.single-line {
  height: 16px !important;
  padding-top: 0.9rem;
  white-space: nowrap;
  overflow-x: auto;
}

/* Multi line textarea */
textarea.multi-line {
  min-height: calc(var(--input-height) * 3);
  padding: var(--spacing-md);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Focus states */
input[type="url"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 3px rgba(13, 146, 208, 0.1);
  transition: all 0.2s ease;
}

/* Template Name Container */
.template-name-container {
  display: flex;
  gap: var(--spacing-sm);
  align-items: flex-start;
}

.template-name-container input {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.template-name-container .secondary-button {
  flex-shrink: 0;
  white-space: nowrap;
  background: var(--secondary-yellow);
  color: black;
}

/* Checkbox styling */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  display: none;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

/* Button styling */
.button-wrapper {
  position: relative;
  margin-top: var(--spacing-xl);
}

.button-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-json);
  z-index: 1;
}

.action-button {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  position: relative;
  z-index: 2;
  border-radius: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(246, 31, 119, 0.2);
}

.action-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(246, 31, 119, 0.3);
}

.action-button:active:not(:disabled) {
  transform: translateY(0);
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* Editor styles */
.editor-section {
  margin-bottom: var(--spacing-xl);
}

.editor-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
  color: #333;
}

.editor-field {
  margin-bottom: var(--spacing-lg);
}

.editor-field label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: #555;
}

/* Input and Textarea Styling */
textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid #ddd;
  font-size: 1.1rem;
  background: white;
  border-radius: 4px;
  font-family: var(--font-family) !important;
  line-height: 1.5;
  resize: vertical;
  overflow-y: auto;
  transition: all 0.2s ease;
}

textarea:hover {
  border-color: #bbb;
}

textarea:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 2px rgba(13, 146, 208, 0.1);
}

/* Single line textarea */
textarea.single-line {
  height: var(--input-height);
  min-height: var(--input-height);
  padding: 0.75rem var(--spacing-sm);
  white-space: nowrap;
  overflow-x: auto;
}

/* Multi line textarea */
textarea.multi-line {
  min-height: calc(var(--input-height) * 3);
  padding: var(--spacing-sm);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Info section styling */
.info-section,
.section-content,
.editor-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-xs);
}

.info-section label,
.section-content label {
  font-weight: 600;
  font-size: 1rem;
  color: #333;
}

.info-section textarea,
.section-content textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) var(--spacing-sm);
  border: 1px solid #ddd;
  font-size: 1.1rem;
  border-radius: 4px;
  line-height: 1.5;
  min-height: var(--input-height);
}

/* Textarea states */
textarea {
  border: 1px solid #ddd;
  transition: border 0.2s ease;
}

textarea.warning {
  border: 2px solid #cc5500 !important;
}

/* Character counter */
.char-count {
  position: absolute;
  right: 0;
  font-size: 0.85rem;
  color: #666;
  background: white;
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 2;
  white-space: nowrap;
}

.char-count.visible {
  opacity: 1;
  visibility: visible;
}

.char-count span {
  color: #666;
  transition: color 0.2s ease;
}

.char-count span.warning {
  color: #cc5500;
  font-weight: 500;
}

/* Warning message */
.warning-message {
  display: none;
  color: var(--error);
  font-size: 0.9rem;
  margin-top: var(--spacing-sm);
  margin-bottom: 0;
  padding: var(--spacing-xs) var(--spacing-sm);
  width: 100%;
  clear: both;
  flex-basis: 100%;
  order: 999;
}

.warning-message.visible {
  display: block !important;
  flex-basis: 100% !important;
  width: 100% !important;
}

.warning-message::before {
  content: '⚠️';
  margin-right: var(--spacing-xs);
}

/* Remove duplicate styles */
.info-title,
.info-icon {
  display: none;
}

/* Help text */
.help-text {
  font-size: 0.85rem;
  color: #666;
  margin-top: var(--spacing-xs);
}

/* Clean up duplicate textarea styles */
textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid #ddd;
  font-size: 1.1rem;
  border-radius: 4px;
  font-family: var(--font-family) !important;
  line-height: 1.5;
  resize: vertical;
  overflow-y: auto;
  transition: all 0.2s ease;
  min-height: var(--input-height);
}

textarea:hover {
  border-color: #bbb;
}

textarea:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 2px rgba(13, 146, 208, 0.1);
}

/* Remove all the duplicate height settings */
textarea.single-line,
textarea.multi-line {
  height: auto;
}

/* Videos table styling */
.videos-table .actions {
  display: flex;
  gap: var(--spacing-xs);
}

/* Credits and version styling */
.credits-charged {
  color: #111; /* neutral */
  font-weight: 600;
}

.credits-free {
  color: #111; /* neutral */
  font-weight: 500;
}

.cell-version {
  text-align: center;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-weight: 600;
  font-size: 0.9rem;
}

.cell-credits {
  text-align: center;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid #000;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  margin-left: 6px;
  background: #fff;
  cursor: help;
}

/* Credits explainer modal uses the same base modal styles as other modals via inline container */

.videos-table .btn {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 2px solid black;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  color: black;
}

.videos-table .btn.preview {
  background: var(--secondary-yellow);
}

.videos-table .btn.download {
  background: var(--secondary-blue);
  color: white;
}

.videos-table .btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 black;
}

.videos-table .error {
  color: var(--error);
  font-weight: 500;
}

.videos-table .no-videos {
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Transitions */
.editor-section,
.content-section,
textarea,
.action-tab,
.action-button,
.videos-table .btn {
  transition: all 0.2s ease;
}

/* Template Section */
.template-section {
  background: white;
  padding: 2rem;
  border: 3px solid black;
  position: relative;
  margin: 2rem 0;
}

.template-section::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 100%;
  height: 100%;
  background: var(--bg-json);
  z-index: -1;
}

.template-section h3 {
  margin: 0 0 1rem 0;
  font-weight: 600;
  font-size: 1.25rem;
}

/* Results Section */
.results-section {
  margin-top: 3rem;
}

.result-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-wrapper {
  position: relative;
}

.tab-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-json);
  z-index: 1;
}

.result-tab {
  padding: 1rem 2rem;
  background: white;
  border: 2px solid var(--secondary-blue);
  color: var(--secondary-blue);
  font-family: 'Space Grotesk', system-ui;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transform: translate(-4px, -4px);
  transition: transform 0.2s;
}

.result-tab:hover {
  transform: translate(0, 0);
}

.result-tab.active {
  background: var(--secondary-blue);
  color: white;
  border: none;
  transform: translate(0, 0);
}

.result-content {
  display: none;
  padding: 2rem;
  border: 3px solid black;
  position: relative;
  background: var(--bg-json);
}

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

.copy-button {
  position: absolute;
  top: -12px;
  right: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--secondary-yellow);
  border: none;
  font-family: 'Space Grotesk', system-ui;
  font-weight: 500;
  cursor: pointer;
  transform: translate(-4px, -4px);
  transition: transform 0.2s;
  z-index: 2;
}

.copy-button:hover {
  transform: translate(0, 0);
}

.copy-button.copied {
  background: var(--secondary-blue);
  color: white;
}

/* Loading State */
.loading-state {
  text-align: center;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-text {
  display: none;
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 2rem;
}

/* Loading Dots (for job upload) */
.loading-dots[data-action="upload-job,full-flow"] {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 20px;
  width: 100%;
  position: relative;
  margin: 0 auto;
}

.loading-dots[data-action="upload-job,full-flow"] .loading-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  position: absolute;
  animation: dot-bounce 1.5s infinite ease-in-out;
}

.loading-dots[data-action="upload-job,full-flow"] .loading-dot:nth-child(1) {
  background: var(--primary);
  box-shadow: 0 0 15px rgba(246, 31, 119, 0.4);
  left: calc(50% - 50px);
}

.loading-dots[data-action="upload-job,full-flow"] .loading-dot:nth-child(2) {
  background: var(--secondary-blue);
  box-shadow: 0 0 15px rgba(13, 146, 208, 0.4);
  left: calc(50% - 16px);
}

.loading-dots[data-action="upload-job,full-flow"] .loading-dot:nth-child(3) {
  background: var(--secondary-yellow);
  box-shadow: 0 0 15px rgba(250, 225, 18, 0.4);
  left: calc(50% + 18px);
}

@keyframes dot-bounce {
  0%, 100% {
    transform: translateX(-15px);
  }
  50% {
    transform: translateX(15px);
  }
}

/* Video Preview */
.video-container {
  display: none;
  background: white;
  padding: 2rem;
  border: 3px solid black;
  position: relative;
  margin-top: 2rem;
}

.video-container::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 100%;
  height: 100%;
  background: var(--bg-json);
  z-index: -1;
}

.video-container h3 {
  margin: 0 0 1.5rem 0;
  font-weight: 600;
  font-size: 1.5rem;
}

.video-preview-wrapper {
  position: relative;
  width: 100%;
  margin: 0;
}

.video-preview-wrapper:has(.video-alignment-overlay.active) {
  margin-bottom: 80px; /* Extra space for alignment slider when active */
}

.image-preview-wrapper:has(.image-alignment-overlay.active) {
  margin-bottom: 80px; /* Extra space for alignment slider when active */
}

.video-preview {
  width: auto;
  border: 2px solid black;
  display: block;
  max-height: 80vh;
  object-fit: contain;
}

/* Make vertical videos not too tall but still visible */
.video-preview[data-format="vertical"] {
  margin: 0;
}

.video-preview[data-format="semi_vertical"] {
  margin: 0;
}

.video-preview[data-format="square"] {
  margin: 0;
}

/* Horizontal videos use full width */
.video-preview[data-format="horizontal"] {
  max-width: 100%;
}

.video-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.video-download,
.video-edit,
.video-url {
  padding: 0.75rem 1.5rem;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3.25rem;
  border: 2px solid black;
  font-family: 'Space Grotesk', system-ui;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  color: black;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
  gap: 0.75rem;
}

.video-download {
  background: var(--secondary-yellow);
}

.video-edit {
  background: var(--secondary-blue);
  color: white;
}

.video-url {
  background: white;
  padding: 0.75rem;
  width: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.video-url svg {
  stroke: black;
  stroke-width: 2.5;
  width: 1.5rem;
  height: 1.5rem;
}

.video-download:hover,
.video-edit:hover,
.video-url:hover {
  transform: translate(0, 0);
}

.video-info {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: #666;
}

[data-required-for] {
  display: none;
}

[data-required-for].visible {
  display: block;
}

/* Form fields */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 3rem;
}

select:focus {
  border-color: var(--secondary-blue);
}

/* Override system highlight color for dropdowns */
select option:checked,
select option:hover,
select option:focus {
  background: var(--secondary-blue) linear-gradient(0deg, var(--secondary-blue) 0%, var(--secondary-blue) 100%);
  color: white;
}

select::-ms-expand {
  display: none;
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {
  select {
    -webkit-appearance: none;
  }
}

.field {
  display: none;
  margin-bottom: 1rem;
}
.field.visible {
  display: block;
}
.field[data-show-for-lambda] {
  display: none;
}
.field[data-show-for-lambda].show {
  display: block;
}

/* Videos Table */
.videos-list {
  background: white;
  padding: 2rem;
  border: 3px solid black;
  position: relative;
  margin-top: 2rem;
}

.videos-list::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 100%;
  height: 100%;
  background: var(--bg-json);
  z-index: -1;
}

.videos-list h3 {
  margin: 0 0 1.5rem 0;
  font-weight: 600;
  font-size: 1.5rem;
}

.videos-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
}

.videos-table th,
.videos-table td {
  padding: 0.75rem;
  border-bottom: 2px solid #000;
  vertical-align: middle;
  height: 60px; /* Fixed height for all cells */
  line-height: 1.2;
}

.videos-table th {
  background: var(--secondary-yellow);
  color: black;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: 3.5rem; /* Slightly shorter height for header */
}

.videos-table tr:hover td {
  background: rgba(250, 225, 18, 0.1);
}

.videos-table .badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border: 2px solid black;
  font-weight: 500;
  font-size: 0.8rem;
  white-space: nowrap;
}

.videos-table .badge.vertical,
.videos-table .badge.horizontal {
  background: #333;
  color: white;
}

.videos-table .cell-text {
  font-size: 0.9rem;
  color: #333;
}

.videos-table .role-title {
  font-weight: 500;
  color: var(--primary);
  font-size: 0.9rem;
  text-decoration: none;
  display: block;
}

.videos-table .role-title:hover {
  text-decoration: underline;
}

.videos-table .actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  min-width: 5rem; /* Ensure minimum width for actions column */
}

.videos-table .btn {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: 2px solid black;
  background: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.videos-table .btn.preview {
  background: var(--secondary-yellow);
}

.videos-table .btn.download {
  background: var(--secondary-blue);
  color: white;
}

.videos-table .btn.url {
  background: white;
}

.videos-table .btn.trash {
  background: #e74c3c;
}

.videos-table .btn.trash svg {
  stroke: white;
  fill: none;
  width: 1.25rem;
  height: 1.25rem;
}

.videos-table .btn.url svg {
  stroke: var(--text);
}

.videos-table .btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 black;
}

/* Template Editor */
.template-editor {
  margin-bottom: var(--spacing-lg);
  background: transparent;
  padding: 0;
  border: none;
  position: relative;
}

.editor-field {
  margin-bottom: 0.5rem;
}

.editor-field:last-child {
  margin-bottom: 0;
}

.editor-field label {
  display: block;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  font-weight: 500;
}

.editor-field label .required {
  color: var(--secondary-red);
}

.editor-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid black;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  overflow-y: auto;
}

.editor-field textarea:focus {
  outline: none;
  border-color: var(--secondary-blue);
}

.editor-field .help-text {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666;
}


/* Save Changes Button - In render bar, matches duplicate button style but yellow */
.save-changes {
  padding: 0.5rem 0.75rem;
  background: var(--secondary-yellow);
  border: 1.5px solid var(--secondary-yellow);
  border-radius: 6px;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: black;
  white-space: nowrap;
  flex-shrink: 0;
}

.save-changes:hover:not(:disabled) {
  background: #e6b800;
  border-color: #e6b800;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.save-changes:disabled {
  background: #f5f5f5;
  border-color: #d1d5db;
  color: #9ca3af;
  cursor: default;
}

/* Save Branding Changes Button - Same styling as save-changes but separate class */
.save-branding-changes {
  padding: 0.75rem 1.5rem;
  background: var(--secondary-yellow);
  border: 2px solid black;
  font-family: 'Space Grotesk', system-ui;
  font-weight: 500;
  cursor: pointer;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
}

.save-branding-changes:hover:not(:disabled) {
  transform: translate(0, 0);
}

.save-branding-changes:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Delete Button - Reusable */
.delete-button {
  padding: 0.45rem 1rem;
  background: #e74c3c;
  color: white;
  border: 2px solid black;
  font-family: 'Space Grotesk', system-ui;
  font-weight: 500;
  cursor: pointer;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
}

.delete-button:hover:not(:disabled) {
  transform: translate(0, 0);
}

.delete-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.success-message {
  padding: 0.5rem 1rem;
  background: #e6ffe6;
  border: 2px solid #00b300;
  color: #006600;
  font-size: 0.9rem;
  margin-right: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Template Editor States */
.template-editor.locked {
  background: transparent;
  margin-bottom: 2rem;
  padding: 0;
  border: none;
}

.template-editor.locked .editor-fields {
  pointer-events: none;
  opacity: 0.7;
  padding: 2rem;
}

.template-editor.collapsed .editor-fields {
  display: none;
}

.template-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 2rem;
  cursor: pointer;
  border-bottom: 2px solid black;
  background: white;
}

.template-summary .checkmark {
  width: 24px;
  height: 24px;
  background-color: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.template-summary .title {
  flex: 1;
  font-weight: 500;
}

.template-summary .expand-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.2s;
}

.template-editor.collapsed .expand-icon {
  transform: rotate(180deg);
}

/* Hide elements during render */
.rendering .template-select-group,
.rendering #render-btn,
.rendering .form-group,
.rendering .editor-actions,
.rendering .template-editor > h3,
.rendering .render-type-pills,
.rendering .editor-tabs-container,
.rendering .editor-tab-content {
  display: none !important;
}

/* Keep template summary visible during rendering */
.rendering .template-editor {
  margin-bottom: 2rem;
}

.rendering .template-summary {
  display: flex;
}

.rendering-message {
  padding: 1.5rem 2rem;
  border-bottom: 2px solid black;
}

.rendering-message p {
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

.rendering-message p:last-of-type {
  margin-bottom: 0;
}

/* Video container spacing */
.video-container {
  margin-top: 2rem;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  max-width: 300px;
  margin: 20px auto;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  height: 8px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  font-size: 24px;
  font-weight: 600;
  color: #333;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

/* Loading Animation */
.loading-animation {
  display: none;
  margin: 2rem auto;
}

.orbit-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-text {
  position: absolute;
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
  z-index: 2;
}

.orbit {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  animation: orbit-rotation 3s linear infinite;
}

.dot {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--dot-color);
  transform-origin: 80px 80px;
  transform: rotate(var(--rotation)) translateX(80px);
}

/* Individual dot animations with different delays and durations */
.dot:nth-child(1) {
  animation: dotPulse 3s ease-in-out infinite;
}

.dot:nth-child(2) {
  animation: dotPulse 3s ease-in-out infinite 1s;
}

.dot:nth-child(3) {
  animation: dotPulse 3s ease-in-out infinite 2s;
}

@keyframes dotPulse {
  0%, 100% {
    transform: rotate(var(--rotation)) translateX(80px) scale(1);
  }
  50% {
    transform: rotate(var(--rotation)) translateX(80px) scale(1.3);
  }
}

@keyframes orbit-rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes dot-zoom-to-center {
  0% {
    transform: rotate(var(--rotation)) translateX(80px) scale(1);
  }
  100% {
    transform: rotate(var(--rotation)) translateX(0) scale(0);
    opacity: 0;
  }
}

/* Upload Success Message */
.upload-success {
  display: none;
  background: white;
  padding: 2rem;
  border: 4px solid black;
  margin-top: 2rem;
  position: relative;
}

.upload-success::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 100%;
  height: 100%;
  background: var(--bg-json);
  z-index: -1;
}

.upload-success h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
}

.upload-success h3 .checkmark {
  width: 28px;
  height: 28px;
  background-color: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.upload-success p {
  margin: 0 0 1.5rem 0;
  font-size: 1.1rem;
  color: #666;
}

.upload-success .success-actions {
  display: flex;
  gap: 1rem;
}

.upload-success .primary-cta {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: 2px solid black;
  font-family: 'Space Grotesk', system-ui;
  font-weight: 500;
  cursor: pointer;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
}

.upload-success .secondary-cta {
  padding: 0.75rem 1.5rem;
  background: white;
  border: 2px solid black;
  font-family: 'Space Grotesk', system-ui;
  font-weight: 500;
  cursor: pointer;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
}

.upload-success .primary-cta:hover,
.upload-success .secondary-cta:hover {
  transform: translate(0, 0);
}

/* Update job URL link style */
.upload-success .job-url {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 2px solid var(--primary);
  font-weight: 500;
}

.upload-success .job-url:hover {
  color: var(--secondary-blue);
  border-color: var(--secondary-blue);
}

.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.video-modal.show {
  opacity: 1;
}

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

.modal-content {
  position: relative;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  z-index: 1;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.2s ease-out;
}

.video-modal.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  margin: -0.5rem;
  color: #666;
}

.modal-close:hover {
  color: black;
}

.modal-body {
  gap: 1rem;
  align-items: center;
}

.modal-body .video-preview-wrapper {
  max-height: 70vh;
  overflow: hidden;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.video-modal.show .video-preview-wrapper {
  opacity: 1;
}

.modal-body .video-preview {
  width: 100%;
  height: auto;
  display: block;
}

.modal-body .video-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Format-specific video sizes in modal */
.modal-body .video-preview[data-format="vertical"] {
  max-height: 50vh;
  width: auto;
  margin: 0 auto;
}

.modal-body .video-preview[data-format="semi_vertical"] {
  max-height: 50vh;
  width: auto;
  margin: 0 auto;
}

.modal-body .video-preview[data-format="square"] {
  max-height: 50vh;
  width: auto;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

.modal-body .video-preview[data-format="horizontal"] {
  max-height: 50vh;
  width: 100%;
  max-width: min(80vw, calc(50vh * 16/9));
  margin: 0 auto;
}

/* Now, only apply the error styling inside the .template-editor */
.template-editor input:invalid,
.template-editor textarea:invalid,
.template-editor select:invalid,
.template-editor textarea.warning {
  border: 2px solid var(--error) !important;
}

.login-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  color: #666;
  /* Removed fixed positioning for dashboard layout */
}

.login-info span {
  opacity: 0.7;
}

.login-info .separator {
  opacity: 0.5;
}

.logout-button {
  background: none;
  border: none;
  color: #666;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  opacity: 0.7;
}

.logout-button:hover {
  opacity: 1;
}

.upload-success.floating {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: white;
  border: 2px solid var(--success);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s, transform 0.3s;
}

.upload-success.floating.show {
  opacity: 1;
  transform: translateY(0);
}

.upload-success.floating.fade-out {
  opacity: 0;
  transform: translateY(-20px);
}

.upload-success.floating .success-content {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-success.floating .checkmark {
  background: var(--success);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.upload-success.floating .message {
  color: var(--text);
  font-size: 14px;
}

.upload-success.floating .close-button {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
}

.upload-success.floating .close-button:hover {
  color: var(--text);
}

/* Input Type Toggle */
.input-type-toggle {
  display: flex;
  gap: 1rem;
  margin-bottom: var(--spacing-md);
}

.input-type-toggle button {
  flex: 1;
  padding: 1rem;
  background: white;
  border: 2px solid black;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  transform: translate(-2px, -2px);
  transition: all 0.2s ease;
}

.input-type-toggle button:hover {
  transform: translate(0, 0);
}

.input-type-toggle button.active {
  background: var(--secondary-blue);
  color: white;
  border: none;
  transform: translate(0, 0);
}

/* Text Input Styling */
.text-input,
.url-input {
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.text-input.fade-out,
.url-input.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.text-input.fade-in,
.url-input.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.text-input textarea {
  width: 100%;
  min-height: 100px;
  max-height: 100px; /* Add max height to enable scrolling */
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid black;
  font-size: 1.1rem;
  font-family: var(--font-family);
  line-height: 1.5;
  resize: vertical;
  transition: min-height 0.2s ease-out;
  overflow-y: auto; /* Enable vertical scrolling */
}

.text-input textarea.url-mode {
  min-height: 60px;
  resize: none;
}

.text-input textarea:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 3px rgba(13, 146, 208, 0.1);
}

.domain-select-container {
  display: none;  /* Hidden by default */
  margin-top: 1rem;
}

.domain-select-container.visible {
  display: block;
}

.domain-select-container label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 1.1rem;
}

.domain-select-container select {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid black;
  font-size: 1.1rem;
  background: white;
  border-radius: 0;
  font-family: var(--font-family);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 3rem;
}

.domain-select-container select:focus {
  outline: none;
  border-color: var(--secondary-blue);
}

.domain-select-container select:hover {
  border-color: var(--secondary-blue);
}

/* Override system highlight color for dropdowns */
.domain-select-container select option:checked,
.domain-select-container select option:hover,
.domain-select-container select option:focus {
  background: var(--secondary-blue) linear-gradient(0deg, var(--secondary-blue) 0%, var(--secondary-blue) 100%);
  color: white;
}

/* Branding domain container */
.branding-domain-container {
  display: none;
  margin-top: 1rem;
}

.branding-domain-container label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 1.1rem;
}

.branding-domain-container input[type="text"] {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid black;
  font-size: 1.1rem;
  background: white;
  border-radius: 0;
  font-family: var(--font-family);
  height: var(--input-height);
}

.branding-domain-container input[type="text"]:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 3px rgba(13, 146, 208, 0.1);
  transition: all 0.2s ease;
}

.branding-domain-container .help-text {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Date Field Styles */
.date-type-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.date-type-btn {
  flex: 1;
  padding: 0.5rem;
  background: white;
  border: 2px solid black;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.date-type-btn:hover {
  background: var(--secondary-blue);
  color: white;
  border-color: var(--secondary-blue);
}

.date-type-btn.active {
  background: var(--secondary-blue);
  color: white;
  border-color: var(--secondary-blue);
}

.editor-field input[type="date"] {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid black;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: text;
  position: relative;
  background: white;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3e%3c/rect%3e%3cline x1='16' y1='2' x2='16' y2='6'%3e%3c/line%3e%3cline x1='8' y1='2' x2='8' y2='6'%3e%3c/line%3e%3cline x1='3' y1='10' x2='21' y2='10'%3e%3c/line%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

/* Format display */
.editor-field input[type="date"]::before {
  content: attr(data-display);
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  color: black;
  pointer-events: none;
}

.editor-field input[type="date"]:valid::before {
  display: none;
}

/* Hide default format */
.editor-field input[type="date"]::-webkit-datetime-edit {
  color: black;
}

.editor-field input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.editor-field input[type="date"]::-webkit-datetime-edit-text {
  padding: 0 0.3em;
}

.editor-field input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0;
  top: 0;
  width: 2.5rem;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  padding: 0;
}

.editor-field input[type="date"]:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 3px rgba(13, 146, 208, 0.1);
}

/* Share button styles */
.video-url,
.btn.url {
  padding: 0.75rem;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3.25rem;
  width: 3.25rem;
  border: 2px solid black;
}

.video-url svg,
.btn.url svg {
  stroke: black;
  stroke-width: 2.5;
  width: 1.5rem;
  height: 1.5rem;
}

.video-url:hover,
.btn.url:hover {
  transform: translate(0, 0);
}

/* Videos table button styles */
.videos-table .btn {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: 2px solid black;
  background: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.videos-table .btn.preview {
  background: var(--secondary-yellow);
}

.videos-table .btn.download {
  background: var(--secondary-blue);
  color: white;
}

.videos-table .btn.url {
  background: white;
}

.videos-table .btn.trash {
  background: #e74c3c;
}

.videos-table .btn.trash svg {
  stroke: white;
  fill: none;
  width: 1.25rem;
  height: 1.25rem;
}

.videos-table .btn.url svg {
  stroke: var(--text);
}

.videos-table .btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 black;
}

/* Modal url button */
.video-modal .video-url {
  margin-left: 0.5rem;
}

.video-modal .video-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Add more gap between edit job details text and icon */
.video-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.video-edit svg {
  margin-left: 0.5rem;
}

/* Floating success message */
.floating-success {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: white;
  padding: 1rem 1.5rem;
  border: 3px solid black;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.9);
  z-index: 1000;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-20px) rotate(-2deg);
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
  display: flex;
  align-items: flex-start; /* Allow multi-line content */
  gap: 0.75rem;
  max-width: 350px; /* Slightly wider for longer messages */
  cursor: pointer;
  height: auto; /* Fix height issue */
  min-height: 60px; /* Minimum height for consistency */
}

.floating-success span {
  line-height: 1.4; /* Better line spacing for multi-line text */
  flex: 1; /* Take remaining space after icon */
}

.floating-success:hover {
  transform: translateY(0) rotate(0deg) translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.9);
}

.floating-success .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary-yellow);
  width: 24px;
  height: 24px;
  min-width: 24px; /* Ensure the width doesn't shrink */
  min-height: 24px; /* Ensure the height doesn't shrink */
  border: 2px solid black;
  color: black; /* Change to black instead of green */
  font-size: 16px;
  font-weight: bold;
  margin-right: 8px;
  aspect-ratio: 1 / 1; /* Force perfect square */
  box-sizing: content-box; /* Ensure border doesn't affect dimensions */
}

.floating-success .icon svg {
  width: 16px;
  height: 16px;
  stroke: black; /* Ensure SVG stroke is black */
  fill: none; /* Remove any fill */
}

.floating-success.show {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

.floating-success.hide {
  opacity: 0;
  transform: translateY(-20px) rotate(2deg);
}

/* Floating error message */
.floating-error {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: white;
  padding: 1rem 1.5rem;
  border: 3px solid black;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.9);
  z-index: 1000;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-20px) rotate(-2deg);
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
  display: flex;
  align-items: flex-start; /* Allow multi-line content */
  gap: 0.75rem;
  max-width: 400px; /* Wider for error messages */
  cursor: pointer;
  height: auto; /* Fix height issue */
  min-height: 60px; /* Minimum height for consistency */
  word-wrap: break-word; /* Break long words */
}

.floating-error span {
  line-height: 1.4; /* Better line spacing for multi-line text */
  flex: 1; /* Take remaining space after icon */
}

.floating-error:hover {
  transform: translateY(0) rotate(0deg) translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.9);
}

.floating-error .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--error);
  width: 24px;
  height: 24px;
  min-width: 24px; /* Ensure the width doesn't shrink */
  min-height: 24px; /* Ensure the height doesn't shrink */
  border: 2px solid black;
  color: white;
  font-size: 16px;
  font-weight: bold;
  margin-right: 8px;
  aspect-ratio: 1 / 1; /* Force perfect square */
  box-sizing: content-box; /* Ensure border doesn't affect dimensions */
}

.floating-error .icon svg {
  width: 16px;
  height: 16px;
  stroke: white;
  fill: none;
}

.floating-error.show {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

.floating-error.hide {
  opacity: 0;
  transform: translateY(-20px) rotate(2deg);
}

/* Thumbnail button */
.thumbnail-generate,
.thumbnail-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.75rem 1.5rem;
  border: 2px solid black;
  background-color: white;
  color: black;
  font-weight: 500;
  font-family: var(--font-family); /* Add font family */
  cursor: pointer;
  position: relative;
  height: 3.25rem; /* Match height of other buttons */
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
}

.thumbnail-generate:hover,
.thumbnail-download:hover {
  transform: translate(0, 0);
}

.thumbnail-download {
  background-color: var(--success);
  color: white;
}

/* Pixelated loader animation */
.pixel-loader {
  display: inline-block;
  width: 24px;
  height: 24px;
  position: relative;
  margin-right: 8px;
}

.pixel-loader-grid {
  width: 100%;
  height: 100%;
  position: relative;
}

.pixel-loader-pixel {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: currentColor;
  animation: pixel-move 1s infinite steps(4);
}

@keyframes pixel-move {
  0% {
    top: 0;
    left: 16px;
    background-color: var(--primary);
  }
  25% {
    top: 16px;
    left: 0;
    background-color: var(--secondary-blue);
  }
  50% {
    top: 16px;
    left: 16px;
    background-color: var(--secondary-yellow);
  }
  75% {
    top: 0;
    left: 0;
    background-color: var(--primary);
  }
  100% {
    top: 0;
    left: 16px;
    background-color: var(--primary);
  }
}

/* Spinner animation */
.spinner {
  animation: rotate 2s linear infinite;
  width: 20px;
  height: 20px;
}

.spinner .path {
  stroke: currentColor;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}


/* Row animation for deletion */
.videos-table tr.deleting {
  animation: delete-row 0.5s ease forwards;
  background-color: rgba(231, 76, 60, 0.1);
}

@keyframes delete-row {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  50% {
    opacity: 0.5;
    transform: translateX(10px);
  }
  100% {
    opacity: 0;
    transform: translateX(-100%);
    height: 0;
    padding: 0;
    margin: 0;
  }
}

/* Recruiter Profile Styles */
.recruiter-profile-selector {
  margin-bottom: 1.5rem;
}

.recruiter-profile-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-family: var(--font-family);
  font-size: 1.1rem;
}

.recruiter-preview {
  display: flex;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 2px solid #000;
  border-radius: 0;
  background-color: white;
  box-shadow: 2px 2px 0 #000;
  position: relative;
}

.recruiter-image {
  width: 60px;
  height: 60px;
  border-radius: 0;
  border: 1px solid #000;
  object-fit: cover;
}

.recruiter-info {
  margin-left: 1rem;
  flex-grow: 1;
}

.recruiter-name {
  font-weight: bold;
  font-size: 1rem;
  font-family: var(--font-family);
}

.recruiter-role {
  font-size: 0.875rem;
  color: #555;
  font-family: var(--font-family);
}

.remove-recruiter {
  /* No additional styles needed */
}

/* Optional field label styling */
.job-field-optional-text {
  font-size: 0.7rem;
  opacity: 0.5;
  font-weight: normal;
  margin-left: 0.25rem;
  color: #777;
  display: inline-block;
}

/* Job Info Field Reorder Buttons */
.job-info-fields-container {
  display: flex;
  flex-direction: column;
}

.job-info-field {
  transition: background-color 0.15s ease;
}

.job-info-field.has-value {
  background: rgba(13, 146, 208, 0.03);
  border-radius: 4px;
  padding: 0.5rem;
  margin: -0.5rem;
  margin-bottom: 0.5rem;
}

.job-info-input-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.job-info-input-row textarea {
  flex: 1;
}


.job-info-reorder-buttons {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
}

.reorder-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 20px;
  padding: 0;
  background: white;
  border: 1.5px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  color: #666;
  transition: all 0.15s ease;
}

.reorder-btn:hover:not(:disabled) {
  background: var(--secondary-blue);
  border-color: var(--secondary-blue);
  color: white;
}

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

.reorder-btn svg {
  width: 12px;
  height: 12px;
}

/* Content Section Navigation */
.content-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.section-button {
  padding: 0.5rem 1rem;
  background-color: var(--bg-json);
  border: 2px solid black;
  border-radius: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 #000;
}

.section-button.active {
  background-color: var(--secondary-blue);
  color: white;
}

/* Content Section Styling */
.content-section {
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid transparent;
  background-color: var(--bg-json);
  position: relative;
  transition: all 0.2s ease;
}

.content-section.active {
  background-color: white;
  border-color: var(--secondary-blue);
}

.clear-section {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: #666;
}

.clear-section:hover {
  color: var(--error);
}

/* Undo clear button */
.undo-clear-button {
  display: block;
  margin: 0.5rem 0 1rem auto;
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: white;
  border: 2px solid #000;
  border-radius: 0.25rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.1s ease;
  animation: fadeIn 0.3s ease;
}

.undo-clear-button:hover {
  background-color: var(--primary-dark);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #000;
}

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

.template-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.edit-button {
  padding: 0.5rem 1rem;
  background: var(--secondary-yellow);
  border: 2px solid black;
  font-family: 'Space Grotesk', system-ui;
  font-weight: 500;
  cursor: pointer;
}

.edit-button:hover {
  transform: translate(2px, 2px);
}

.edit-form {
  background: white;
  border: 3px solid black;
  padding: 2rem;
  margin-top: 2rem;
  position: relative;
}

.edit-form::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 100%;
  height: 100%;
  background: var(--bg-json);
  z-index: -1;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.form-header h3 {
  margin: 0;
  font-weight: 600;
}

.version-info {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

.edit-fields {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.edit-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.edit-field label {
  font-weight: 500;
}

.edit-field input,
.edit-field textarea {
  padding: 0.75rem;
  border: 2px solid black;
  font-family: 'Space Grotesk', system-ui;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.save-template {
  padding: 0.75rem 1.5rem;
  background: var(--secondary-blue);
  color: white;
  border: 2px solid black;
  font-family: 'Space Grotesk', system-ui;
  font-weight: 500;
  cursor: pointer;
}

.cancel-edit {
  padding: 0.75rem 1.5rem;
  background: white;
  border: 2px solid black;
  font-family: 'Space Grotesk', system-ui;
  font-weight: 500;
  cursor: pointer;
}

.save-template:hover,
.cancel-edit:hover {
  transform: translate(2px, 2px);
}

/* Restore button */
.restore-button {
  background-color: var(--secondary-yellow);
  color: black;
  border: none;
  font-size: 0.8rem;
  font-family: var(--font-family);
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border: 1px solid black;
  transition: all 0.2s ease;
}

.restore-button:hover {
  background-color: var(--secondary-blue);
  color: white;
}

/* Instruction Panel Styling */
.instruction-panel {
  background-color: #f5f5f5;
  border: 2px solid #000;
  border-radius: 0;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.instruction-panel h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--secondary-blue);
}

.instruction-panel h5 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

.instruction-panel p {
  margin: 0.5rem 0;
  line-height: 1.4;
}

.instruction-panel ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.instruction-panel li {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.tip {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background-color: rgba(13, 146, 208, 0.1);
  border-left: 3px solid var(--secondary-blue);
  font-size: 0.95rem;
}

.help-text.warning {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background-color: rgba(255, 0, 0, 0.1);
  border-left: 3px solid var(--error);
  font-size: 0.95rem;
  color: var(--error);
}

/* Recruiter cell specific styling */
.cell-recruiter {
  text-align: center;
  vertical-align: middle;
  height: 60px; /* Match the row height */
  position: relative;
}

.cell-recruiter > * {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
}

.recruiter-thumbnail {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 0; /* Squared style like in create-video.js */
  overflow: hidden;
  border: 1px solid #000;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  vertical-align: middle;
}

/* Empty recruiter placeholder */
.empty-recruiter {
  display: inline-block;
  width: 32px; /* Same size as regular thumbnail */
  height: 32px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  position: relative;
  vertical-align: middle;
}

.no-recruiter {
  color: #999;
  font-style: italic;
}

/* Search and filter functionality */
.search-container {
  display: flex;
  margin-bottom: 1rem;
  position: relative;
  max-width: 100%;
  gap: 1rem;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 2px solid #000;
  border-radius: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--secondary-blue);
}

.clear-search {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 0;
  line-height: 1;
}

.clear-search:hover {
  color: #000;
}

/* Recruiter filter */
.recruiter-filter-container {
  min-width: 200px;
  position: relative;
}

.recruiter-filter {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 2px solid #000;
  border-radius: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  background-color: white;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1em;
}

.recruiter-filter:focus {
  outline: none;
  border-color: var(--secondary-blue);
}

/* Sortable table headers */
.videos-table th {
  cursor: pointer;
  position: relative;
  user-select: none;
}

.videos-table th:hover {
  background-color: #f0f0f0;
}

/* Only show arrows for sorted columns, no background color */
.videos-table th.sorted-asc,
.videos-table th.sorted-desc {
  font-weight: 700;
}

/* Reusing existing recruiter-image styling */
.cell-recruiter .recruiter-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-recruiter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #f0f0f0,
    #f0f0f0 3px,
    #e0e0e0 3px,
    #e0e0e0 6px
  );
}

/* Format visualization */
.cell-format {
  text-align: center;
  vertical-align: middle;
  height: 60px;
  position: relative;
}

.format-visual {
  display: inline-block;
  background-color: white;
  border: 2px solid #000; /* Same border thickness as recruiter thumbnails */
  position: relative;
  vertical-align: middle;
  max-height: 32px;
}

.format-visual.horizontal {
  width: 48px;
  height: 27px; /* 16:9 ratio */
}

.format-visual.vertical {
  width: 18px;
  height: 32px; /* 9:16 ratio */
}

.format-visual.semi_vertical {
  width: 24px;
  height: 32px; /* 3:4 ratio */
}

.format-visual.square {
  width: 32px;
  height: 32px;
}

/* Adjust table layout for new column order */
.videos-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
}

.videos-table th:nth-child(1), /* Domain */
.videos-table td:nth-child(1) {
  width: 10%; /* Smaller width for profile column */
}

.videos-table th:nth-child(2), /* Title */
.videos-table td:nth-child(2) {
  width: 35%; /* Less space for title to fit new columns */
}

.videos-table th:nth-child(3), /* Format */
.videos-table td:nth-child(3) {
  width: 8%; /* Keep format width */
}

.videos-table th:nth-child(4), /* Version */
.videos-table td:nth-child(4) {
  width: 8%; /* Version column */
}

.videos-table th:nth-child(5), /* Credits */
.videos-table td:nth-child(5) {
  width: 8%; /* Credits column */
}

.videos-table th:nth-child(6), /* Date */
.videos-table td:nth-child(6) {
  width: 12%; /* Date width */
}

.videos-table th:nth-child(7), /* Actions */
.videos-table td:nth-child(7) {
  width: 19%; /* Actions column */
}

/* Make all table cells vertically centered */
.videos-table td {
  vertical-align: middle;
  height: 60px;
}

/* Fix actions column alignment */
.cell-actions {
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.cell-actions > * {
  display: inline-block;
  margin: 0 2px; /* Add small margin between buttons */
}

/* Make sure title cell is vertically centered */
.cell-title {
  vertical-align: middle;
}

/* Fix actions column alignment */
.cell-actions {
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

/* Make all buttons in actions column consistent */
.cell-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 32px;
  height: 32px;
  margin: 0 2px;
  padding: 0;
  border: 2px solid #000;
  background-color: #fff;
}

.cell-actions .btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* New Features Notification */
.new-features-notification {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: white;
  border: 3px solid black;
  padding: 15px 20px;
  border-radius: 0; /* Ensure perfectly rectangular corners */
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
  z-index: 9999;
  max-width: 300px;
  transform: translateY(150%);
  transition: transform 0.3s ease-out;
  font-family: var(--font-family);
}

.new-features-notification.show {
  transform: translateY(0);
}

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

.new-features-notification .notification-title {
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
}

.new-features-notification .version-tag {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  margin-left: 8px;
  font-weight: 600;
}

.new-features-notification .close-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  line-height: 1;
  color: black;
}

.new-features-notification .notification-content {
  margin-bottom: 15px;
  font-size: 0.9rem;
  color: black;
}

.new-features-notification .notification-cta {
  display: block;
  width: 100%;
  background: white;
  color: black;
  border: 2px solid black;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.new-features-notification .notification-cta:hover {
  background: var(--primary);
  color: white;
  transform: translate(0, 2px);
  box-shadow: 0 0 0 black;
}

/* Sparkle animation */
.sparkle-container {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 30px;
  height: 30px;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23fae112' stroke='%23000' stroke-width='1'%3E%3Cpath d='M12 2L15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2z'/%3E%3C/svg%3E");
  background-size: contain;
  animation: sparkle 2s infinite;
}

.sparkle:nth-child(1) {
  top: 0;
  left: 0;
  animation-delay: 0s;
}

.sparkle:nth-child(2) {
  top: 8px;
  left: 12px;
  animation-delay: 0.3s;
  transform: scale(0.7);
}

.sparkle:nth-child(3) {
  top: 15px;
  left: 3px;
  animation-delay: 0.6s;
  transform: scale(0.5);
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: scale(0) rotate(360deg);
  }
}

/* Version link in login info */
.version-link {
  color: #666;
  text-decoration: none;
  font-size: 0.875rem; /* Match other login-info items */
  transition: color 0.2s;
  opacity: 0.7; /* Match other login-info items */
}

.version-link:hover {
  color: var(--primary);
}

#add-manual-recruiter-btn {
  padding: 0.45rem 1rem;
  background: transparent; /* Use transparent background */
  color: black; /* Use black text */
  border: 2px solid black; /* Keep black border */
  font-family: 'Space Grotesk', system-ui;
  font-weight: 500;
  cursor: pointer;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
  display: inline-block; /* Ensure it behaves like a button */
  margin-top: 10px; /* Add some top margin */
}

#add-manual-recruiter-btn:hover:not(:disabled) {
  transform: translate(0, 0);
}

#add-manual-recruiter-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Generic Loading Dots - Added from ui-styling rule */
.loading-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem; /* Consistent with ui-styling rule */
}

.loading-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  animation: dot-bounce 1.5s infinite ease-in-out; /* Uses existing dot-bounce animation */
}

.loading-dot:nth-child(1) {
  background: var(--primary);
  animation-delay: 0s;
}

.loading-dot:nth-child(2) {
  background: var(--secondary-blue);
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  background: var(--secondary-yellow);
  animation-delay: 0.4s;
}
/* End Generic Loading Dots */

/* Loading Dots (for job upload) - Kept for specific layout if needed */
.loading-dots[data-action="upload-job,full-flow"] {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 20px;
  width: 100%;
  position: relative;
  margin: 0 auto;
}

.loading-dots[data-action="upload-job,full-flow"] .loading-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  position: absolute;
  animation: dot-bounce 1.5s infinite ease-in-out;
}

.loading-dots[data-action="upload-job,full-flow"] .loading-dot:nth-child(1) {
  background: var(--primary);
  box-shadow: 0 0 15px rgba(246, 31, 119, 0.4);
  left: calc(50% - 50px);
}

.loading-dots[data-action="upload-job,full-flow"] .loading-dot:nth-child(2) {
  background: var(--secondary-blue);
  box-shadow: 0 0 15px rgba(13, 146, 208, 0.4);
  left: calc(50% - 16px);
}

.loading-dots[data-action="upload-job,full-flow"] .loading-dot:nth-child(3) {
  background: var(--secondary-yellow);
  box-shadow: 0 0 15px rgba(250, 225, 18, 0.4);
  left: calc(50% + 18px);
}

@keyframes dot-bounce {
  0%, 100% {
    transform: translateX(-15px);
  }
  50% {
    transform: translateX(15px);
  }
}
  
/* End Generic Loading Dots */

/* Step-based layout for create visual page */
.step-container {
  background: white;
  border: 3px solid black;
  border-radius: 0;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.step-container:hover {
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.15);
  transform: translate(-1px, -1px);
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5rem 0;
  font-size: 1.3em;
  font-weight: 600;
  color: #333;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--secondary-blue);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
}

.status-message {
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  border-radius: 4px;
  font-weight: 500;
}

.status-message.success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.status-message.info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}

/* Visual Input Tabs - Create Visual Page */
.visual-input-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.visual-input-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: white;
  color: black;
  border: 2px solid black;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  transform: translate(-2px, -2px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.visual-input-tab:hover {
  background: #f0f0f0;
  color: black;
  border-color: black;
  transform: translate(0, 0);
}

.visual-input-tab.active {
  background: var(--secondary-blue) !important;
  color: white;
  border-color: var(--secondary-blue);
  transform: translate(0, 0);
}

/* Visual Tab Content */
.visual-tab-content {
  display: none;
}

.visual-tab-content[style*="block"] {
  display: block !important;
}

/* Render Type Pills */
.render-type-pills {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.render-type-pill {
  flex: 1;
  padding: 1rem;
  background: white;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: 'Space Grotesk', system-ui;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.render-type-pill:hover {
  border-color: var(--secondary-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 146, 208, 0.15);
}

.render-type-pill.active {
  border-color: var(--secondary-blue);
  background: rgba(13, 146, 208, 0.05);
  box-shadow: 0 0 0 1px var(--secondary-blue);
}

.render-type-pill .pill-title {
  font-weight: 600;
  font-size: 1rem;
  color: #333;
  margin: 0;
}

.render-type-pill .pill-subtitle {
  font-size: 0.875rem;
  color: #666;
  margin: 0;
}

.render-type-pill.active .pill-title {
  color: var(--secondary-blue);
}

.render-type-pill.active .pill-subtitle {
  color: var(--secondary-blue);
  opacity: 0.8;
}

/* Template Type Toggle (Standard vs Branded) - Reuse render-type-pills styles */
.template-type-toggle {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.template-type-btn {
  flex: 1;
  padding: 1rem;
  background: white;
  border: 2px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: 'Space Grotesk', system-ui;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.template-type-btn:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(246, 31, 119, 0.15);
}

.template-type-btn.active {
  border-color: var(--primary);
  background: rgba(246, 31, 119, 0.05);
  box-shadow: 0 0 0 1px var(--primary);
}

.template-type-btn .template-type-title {
  font-weight: 600;
  font-size: 1rem;
  color: #333;
  margin: 0;
}

.template-type-btn .template-type-subtitle {
  font-size: 0.875rem;
  color: #666;
  margin: 0;
}

.template-type-btn.active .template-type-title {
  color: var(--primary);
}

.template-type-btn.active .template-type-subtitle {
  color: var(--primary);
}

/* Responsive design for pills */
@media (max-width: 768px) {
  .render-type-pills {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .render-type-pill {
    padding: 0.875rem;
  }
  
  .render-type-pill .pill-title {
    font-size: 0.9rem;
  }
  
  .render-type-pill .pill-subtitle {
    font-size: 0.8rem;
  }
  
  .template-type-toggle {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .template-type-btn {
    padding: 0.875rem;
  }
  
  .template-type-btn .template-type-title {
    font-size: 0.9rem;
  }
  
  .template-type-btn .template-type-subtitle {
    font-size: 0.8rem;
  }
}

/* Loading Dots (for job upload) - Kept for specific layout if needed */
  
/* Video Alignment Raster Overlay */

.video-alignment-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
  display: none;
}

.video-alignment-overlay.active {
  display: block;
}

/* Image Alignment Raster Overlay (same styles as video) */

.image-alignment-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
  display: none;
}

.image-alignment-overlay.active {
  display: block;
}

.video-raster {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.video-capture-area {
  position: absolute;
  top: 0;
  height: 100%;
  background: transparent;
  border: 3px solid var(--secondary-yellow);
  box-shadow: 
    0 0 0 2px rgba(0, 0, 0, 0.8),
    inset 0 0 0 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transition: left 0.2s ease-out, width 0.2s ease-out, top 0.2s ease-out, height 0.2s ease-out;
}

/* Removed center dot - no longer needed */

.video-alignment-slider {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  height: 40px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.video-alignment-slider .slider-title,
.video-alignment-slider-vertical .slider-title {
  position: absolute;
  top: auto;
  bottom: -55px; /* Place below the slider and below the label row */
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: #222;
  background: rgba(255,255,255,0.85);
  padding: 2px 6px;
  border: 1px solid #000;
}

/* Vertical alignment slider */
.video-alignment-slider-vertical {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.slider-track-vertical {
  position: relative;
  height: 100%;
  width: 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
  cursor: pointer;
}

.slider-handle-vertical {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: var(--secondary-yellow);
  border: 3px solid black;
  border-radius: 50%;
  cursor: grab;
  transition: transform 0.1s ease-out;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.slider-handle-vertical:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.slider-handle-vertical:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(0.95);
}

.slider-labels-vertical {
  position: absolute;
  right: -45px;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #666;
  pointer-events: none;
}

.alignment-percentage-vertical {
  position: absolute;
  right: 45px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--secondary-yellow);
  color: black;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 2px solid black;
  pointer-events: none;
}

.slider-track {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  cursor: pointer;
}

.slider-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: var(--secondary-yellow);
  border: 3px solid black;
  border-radius: 50%;
  cursor: grab;
  transition: transform 0.1s ease-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.slider-handle:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(0.95);
}

.slider-labels {
  position: absolute;
  bottom: -25px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #666;
  pointer-events: none;
}

.alignment-percentage {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--secondary-yellow);
  color: black;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 2px solid black;
  pointer-events: none;
}

/* Audio Modal Styles */
#audio-generation-modal,
#music-selection-modal,
#template-selection-modal,
#video-trimmer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none; /* Hide by default */
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

#audio-generation-modal.visible,
#music-selection-modal.visible,
#template-selection-modal.visible,
#video-trimmer-modal.visible {
  display: flex;
  opacity: 1;
}

#audio-generation-modal .modal-overlay,
#music-selection-modal .modal-overlay,
#template-selection-modal .modal-overlay,
#video-trimmer-modal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

#audio-generation-modal .modal-content,
#music-selection-modal .modal-content,
#template-selection-modal .modal-content,
#video-trimmer-modal .modal-content {
  position: relative;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  width: 90vw;
  max-width: 1200px;
  height: 90vh;
  min-height: 650px;
  z-index: 1;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.2s ease-out;
  display: flex;
  flex-direction: column;
}

#audio-generation-modal.visible .modal-content,
#music-selection-modal.visible .modal-content,
#template-selection-modal.visible .modal-content,
#video-trimmer-modal.visible .modal-content {
  transform: translateY(0);
}

#audio-generation-modal .modal-header,
#music-selection-modal .modal-header,
#template-selection-modal .modal-header,
#video-trimmer-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

#audio-generation-modal .modal-header h3,
#music-selection-modal .modal-header h3,
#template-selection-modal .modal-header h3,
#video-trimmer-modal .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

#audio-generation-modal .modal-close,
#music-selection-modal .modal-close,
#template-selection-modal .modal-close,
#video-trimmer-modal .modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  margin: -0.5rem;
  color: #666;
}

#audio-generation-modal .modal-close:hover,
#music-selection-modal .modal-close:hover,
#template-selection-modal .modal-close:hover,
#video-trimmer-modal .modal-close:hover {
  color: black;
}

/* Audio modal body */
#audio-generation-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
  min-height: 0; /* Important for flex + scroll */
}

#audio-generation-modal .voiceover-generation-area {
  flex: 0 0 auto; /* Do not grow, do not shrink, base size on content */
}

#audio-generation-modal .audio-list-section {
  flex: 1 1 auto; /* Grow to take remaining space */
  min-height: 0; /* Essential for allowing child to scroll */
}

/* Music modal body */
#music-selection-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    padding-top: 1.5rem;
}

/* Generation section - left column */
.generation-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.generation-section .help-text {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.4;
}

#audio-generation-modal textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: var(--font-family);
  resize: vertical;
  line-height: 1.5;
}

#audio-generation-modal textarea:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 2px rgba(13, 146, 208, 0.1);
}

.generation-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.char-counter {
  font-size: 0.9rem;
  color: #666;
}

.char-counter.limit-warning {
  color: var(--error);
  font-weight: 500;
}

.char-counter.limit-exceeded {
  color: var(--error);
  font-weight: 600;
}

.generate-audio-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: 2px solid black;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
}

.generate-audio-btn:hover:not(:disabled) {
  transform: translate(0, 0);
}

.generate-audio-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Audio & Music clips list */
.audio-list-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  border-top: 1px solid #eee;
  padding-top: 1.5rem;
  width: 100%;
}

@media (max-width: 768px) {
  #audio-generation-modal .modal-content,
  #music-selection-modal .modal-content {
    width: 95vw;
    height: 90vh;
    padding: 1rem;
  }
  
  #audio-generation-modal .modal-body,
  #music-selection-modal .modal-body {
    flex-direction: column;
  }
  
  .generation-section {
    flex: none;
  }
  
  .audio-list-section {
    flex: 1;
  }
}

.audio-list-section h4 {
  margin: 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
  font-size: 1.25rem;
  font-weight: 600;
  color: black;
  flex-shrink: 0; /* Ensure header doesn't shrink */
}

.audio-clips-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.audio-clip-pair {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.clip-left,
.clip-right {
  flex: 1;
}

.version-badge {
  display: inline-block;
  background: var(--secondary-yellow);
  color: black;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  border: 1px solid black;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.audio-clip-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  transition: all 0.2s ease;
}

.audio-clip-item:hover {
  border-color: var(--secondary-blue);
}

.audio-clip-item.selected {
  border: 3px solid var(--secondary-blue);
  border-radius: 0;
}

.audio-clip-item.selected .clip-text,
.audio-clip-item.selected .clip-meta {
  color: black;
}

.clip-text-content {
  flex: 1;
  min-width: 0;
}

.clip-text {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: black;
  word-wrap: break-word;
}

.clip-meta {
  font-size: 0.8rem;
  color: #666;
  font-family: var(--font-family);
}

.clip-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.play-pause-btn,
.delete-clip-btn {
  width: 2.5rem;
  height: 2.5rem;
  background: white;
  border: 2px solid black;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
}

.play-pause-btn:hover,
.delete-clip-btn:hover {
  transform: translate(0, 0);
}

.delete-clip-btn {
  background: var(--error);
}

.delete-clip-btn svg {
  stroke: white;
  fill: none;
  width: 1.25rem;
  height: 1.25rem;
}

.play-pause-btn svg {
  stroke: black;
  fill: black;
  width: 1.25rem;
  height: 1.25rem;
}

.select-clip-btn {
  padding: 0.5rem 1rem;
  background: var(--secondary-yellow);
  border: 2px solid black;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
}

.select-clip-btn:hover {
  transform: translate(0, 0);
}

.select-clip-btn.selected {
  background: var(--secondary-blue);
  color: white;
}

.select-clip-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.empty-list-message {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 2rem;
  border: 2px dashed #ccc;
  background: white;
  border-radius: 4px;
}

/* Secondary button styling to match save-changes */
.secondary-button {
  padding: 0.625rem 1rem;
  background: white;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  color: #374151;
  text-decoration: none;
  display: inline-block;
}

.secondary-button:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.secondary-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.secondary-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.secondary-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Audio remove button (X in top-right corner) */
.audio-remove-btn {
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  font-family: var(--font-family);
}

.audio-remove-btn:hover {
  background: #c53030 !important;
  transform: scale(1.1);
}

/* Music Modal Specifics */
.start-delay-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.start-delay-control label {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

.start-delay-control .start-delay-input {
    width: 70px;
    padding: 0.5rem;
    border: 2px solid black;
    font-family: var(--font-family);
    font-size: 0.9rem;
    text-align: center;
}

/* Waveform Styles */
.waveform-container {
    position: relative;
    width: 100%;
    margin: 1rem 0;
    background: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.waveform-canvas {
    display: block;
    width: 100%;
    height: 60px;
    cursor: pointer;
    background: #f8f9fa;
}

.waveform-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 24px; /* Leave space for time labels */
    pointer-events: none;
}

.playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary);
    z-index: 10;
    transition: left 0.1s ease;
}

.start-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--secondary-yellow);
    z-index: 5;
    cursor: pointer;
}

.start-marker::before {
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 8px solid var(--secondary-yellow);
}

.time-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    font-size: 0.75rem;
    color: #666;
}

.current-time {
    font-weight: 500;
    color: var(--primary);
}

.start-time {
    font-weight: 500;
    color: var(--secondary-yellow);
}

.total-time {
    color: #999;
}

/* Music Modal Specific Styles */
#music-selection-modal .audio-clip-item {
    padding: 1rem;
    margin-bottom: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

#music-selection-modal .audio-clip-item .clip-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

#music-selection-modal .clip-controls {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

#music-selection-modal .select-clip-btn {
    min-width: 120px;
    flex-shrink: 0;
}

/* --- Remotion Preview Modal --- */
#remotion-preview {
  position: fixed;
  top: 100px;
  right: 40px;
  width: 420px;
  height: auto;
  z-index: 900;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  overflow: hidden; /* Ensures content respects border-radius */
}

/* Hide the old layout styles */
.page-layout {
  display: block; /* Revert from flex */
}
.form-column, .preview-column {
  flex: none; /* Revert from flex */
  width: auto;
  position: static;
  max-height: none;
}

.left-sidebar .action-tab.active {
  background: var(--secondary-blue, #0d92d0);
  color: white;
  border: none;
  transform: translate(0, 0); /* Active: no shadow */
  box-shadow: none;
}

/* Form Column */
.form-column {
  flex: 1;
  padding: 20px 24px;
  padding-bottom: 120px; /* Space for fixed work area controls */
  overflow-y: auto;
  background: white;
  position: relative; /* Needed for child elements */
  /* Make only this column scrollable */
  height: calc(100vh - 70px);
  max-height: calc(100vh - 70px);
}

/* Full height for studio layout pages */
body.studio-layout .form-column {
  height: 100vh;
  max-height: 100vh;
  background: #fafbfc;
}

body.studio-layout .preview-column {
  height: 100vh;
}

body.studio-layout .workspace {
  height: 100vh;
}

/* Override .container for dashboard layout */
body.dashboard-layout .form-column .container {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  background: transparent;
  border: none;
  position: static;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

body.dashboard-layout .form-column .container::after {
  display: none;
}

/* Hide original header and tabs inside the new form column */
body.dashboard-layout .form-column > .container > .header,
body.dashboard-layout .form-column > .container > .action-tabs {
  display: none;
}

/* Job Selector Bar - Removed, moved to bottom bar */

/* Render Bar - Fixed at bottom, full width */
.render-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 210px !important;
  right: 0 !important;
  background: white !important;
  border-top: 1px solid #d1d5db !important;
  padding: 1rem 24px !important;
  z-index: 1000 !important;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
}

body.studio-layout .render-bar {
  left: 210px !important;
}

.render-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.render-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.render-bar-left .template-select-button {
  flex: 0 1 auto;
  min-width: 200px;
  width: auto !important;
}

.render-bar-left .duplicate-btn {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  white-space: nowrap;
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
}

.render-bar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.render-bar .action-button,
.render-bar .secondary-button {
  width: auto !important;
  flex-shrink: 0;
}

.render-all-button {
  background: #f8fafc !important;
  cursor: not-allowed !important;
}

.render-all-button:hover:disabled {
  cursor: not-allowed !important;
}

/* Legacy work-area-controls - keep for backwards compat */
.work-area-controls {
  position: fixed !important;
  bottom: 0 !important;
  left: 210px !important; /* Sidebar width */
  right: 650px !important; /* Preview column width (updated) */
  background: white !important;
  border-top: 1px solid #e5e7eb !important;
  padding: 0.875rem 20px !important;
  z-index: 1000 !important;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05) !important;
}

body.studio-layout .work-area-controls {
  left: 210px !important; /* Studio sidebar width */
}

/* Hide top header on studio layout pages */
body.studio-layout .top-header {
  display: none !important;
}

.work-controls-inner {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.work-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.work-control-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin: 0;
}

.work-control-group .template-select-button {
  min-width: 300px;
}

.work-control-group.work-control-render {
  margin-left: auto;
}

.work-control-group.work-control-render .action-button {
  min-width: 150px;
}

/* Preview Column Specific to Create Video */
.preview-column {
  width: 650px; /* Increased from 420px (55% wider) */
  min-width: 650px;
  padding: 0;
  background: #f8fafc;
  border-left: 1px solid #e5e7eb;
  overflow: visible;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  /* Keep preview column fixed in viewport */
  height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
}

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

/* Resize Handle */
.resize-handle {
  width: 10px;
  background: #e5e7eb;
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resize-handle:hover {
  background: var(--secondary-blue);
  width: 12px;
}

.resize-handle:hover::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 80px;
  background: rgba(13, 146, 208, 0.1);
  border-radius: 4px;
  pointer-events: none;
}

.resize-handle:active {
  background: var(--secondary-blue);
}

.resize-handle-line {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 40px;
  background: #9ca3af;
  border-radius: 2px;
  pointer-events: none;
  transition: all 0.2s ease;
}

.resize-handle:hover .resize-handle-line {
  background: white;
  height: 60px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.resize-handle.resizing {
  background: var(--secondary-blue);
  width: 12px;
}

.resize-handle.resizing .resize-handle-line {
  background: white;
  height: 60px;
}

.workspace.resizing {
  cursor: col-resize;
  user-select: none;
}

.workspace.resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

/* Tooltip hint for resize handle */
.resize-handle::after {
  content: 'Drag to resize • Double-click to reset';
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-family);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.resize-handle:hover::after {
  opacity: 1;
  transition-delay: 0.5s;
}

.preview-header {
  padding: 40px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.preview-header h3 {
  margin: 0 0 0.25rem 0;
  font-weight: 600;
  font-size: 1.1rem;
  color: #333;
}

.preview-header .help-text {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
}

/* Preview Format Selector - Compact pills above video */
.preview-format-selector {
  padding: 1.5rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  overflow: visible;
  display: flex;
  align-items: stretch;
  min-height: 90px; /* Match sticky-editor-header height */
  position: relative;
  z-index: 1000;
}

.preview-format-selector .render-type-pills.compact {
  flex: 1;
  width: 100%;
  align-items: stretch;
}

.preview-format-selector .render-type-pill.compact {
  flex: 1;
  justify-content: center;
  align-items: center;
  min-height: 100%;
}

.render-type-pills.compact {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0;
  position: relative;
  overflow: visible;
  overflow: visible;
  position: relative;
}

.render-type-pill.compact {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1.5px solid #e5e5e5;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: 'Space Grotesk', system-ui;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  position: relative;
  min-height: auto;
  justify-content: flex-start;
  z-index: 1;
}

.render-type-pill.compact:hover {
  z-index: 99999;
}

/* Square pill: subtitle (1:1) at bottom, title (Square) above it */
.render-type-pill.compact[data-format="square"] {
  gap: 0;
  justify-content: flex-start;
}

.render-type-pill.compact[data-format="square"] .format-shape {
  margin-bottom: auto;
}

.render-type-pill.compact[data-format="square"] .pill-title {
  margin-bottom: 0.25rem;
}

.render-type-pill.compact[data-format="square"] .pill-subtitle {
  margin-top: 0;
}

/* Semi-vertical: text positioned between shape and bottom for better balance */
.render-type-pill.compact[data-format="semi_vertical"] {
  gap: 0;
  justify-content: flex-start;
}

.render-type-pill.compact[data-format="semi_vertical"] .format-shape {
  margin-bottom: 0.5rem;
}

.render-type-pill.compact[data-format="semi_vertical"] .pill-title {
  margin-bottom: 0.125rem;
}

.render-type-pill.compact[data-format="semi_vertical"] .pill-subtitle {
  margin-top: auto;
}

.render-type-pill.compact:hover {
  border-color: var(--secondary-blue);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(13, 146, 208, 0.15);
}

.render-type-pill.compact.active {
  border-color: var(--secondary-blue);
  background: rgba(13, 146, 208, 0.1);
  box-shadow: 0 2px 8px rgba(13, 146, 208, 0.25);
  transform: translateY(-1px);
}

.render-type-pill.compact .format-shape {
  width: 24px;
  height: 24px;
  margin-bottom: 0;
}

.render-type-pill.compact .format-shape.vertical-shape {
  width: 18px;
  height: 24px;
}

.render-type-pill.compact .format-shape.semi-vertical-shape {
  width: 20px;
  height: 24px;
}

.render-type-pill.compact .format-shape.square-shape {
  width: 20px;
  height: 20px;
}

.render-type-pill.compact.active .format-shape {
  background: var(--secondary-blue);
  opacity: 0.8;
}

.render-type-pill.compact .pill-title {
  font-weight: 600;
  font-size: 0.75rem;
  color: #333;
  margin: 0;
  line-height: 1.2;
}

.render-type-pill.compact .pill-subtitle {
  font-size: 0.65rem;
  color: #666;
  margin: 0;
  line-height: 1.2;
}

.render-type-pill.compact.active .pill-title {
  color: var(--secondary-blue);
}

.render-type-pill.compact.active .pill-subtitle {
  color: var(--secondary-blue);
  opacity: 0.8;
}

/* Blue dot indicator - shown when there ARE format-specific edits */
.render-type-pill.compact .format-indicator-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  background: var(--secondary-blue);
  border-radius: 50%;
  opacity: 1;
  display: none; /* Hidden by default, shown when has-customizations */
}

.render-type-pill.compact.has-customizations .format-indicator-dot {
  display: block;
}

/* Tooltip for compact pills - shows below */
.pill-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  text-align: center;
  width: max-content;
}

.pill-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #1f2937;
}

/* Left pill: align tooltip to left edge */
.render-type-pill.compact:first-child .pill-tooltip {
  left: 0;
  transform: none;
}

.render-type-pill.compact:first-child .pill-tooltip::after {
  left: 20px;
  transform: none;
}

/* Right pill: align tooltip to right edge */
.render-type-pill.compact:last-child .pill-tooltip {
  left: auto;
  right: 0;
  transform: none;
}

.render-type-pill.compact:last-child .pill-tooltip::after {
  left: auto;
  right: 20px;
  transform: none;
}

.render-type-pill.compact:hover .pill-tooltip {
  opacity: 1;
}

.tooltip-platforms {
  margin-bottom: 0.25rem;
}

.tooltip-customizations {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #60a5fa;
}

.tooltip-customizations:empty {
  display: none;
}

.preview-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem;
  padding-top: 1.5rem;
  overflow: auto;
  min-height: 0; /* Important for flexbox overflow */
}

.preview-help-text {
  margin: 0.75rem 0 0 0;
  font-size: 0.75rem;
  color: #666;
  text-align: center;
}

/* Responsive */
@media (max-width: 992px) {
  .preview-content {
    padding: 0;
  }
}




#remotion-preview {
  border: 2px solid black;
  border-radius: 8px;
  background: black;
  flex-shrink: 1;
  transition: width 0.3s ease, height 0.3s ease;
  position: static;
  max-width: 100%;
  max-height: calc(100vh - 250px); /* Ensure it fits in viewport */
  object-fit: contain;
  overflow: hidden;
}

/* Format-specific sizing with max constraints */
#remotion-preview.vertical { 
  width: 360px; 
  height: 640px;
  max-width: min(360px, 100%);
  max-height: min(640px, calc(100vh - 250px));
}

#remotion-preview.semi_vertical { 
  width: 360px; 
  height: 450px;
  max-width: min(360px, 100%);
  max-height: min(450px, calc(100vh - 250px));
}

#remotion-preview.square { 
  width: 360px; 
  height: 360px;
  max-width: min(360px, 100%);
  max-height: min(360px, calc(100vh - 250px));
}

#remotion-preview.horizontal { 
  width: 640px; 
  height: 360px;
  max-width: min(640px, 100%);
  max-height: min(360px, calc(100vh - 250px));
}

#remotion-preview:not(.vertical):not(.semi_vertical):not(.square):not(.horizontal) { 
  width: 360px; 
  height: 640px;
  max-width: min(360px, 100%);
  max-height: min(640px, calc(100vh - 250px));
}


/* Responsive */
@media (max-width: 1400px) {
  .preview-column {
    width: 500px;
    min-width: 500px;
  }
  
  .work-area-controls {
    right: 500px;
  }
  
  #remotion-preview.vertical { 
    width: 300px; 
    height: 533px;
  }
  #remotion-preview.semi_vertical { 
    width: 300px; 
    height: 375px;
  }
  #remotion-preview.square { 
    width: 300px; 
    height: 300px;
  }
  #remotion-preview.horizontal {
    width: 300px;
    height: 169px;
  }
}

@media (max-width: 1200px) {
  .preview-column {
    width: 450px;
    min-width: 450px;
  }
  
  .work-area-controls {
    right: 450px;
  }
  
  .preview-header {
    padding: 30px 20px;
  }
  
  #remotion-preview.vertical { 
    width: 270px; 
    height: 480px;
  }
  #remotion-preview.semi_vertical { 
    width: 270px; 
    height: 338px;
  }
  #remotion-preview.square { 
    width: 270px; 
    height: 270px;
  }
  #remotion-preview.horizontal {
    width: 270px;
    height: 152px;
  }
}



/* Removed duplicate 768px breakpoint - now handled by 992px breakpoint */

/*
==============================================
Dashboard Layout
==============================================
*/

/* Reset body styles for dashboard layout */
body.dashboard-layout {
  margin: 0;
  padding: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: white;
  /* Add padding for fixed header */
  padding-top: 70px;
}

/* Top Header */
/* Studio layout pages use full height - no top header */
body.studio-layout {
  padding-top: 0 !important;
}

body.studio-layout .main-layout {
  height: 100vh;
  margin-top: 0;
  padding-top: 0;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  /* Glass morphism effect - always applied */
  background: rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid rgba(229, 231, 235, 0.3);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 1px 20px rgba(255, 255, 255, 0.4) inset;
  /* Subtle gradient overlay for premium feel */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 70px;
  /* Smooth transitions for premium feel */
  transition: 
    background-color 0.3s ease,
    backdrop-filter 0.3s ease,
    box-shadow 0.3s ease;
}

/* Ensure glass effect applies on all screen sizes */
@media (min-width: 769px) {
  .top-header {
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }
}

/* Add a subtle gradient overlay for extra premium feel */
.top-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg, 
    rgba(246, 31, 119, 0.02) 0%, 
    rgba(13, 146, 208, 0.02) 50%,
    rgba(250, 225, 18, 0.02) 100%
  );
  pointer-events: none;
  z-index: -1;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.logo-section img {
  width: 32px;
  height: 32px;
  /* Add subtle glow for premium feel */
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: filter 0.3s ease;
}

.logo-section img:hover {
  filter: drop-shadow(0 2px 8px rgba(246, 31, 119, 0.3));
}

.logo-section h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #1a1a1a;
  font-weight: 600;
  /* Enhanced text contrast and premium feel */
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
}

/* Enhanced login-info for glass header */
.top-header .login-info {
  position: static;
  top: auto;
  right: auto;
  display: flex;
  align-items: center;
  gap: 15px;
  color: #1a1a1a;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  z-index: 1;
}

.top-header .login-info span {
  font-size: 0.9rem;
}

.top-header .logout-button {
  color: #666;
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.top-header .logout-button:hover {
  color: var(--primary);
}

/* Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  overflow: auto;
  min-height: calc(100vh - 70px);
}

/* Full height for studio layout pages (no top header) */
body.studio-layout .main-layout {
  min-height: 100vh;
  height: 100vh;
}

.workspace {
  display: flex;
  flex: 1;
  overflow: visible;
}

/* Left Sidebar */
.left-sidebar {
  width: 210px;
  min-width: 210px;
  background: white;
  border-right: 1px solid #e5e7eb;
  padding: 20px 0;
  flex-shrink: 0;
  /* Keep sidebar fixed height, no scrolling */
  height: calc(100vh - 70px);
  overflow: hidden;
}

/* Studio sidebar for all studio layout pages */
body.studio-layout .left-sidebar.studio-sidebar {
  width: 210px;
  min-width: 210px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-right: 1px solid #e5e7eb;
  position: relative;
}

.studio-sidebar .sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.studio-sidebar .logo-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.studio-sidebar .logo-section img {
  width: 24px;
  height: 24px;
}

.studio-sidebar .logo-section h1 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  letter-spacing: -0.01em;
}

.studio-sidebar .logo-section h1 .brand-ai {
  color: #1e293b;
  font-weight: 600;
}

.studio-sidebar .action-tabs {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.studio-sidebar .action-tabs .action-tab-wrapper:first-child .action-tab {
  margin-top: 1rem;
}

/* Clean nav buttons for studio sidebar - no neo-brutalist */
body.studio-layout .studio-sidebar .action-tab-wrapper {
  position: relative !important;
  margin: 0 !important;
}

body.studio-layout .studio-sidebar .action-tab-wrapper::after {
  display: none !important;
}

body.studio-layout .studio-sidebar .action-tab {
  width: 100% !important;
  padding: 0.625rem 0.875rem !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  font-size: 0.8125rem !important;
  color: #64748b !important;
  cursor: pointer !important;
  text-align: left !important;
  transform: none !important;
  box-shadow: none !important;
  transition: all 0.15s ease !important;
}

body.studio-layout .studio-sidebar .action-tab:hover {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  transform: none !important;
}

body.studio-layout .studio-sidebar .action-tab.active {
  background: transparent !important;
  color: var(--primary) !important;
  font-weight: 600 !important;
  font-size: 0.9375rem !important;
  transform: none !important;
  box-shadow: none !important;
  border: none !important;
}

.studio-sidebar .sidebar-footer {
  padding: 1rem 1.625rem 1rem 1rem;
  border-top: none;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.studio-sidebar .user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}

.studio-sidebar .user-email {
  font-size: 0.75rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.studio-sidebar .logout-button-icon {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.studio-sidebar .logout-button-icon:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.studio-sidebar .user-credits {
  font-size: 0.75rem;
  color: var(--secondary-blue);
  font-weight: 500;
}

.studio-sidebar .version-link-container {
  position: absolute;
  bottom: 0.75rem;
  right: 1.625rem;
  left: auto;
  font-size: 0.6875rem;
  color: #94a3b8;
  z-index: 10;
}

.studio-sidebar .version-link-container a {
  color: #94a3b8;
  text-decoration: none;
}

.studio-sidebar .version-link-container a:hover {
  color: #64748b;
}

.left-sidebar .action-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0;
  padding: 0 15px;
}

.left-sidebar .action-tab-wrapper {
  flex: none;
  position: relative;
  margin-bottom: 0;
}

.left-sidebar .action-tab-wrapper::after {
  content: '';
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  background: var(--bg-json, #d1c8c5);
  z-index: 1;
  display: block;
}

.left-sidebar .action-tab-wrapper:has(.active)::after {
  display: none !important;
}

.left-sidebar .action-tab {
  padding: 0.75rem 0.875rem;
  background: white;
  border: 2px solid black;
  border-radius: 0;
  font-weight: 500;
  font-size: 0.875rem;
  font-family: var(--font-family, 'Space Grotesk', sans-serif);
  cursor: pointer;
  position: relative;
  z-index: 2;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
  text-align: left;
  width: 100%;
  color: black;
}

.left-sidebar .action-tab:hover {
  transform: translate(0, 0);
}

/* Tablet/Medium screens - sidebar to bottom, keep preview on right */
@media (max-width: 1100px) {
  .main-layout {
    flex-direction: column;
    overflow: visible;
  }
  
  .left-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    border-right: none;
    border-top: 2px solid #e5e7eb;
    border-bottom: none;
    padding: 12px 10px 8px 10px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    order: 999;
  }
  
  .left-sidebar .action-tabs {
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  
  .left-sidebar .action-tab-wrapper {
    flex: 1;
    min-width: 140px;
  }
  
  .left-sidebar .action-tab {
    padding: .65rem 0.75rem;
    font-size: .8rem;
    text-align: center;
  }
  
  /* Workspace stays as row with preview on right */
  .workspace {
    flex-direction: row;
    height: auto;
    padding-bottom: 80px;
    overflow: visible;
  }
  
  .form-column {
    height: auto;
    max-height: none;
    padding: 20px;
    padding-bottom: 140px; /* Space for fixed work area controls */
    overflow-y: auto;
  }
  
  .work-area-controls {
    padding: 1rem 20px;
  }
  
  .work-controls-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .work-control-group .template-select-button {
    min-width: auto;
    width: 100%;
  }
  
  .work-control-group.work-control-render {
    margin-left: 0;
    width: 100%;
  }
  
  .work-control-group.work-control-render .action-button {
    width: 100%;
  }
  
  /* On mobile, position work-area-controls above the fixed sidebar */
  .work-area-controls {
    position: fixed;
    bottom: 60px; /* Above the fixed sidebar */
    z-index: 150; /* Below sidebar but above content */
  }
  
  .preview-column {
    width: 280px;
    min-width: 280px;
    padding: 0;
    position: sticky;
    top: 70px;
    align-self: flex-start;
    height: calc(100vh - 150px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  .preview-header {
    padding: 20px 15px 15px 15px;
    flex-shrink: 0;
  }
  
  .preview-header h3 {
    font-size: 1rem;
  }
  
  .preview-header .help-text {
    font-size: 0.8rem;
  }
  
  .preview-content {
    padding: 10px;
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
  }
  
  #remotion-preview.vertical { 
    width: 240px; 
    height: 427px;
  }
  #remotion-preview.semi_vertical { 
    width: 240px; 
    height: 300px;
  }
  #remotion-preview.square { 
    width: 240px; 
    height: 240px;
  }
  #remotion-preview.horizontal {
    width: 240px;
    height: 135px;
  }
}

/* Small tablets/large phones - floating preview in corner */
@media (max-width: 768px) {
  .workspace {
    flex-direction: column;
    height: auto;
  }
  
  .form-column {
    padding: 15px;
  }
  
  /* Hide resize handle on mobile */
  .resize-handle {
    display: none !important;
  }
  
  .resize-handle::after {
    display: none !important;
  }
  
  .preview-column {
    position: fixed;
    top: 90px;
    right: 15px;
    width: 200px;
    min-width: 200px;
    padding: 12px;
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: blur(8px);
    border: 2px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 150;
    border-radius: 8px;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
  }

  .preview-column.hidden {
    display: none;
  }
  
  .preview-header {
    padding: 12px;
  }
  
  .preview-header h3 {
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
  }
  
  .preview-header .help-text {
    font-size: 0.7rem;
  }
  
  .preview-content {
    padding: 8px;
  }

  #remotion-preview {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    box-shadow: none;
    max-width: 100%;
  }

  #remotion-preview.vertical {
    aspect-ratio: 9 / 16;
    max-height: 50vh;
  }
  #remotion-preview.semi_vertical {
    aspect-ratio: 4 / 5;
    max-height: 45vh;
  }
  #remotion-preview.square {
    aspect-ratio: 1 / 1;
    max-height: 40vh;
  }
  #remotion-preview.horizontal {
    aspect-ratio: 16 / 9;
    max-height: 30vh;
  }
}

/* Brands page styles */
.brands-list {
  width: 100%;
  margin: 0;
}

.brands-header {
  margin-bottom: var(--spacing-xl);
  text-align: center;
}

.brands-header h3 {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 1.5rem;
  font-weight: 600;
  font-family: var(--font-family);
  color: var(--text);
}

.brands-header p {
  margin: 0;
  color: var(--text-light);
  font-size: 1rem;
  font-family: var(--font-family);
}

.brand-item {
  background: white;
  border: 4px solid black;
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-xl);
  transition: transform 0.2s ease;
}

.brand-item:hover {
  transform: translate(-2px, -2px);
}

.brand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.brand-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.brand-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 2px solid black;
  border-radius: 8px;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-family);
  color: var(--text);
}

.brand-domain {
  font-size: 0.875rem;
  color: var(--text-light);
  background: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 2px solid black;
  font-weight: 500;
}

.brand-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.edit-brand-btn {
  background: var(--secondary-blue);
  color: white;
  border: 2px solid black;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  position: relative;
  transform: translate(-2px, -2px);
  transition: transform 0.2s ease;
}

.edit-brand-btn:hover {
  transform: translate(0, 0);
}

.brand-preview {
  display: flex;
  gap: var(--spacing-xl);
  align-items: center;
}

.color-palette {
  display: flex;
  gap: var(--spacing-sm);
}

.color-swatch {
  width: 48px;
  height: 48px;
  border: 3px solid black;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.color-swatch:hover {
  transform: translate(-2px, -2px);
}

.brand-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.detail-item {
  font-size: 0.9rem;
  color: var(--text);
  font-family: var(--font-family);
  line-height: 1.4;
}

.detail-item strong {
  color: var(--text);
  font-weight: 600;
}

.detail-item a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid var(--primary);
}

.detail-item a:hover {
  color: var(--secondary-blue);
  border-color: var(--secondary-blue);
}

.add-brand-btn {
  background: var(--secondary-yellow);
  color: black;
  border: 4px solid black;
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  margin-top: var(--spacing-lg);
  transition: transform 0.2s ease;
}

.add-brand-btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
}

.add-brand-btn:disabled {
  background: #f0f0f0;
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Responsive design for brands */
@media (max-width: 768px) {
  .brand-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-lg);
  }
  
  .brand-preview {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-lg);
  }
  
  .brand-info {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .color-palette {
    gap: var(--spacing-xs);
  }

  .color-swatch {
    width: 40px;
    height: 40px;
  }
}

/* Brand editor modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  border: 4px solid black;
  max-width: 900px;
  width: 90%;
  position: relative;
  overflow: hidden;
}



.brand-editor {
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0rem 1rem 0rem;
  background: white;
}

.modal-header h3 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  color: black;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  color: #666;
  font-weight: 300;
}

.close-btn:hover {
  color: black;
}

.brand-form {
  padding: 0 3rem 3rem 3rem;
  background: white;
}

.form-sections {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.form-section {
  background: transparent;
  padding: 0;
}

body:not(.create-video-page) .form-section {
  background: white;
}

.form-section h4 {
  margin: 0 0 var(--spacing-lg) 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: black;
  border-bottom: 4px solid black;
  padding-bottom: var(--spacing-sm);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.form-group label {
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
  color: black;
  font-size: 1.1rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid black;
  font-size: 1.1rem;
  background: white;
  border-radius: 0;
  font-family: var(--font-family);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 3px rgba(13, 146, 208, 0.1);
  transition: all 0.2s ease;
}

/* Image preview styles */
.image-preview {
  margin-top: var(--spacing-sm);
  min-height: 60px;
  border: 2px dashed black;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm);
  background: white;
}

.image-preview img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

.image-preview .error {
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Color input group */
.color-input-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.color-input-group input[type="color"] {
  width: 50px;
  height: 50px;
  border: 3px solid black;
  cursor: pointer;
  padding: 0;
  background: transparent;
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.color-input-group input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border: none;
  border-radius: 0;
}

.color-input-group input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 0;
}

.color-input-group input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 0;
}

.color-input-group input[type="text"] {
  flex: 1;
  min-width: 0;
}

.color-input-group button {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--secondary-yellow);
  border: 2px solid black;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-family);
  white-space: nowrap;
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
}

.color-input-group button:hover {
  transform: translate(0, 0);
}



/* Color preview */
.color-preview {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-lg);
  border: 2px solid black;
  background: white;
  position: relative;
}



.gradient-preview {
  height: 80px;
  border: 2px solid black;
  background: linear-gradient(45deg, #3B82F6, #1E40AF, #1E3A8A);
}

/* Font preview */
.font-preview {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-lg);
  border: 2px solid black;
  background: white;
  position: relative;
}



.preview-text {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-bottom: var(--spacing-sm);
  color: black;
}

.font-status {
  font-size: 0.9rem;
  font-weight: 500;
}

.font-status.success {
  color: #22c55e;
}

.font-status.warning {
  color: #f97316;
}

.font-status.error {
  color: #dc3545;
}

.font-status.info {
  color: #3b82f6;
}

/* Font actions */
.font-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-sm);
}

.reload-font-btn {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--secondary-blue);
  color: white;
  border: 2px solid black;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-family);
  transform: translate(-2px, -2px);
  transition: transform 0.2s;
}

.reload-font-btn:hover {
  transform: translate(0, 0);
}

/* Font help message */
.font-help {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: #f8f9fa;
  border: 2px solid #ddd;
  border-radius: 4px;
}

.font-help p {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

.font-help strong {
  color: var(--primary);
}

/* Custom font row */
.custom-font-row {
  display: none;
}

/* Form actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xxl);
  padding-top: var(--spacing-lg);
  border-top: 4px solid black;
}

.cancel-btn,
.save-btn {
  padding: 1.25rem 2rem;
  border: 2px solid black;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  font-family: var(--font-family);
  position: relative;
  z-index: 2;
  transform: translate(-4px, -4px);
  transition: transform 0.2s;
}

.cancel-btn {
  background: white;
  color: black;
}

.cancel-btn:hover {
  transform: translate(0, 0);
}

.save-btn {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.save-btn:hover:not(:disabled) {
  transform: translate(0, 0);
}

.save-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: translate(-4px, -4px);
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border: 4px solid black;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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



/* Radio group styling */
.radio-group {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 0;
  color: black;
}

.radio-group input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

/* Colors grid layout */
.colors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-lg);
}

.color-group {
  display: flex;
  flex-direction: column;
}

.color-group label {
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
  color: black;
  font-size: 1.1rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-header {
    padding: 1rem 0rem 1rem 0rem;
  }
  
  .modal-header h3 {
    font-size: 1.5rem;
  }
  
  .brand-form {
    padding: 0 var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .colors-grid {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .cancel-btn,
  .save-btn {
    width: 100%;
  }
}

/* Single column layout for certain sections */
.form-row.single-column {
  grid-template-columns: 1fr;
}

/* Logo preview container */
.logo-preview-container {
  display: flex;
  gap: var(--spacing-lg);
  align-items: flex-start;
}

.logo-preview-panel {
  width: 200px;
  height: 150px;
  border: 2px solid black;
  border-radius: 8px;
  background: 
    /* Checker pattern for transparency */
    linear-gradient(45deg, #ccc 25%, transparent 25%), 
    linear-gradient(-45deg, #ccc 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #ccc 75%), 
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.logo-display {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm);
}

.logo-display img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-placeholder {
  color: #666;
  font-size: 0.9rem;
  text-align: center;
  font-style: italic;
}

.logo-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.control-group label {
  font-weight: 500;
  color: black;
  font-size: 1rem;
  margin-bottom: 0;
}

.opacity-slider {
  width: 100%;
  height: 4px;
  background: black;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: black;
  cursor: pointer;
  border: 2px solid black;
}

.opacity-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: black;
  cursor: pointer;
  border: 2px solid black;
  border-radius: 0;
}

.opacity-value {
  font-weight: 600;
  color: black;
  font-size: 0.9rem;
  align-self: flex-end;
}

/* Mobile responsive for logo preview */
@media (max-width: 768px) {
  .logo-preview-container {
    flex-direction: column;
    gap: var(--spacing-md);
  }
  
  .logo-preview-panel {
    width: 100%;
    height: 120px;
  }
}

/* Ensure proper spacing for single-column form elements */
.form-group:last-child {
  margin-bottom: 0;
}

/* Ensure modal is properly sized */
.modal.show {
  display: flex !important;
}

/* Add at the end of the file */

/* Queue Status Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.queue-status-container {
    transition: all 0.3s ease;
}

.queue-status-container.processing {
    border-color: #4caf50;
    background: #f1f8e9;
}

.queue-status-container.processing .queue-icon {
    border-color: #4caf50;
    border-top-color: transparent;
}

.queue-status-container.processing h4 {
    color: #2e7d32;
}

.queue-status-container.error {
    border-color: #f44336;
    background: #ffebee;
}

.queue-status-container.error .queue-icon {
    border-color: #f44336;
    border-top-color: transparent;
    animation: none;
}

.queue-status-container.error h4 {
    color: #c62828;
}

.queue-metrics .metric {
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
}

.queue-progress-bar {
    position: relative;
    overflow: hidden;
}

.queue-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced loading states */
.loading-state.queue-mode .loading-text {
    color: #1976d2;
}

.loading-state.processing-mode .loading-text {
    color: #4caf50;
}

.loading-state.error-mode .loading-text {
    color: #f44336;
}

/* Button styles for queue actions */
.secondary-button {
    padding: 8px 16px;
    border: 2px solid #ccc;
    background: white;
    color: #666;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    border-color: #999;
    color: #333;
}

.secondary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Queue warning notice */
.queue-warning {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shared Modal Styles - Used by duplicate and domain-owned modals */
#duplicate-modal.modal-overlay,
#domain-owned-modal.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#duplicate-modal.modal-overlay.visible,
#domain-owned-modal.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

#duplicate-modal .modal-content,
#domain-owned-modal .modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 600px;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

#duplicate-modal.visible .modal-content,
#domain-owned-modal.visible .modal-content {
    transform: scale(1);
}

#duplicate-modal h2,
#domain-owned-modal h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: #333;
}

#duplicate-modal p,
#domain-owned-modal p {
  margin-bottom: 30px;
  color: #666;
  line-height: 1.6;
}

#duplicate-modal .modal-icon,
#domain-owned-modal .modal-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  display: block;
}

#duplicate-modal .domain-name,
#domain-owned-modal .domain-name {
  color: var(--primary);
  font-weight: 600;
}

#duplicate-modal .modal-actions,
#domain-owned-modal .modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

#duplicate-modal .modal-actions .button,
#domain-owned-modal .modal-actions .button {
  padding: 12px 24px;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid black;
  background: var(--primary);
  color: white;
  transform: translate(-2px, -2px);
  transition: transform 0.2s ease;
}

#duplicate-modal .modal-actions .button:hover,
#domain-owned-modal .modal-actions .button:hover {
  transform: translate(0, 0);
}

#duplicate-modal .modal-actions .button.secondary,
#domain-owned-modal .modal-actions .button.secondary {
  background-color: white;
  color: black;
  border: 2px solid black;
}

#duplicate-modal .modal-actions .button.secondary:hover,
#domain-owned-modal .modal-actions .button.secondary:hover {
  background-color: #f0f0f0;
}

.modal-overlay .modal-content h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: #333;
}

.modal-overlay .modal-content p {
  margin-bottom: 30px;
  color: #666;
  line-height: 1.6;
}

.modal-overlay .modal-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  display: block;
}

.modal-overlay .domain-name {
  color: var(--primary);
  font-weight: 600;
}

.modal-overlay .modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.modal-overlay .modal-actions .button {
  padding: 12px 24px;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid black;
  background: var(--primary);
  color: white;
  transform: translate(-2px, -2px);
  transition: transform 0.2s ease;
}

.modal-overlay .modal-actions .button:hover {
  transform: translate(0, 0);
}

.modal-overlay .modal-actions .button.secondary {
  background-color: white;
  color: black;
  border: 2px solid black;
}

.modal-overlay .modal-actions .button.secondary:hover {
  background-color: #f0f0f0;
}

.modal-overlay .modal-actions .button.delete-btn {
  background-color: #ef4444;
  color: white;
}

.modal-overlay .modal-actions .button.delete-btn:hover {
  background-color: #dc2626;
}

.modal-overlay .warning-text {
  color: #ef4444;
  font-weight: 600;
  margin-top: 10px;
}

/* Branding Change Modal - Similar to duplicate modal */
#branding-change-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#branding-change-modal.visible {
  opacity: 1;
  visibility: visible;
}

#branding-change-modal .modal-content {
  background-color: #fff;
  padding: 30px;
  border: 4px solid black;
  width: 90%;
  max-width: 600px;
  text-align: left;
  transform: scale(0.95) translate(-4px, -4px);
  transition: transform 0.3s ease;
  position: relative;
}

#branding-change-modal .modal-content::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 100%;
  height: 100%;
  background: var(--bg-json);
  z-index: -1;
}

#branding-change-modal.visible .modal-content {
  transform: scale(1) translate(-4px, -4px);
}

#branding-change-modal .modal-content h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: #333;
  text-align: center;
}

#branding-change-modal .modal-content p {
  margin-bottom: 20px;
  color: #666;
  line-height: 1.6;
  text-align: center;
}

#branding-change-modal .brand-name {
  color: var(--primary);
  font-weight: 600;
}

.branding-changes-preview {
  margin: 20px 0 25px 0;
  padding: 15px;
  background: white;
  border: 2px solid black;
  position: relative;
}

.branding-changes-preview::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 100%;
  height: 100%;
  background: var(--secondary-yellow);
  z-index: -1;
}

.branding-changes-preview h4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: #333;
}

.changes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.branding-change-item {
  padding: 10px;
  background: white;
  border: 1px solid #333;
  margin-bottom: 8px;
}

.branding-change-item strong {
  display: block;
  margin-bottom: 6px;
  color: #495057;
  font-size: 0.9rem;
}



.change-values {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: monospace;
  font-size: 0.85rem;
}

.old-value {
  color: #dc3545;
  background: #f8d7da;
  padding: 2px 6px;
  border-radius: 3px;
  flex: 1;
  word-break: break-all;
}

.new-value {
  color: #155724;
  background: #d4edda;
  padding: 2px 6px;
  border-radius: 3px;
  flex: 1;
  word-break: break-all;
}

.arrow {
  color: #6c757d;
  font-weight: bold;
  font-size: 1rem;
  flex-shrink: 0;
}

#branding-change-modal .modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
}

#branding-change-modal .primary-button,
#branding-change-modal .secondary-button {
  padding: 12px 24px;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid black;
  transform: translate(-2px, -2px);
  transition: transform 0.2s ease;
}

#branding-change-modal .primary-button {
  background: var(--primary);
  color: white;
}

#branding-change-modal .secondary-button {
  background-color: white;
  color: black;
}

#branding-change-modal .primary-button:hover,
#branding-change-modal .secondary-button:hover {
  transform: translate(0, 0);
}

#branding-change-modal .secondary-button:hover {
  background-color: #f0f0f0;
}

.modal-note {
  text-align: center;
  margin-top: 15px;
}

.modal-note small {
  color: #6c757d;
  font-style: italic;
  font-size: 0.85rem;
}

/* Responsive styles for branding modal */
@media (max-width: 768px) {
  #branding-change-modal .modal-content {
    width: 95%;
    padding: 20px;
  }
  
  #branding-change-modal .modal-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  #branding-change-modal .primary-button,
  #branding-change-modal .secondary-button {
    width: 100%;
  }
  
  .change-values {
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
  }
  
  .arrow {
    align-self: center;
    transform: rotate(90deg);
  }
}

/* Suggestion buttons styling */
.suggestion-buttons {
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.suggestion-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.suggestion-pills {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.suggestion-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: auto;
  box-sizing: border-box;
  padding: 0.375rem 0.75rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-family: var(--font-family);
  font-size: 0.8125rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: auto;
  line-height: 1.4;
  white-space: nowrap;
  word-wrap: break-word;
  hyphens: auto;
  box-shadow: none;
}

.suggestion-pill::before {
  content: '+';
  font-weight: 600;
  font-size: 0.875rem;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.suggestion-pill:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(13, 146, 208, 0.15);
}

.suggestion-pill:hover::before {
  color: #0369a1;
}

.suggestion-pill:active {
  transform: translateY(0);
}

/* Applied suggestion feedback */
.suggestion-applied {
  background: #d4edda !important;
  border-color: #c3e6cb !important;
  color: #155724 !important;
}

.suggestion-applied::before {
  content: '✓';
  color: #155724;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .suggestion-pills {
    flex-direction: column;
    align-items: stretch;
  }
  
  .suggestion-pill {
    max-width: none;
    justify-content: center;
    text-align: center;
  }
}

/* Video Format Shapes (reusing existing render-type-pill styles) */
.format-shape {
  width: 40px;
  height: 40px;
  background: var(--bg-json);
  margin-bottom: 0.5rem;
}

.render-type-pill.active .format-shape {
  background: var(--secondary-blue);
  opacity: 0.8;
}

.format-shape.vertical-shape {
  width: 30px;
  height: 40px;
}

.format-shape.semi-vertical-shape {
  width: 32px;
  height: 40px;
}

.format-shape.square-shape {
  width: 35px;
  height: 35px;
}

.pill-platforms {
  font-size: 0.8rem;
  color: #888;
  margin: 0;
  line-height: 1.3;
}

.render-type-pill.active .pill-platforms {
  color: var(--secondary-blue);
  opacity: 0.8;
}

/* Template Select Button */
.template-select-button {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--secondary-blue);
  border: none;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  transition: all 0.15s ease;
}

.template-select-button:hover {
  background: #0a7db8;
}

.template-select-button:active {
  transform: translate(1px, 1px);
}

.template-select-button.has-selection {
  background: var(--secondary-blue);
  color: white;
}

.template-select-button.has-selection .template-select-arrow {
  color: white;
}

#template-select-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-select-arrow {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.template-select-button:hover .template-select-arrow {
  transform: translateY(1px);
}

/* Inline Action Buttons Container */
.image-actions-inline {
  margin-top: 15px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 15px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border-top: 2px solid var(--secondary-blue) !important;
  border-radius: 0 0 4px 4px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Override secondary button styling when inside inline actions */
.image-actions-inline .secondary-button {
  width: 100% !important;
  margin: 0 !important;
  padding: 12px 16px;
  font-size: 0.95rem;
  border-radius: 4px;
  transform: translate(-1px, -1px);
  transition: all 0.2s ease;
}

.image-actions-inline .secondary-button:hover:not(:disabled) {
  transform: translate(0, 0);
  background: #f8f9fa;
}

.image-actions-inline .secondary-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: translate(-1px, -1px);
}

/* Media Input Container for Upload UI */
.media-input-container {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.media-input-container textarea {
  flex: 1;
  min-height: 3.5rem;
}

.upload-media-btn {
  padding: 0.75rem 1.25rem;
  background: var(--secondary-yellow);
  color: black;
  border: 2px solid black;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transform: translate(-2px, -2px);
  transition: transform 0.2s ease;
  height: auto;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-media-btn:hover:not(:disabled) {
  transform: translate(0, 0);
}

.upload-media-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Responsive media input */
@media (max-width: 768px) {
  .media-input-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .upload-media-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
  }
}


/* Suggestion buttons styling */
.suggestion-buttons {
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.suggestion-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.suggestion-pills {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.suggestion-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: auto;
  box-sizing: border-box;
  padding: 0.375rem 0.75rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  font-family: var(--font-family);
  font-size: 0.8125rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: auto;
  line-height: 1.4;
  white-space: nowrap;
  word-wrap: break-word;
  hyphens: auto;
  box-shadow: none;
}

.suggestion-pill::before {
  content: '+';
  font-weight: 600;
  font-size: 0.875rem;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.suggestion-pill:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(13, 146, 208, 0.15);
}

.suggestion-pill:hover::before {
  color: #0369a1;
}

.suggestion-pill:active {
  transform: translateY(0);
}

/* Applied suggestion feedback */
.suggestion-applied {
  background: #d4edda !important;
  border-color: #c3e6cb !important;
  color: #155724 !important;
}

.suggestion-applied::before {
  content: '✓';
  color: #155724;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .suggestion-pills {
    flex-direction: column;
    align-items: stretch;
  }
  
  .suggestion-pill {
    max-width: none;
    justify-content: center;
    text-align: center;
  }
}

/* Video Format Shapes (reusing existing render-type-pill styles) */
.format-shape {
  width: 40px;
  height: 40px;
  background: var(--bg-json);
  margin-bottom: 0.5rem;
}

.render-type-pill.active .format-shape {
  background: var(--secondary-blue);
  opacity: 0.8;
}

.format-shape.vertical-shape {
  width: 30px;
  height: 40px;
}

.format-shape.semi-vertical-shape {
  width: 32px;
  height: 40px;
}

.format-shape.square-shape {
  width: 35px;
  height: 35px;
}

.pill-platforms {
  font-size: 0.8rem;
  color: #888;
  margin: 0;
  line-height: 1.3;
}

.render-type-pill.active .pill-platforms {
  color: var(--secondary-blue);
  opacity: 0.8;
}

/* Template Select Button */
.template-select-button {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--secondary-blue);
  border: none;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  color: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  transition: all 0.15s ease;
}

.template-select-button:hover {
  background: #0a7db8;
}

.template-select-button:active {
  transform: translate(1px, 1px);
}

.template-select-button.has-selection {
  background: var(--secondary-blue);
  color: white;
}

.template-select-button.has-selection .template-select-arrow {
  color: white;
}

#template-select-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-select-arrow {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.template-select-button:hover .template-select-arrow {
  transform: translateY(1px);
}

/* Inline Action Buttons Container */
.image-actions-inline {
  margin-top: 15px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 15px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border-top: 2px solid var(--secondary-blue) !important;
  border-radius: 0 0 4px 4px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Override secondary button styling when inside inline actions */
.image-actions-inline .secondary-button {
  width: 100% !important;
  margin: 0 !important;
  padding: 12px 16px;
  font-size: 0.95rem;
  border-radius: 4px;
  transform: translate(-1px, -1px);
  transition: all 0.2s ease;
}

.image-actions-inline .secondary-button:hover:not(:disabled) {
  transform: translate(0, 0);
  background: #f8f9fa;
}

.image-actions-inline .secondary-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: translate(-1px, -1px);
}

/* Media Input Container for Upload UI */
.media-input-container {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.media-input-container textarea {
  flex: 1;
  min-height: 3.5rem;
}

.upload-media-btn {
  padding: 0.75rem 1.25rem;
  background: var(--secondary-yellow);
  color: black;
  border: 2px solid black;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transform: translate(-2px, -2px);
  transition: transform 0.2s ease;
  height: auto;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-media-btn:hover:not(:disabled) {
  transform: translate(0, 0);
}

.upload-media-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Responsive media input */
@media (max-width: 768px) {
  .media-input-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .upload-media-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
  }
}

/* Sticky Editor Header - Contains Creating Video + Tabs */
.sticky-editor-header {
  position: sticky;
  top: -20px;
  background: rgba(250, 251, 252, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  margin-left: -24px;
  margin-right: -24px;
  margin-top: -20px;
  padding-left: 24px;
  padding-right: 24px;
  padding-top: 0.75rem;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  min-height: 90px; /* Match preview-format-selector height */
  box-sizing: border-box;
}

/* Creating Video Header */
.creating-video-header {
  padding: 0.75rem 0 0.5rem 0;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.creating-video-label {
  font-size: 0.8125rem;
  color: #94a3b8;
  font-weight: 400;
}

.creating-video-title {
  font-size: 0.9375rem;
  color: #1e293b;
  font-weight: 600;
}

/* Enhanced Editor Tabs Styling - Match format selector pills */
.editor-tabs-container {
  margin-bottom: 0;
  margin-top: 0;
  padding: 0;
}

.editor-tabs {
  display: flex;
  gap: 0.75rem;
  background: transparent;
  border-radius: 0;
  padding: 0.5rem;
  overflow-x: auto;
  min-height: auto;
}

.editor-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: white;
  border: 1.5px solid #e5e5e5;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: 'Space Grotesk', system-ui;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: auto;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
}

.editor-tab:hover {
  border-color: var(--secondary-blue);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(13, 146, 208, 0.15);
  z-index: 1;
  position: relative;
}

.editor-tab.active {
  border-color: var(--secondary-blue);
  background: rgba(13, 146, 208, 0.12);
  box-shadow: 0 2px 8px rgba(13, 146, 208, 0.2);
  color: var(--secondary-blue);
  font-weight: 600;
  transform: translateY(-1px);
}

.editor-tab.active::after {
  display: none;
}

.editor-tab .tab-icon {
  font-size: 1rem;
  opacity: 0.7;
}

.editor-tab.active .tab-icon {
  opacity: 1;
}

.tab-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.tab-label {
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0;
}

/* Video Format Pills - use existing render-type-pill styles */

/* Tab Content Styling */
.editor-tab-content {
  padding: 1.5rem 0;
  animation: fadeIn 0.3s ease-in-out;
  background: transparent;
}

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

/* Responsive Design for Tabs */
@media (max-width: 768px) {
  .editor-tabs {
    padding: 0.25rem;
  }
  
  .editor-tab {
    padding: 0.5rem 0.75rem;
    min-width: 70px;
  }
  
  .tab-icon {
    font-size: 1.1rem;
  }
  
  .tab-label {
    font-size: 0.7rem;
  }
}

/* Form Section Headers in Tabs */
.editor-tab-content .form-section h4 {
  color: #374151;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

/* Increment Control Styles - for playback rate and other numeric controls */
.control-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  justify-content: flex-start;
}

.control-content.horizontal {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}

.control-content.vertical {
  flex-direction: column;
  align-items: stretch;
}

.increment-control {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: white;
  border: 1px solid #ddd;
  padding: 0.5rem;
  border-radius: 4px;
}

.increment-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  background: white;
  color: #333;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: var(--font-family);
  border-radius: 4px;
}

.increment-btn:hover {
  background: var(--secondary-yellow);
  border-color: #999;
  transform: translateY(-1px);
}

.increment-value {
  min-width: 60px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  color: black;
  font-family: var(--font-family);
}

.control-reset-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid #ddd;
  color: #666;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}

.control-reset-btn:hover {
  background: #f5f5f5;
  border-color: #999;
  color: #333;
}

/* Crisp chatbox position override - force to bottom left */
#crisp-chatbox-button,
[id^="crisp-chatbox"],
.crisp-client [data-crisp-widget],
.crisp-client [data-crisp-widget] > * {
  right: auto !important;
  left: 20px !important;
}

.crisp-client {
  right: auto !important;
  left: 20px !important;
}

/* Target the main chatbox container */
div[id*="crisp"] {
  right: auto !important;
  left: 20px !important;
}

