.script-view-container {
  max-width: 800px;
  margin: 2rem auto 0 auto;
  padding: 2rem;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.script-header {
  text-align: center;
  margin-bottom: 3rem;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 1rem;
}

.script-header h1 {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.script-meta {
  color: #666;
  font-size: 1rem;
}

.script-content {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 1rem;
  padding-top: 2rem;
}

.scene-section {
  margin-bottom: 2rem;
  page-break-inside: avoid;
}

.script-scene-header {
  display: flex;
  padding-left: 3rem; 
  margin-bottom: 1rem;
}

.slug-line {
  font-size: 1.125rem;
  font-weight: bold;
  margin: 0;
  color: #333;
  text-transform: uppercase;
}

.script-scene-number {
  /* display: inline-block; */
  margin-left: auto;
  color: #AAA;
  /*  background-color: #9ca3af;
  padding: 0.25rem;
  border-radius: 0.25rem; */
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Action sections - full width */
.action-section {
  padding: 0 3rem;
  /* margin-bottom: 1rem; */
}

.action-line {
  font-style: italic;
  color: #333;
  margin: 0;
  line-height: 1.6;
}

/* Direction sections - centered */
.direction-section {
  padding: 1rem 20%;
  margin-bottom: 1rem;
  text-align: center;
}

.direction-line {
  font-style: italic;
  color: #666;
  margin: 0;
}

/* Dialogue sections - centered column */
.dialogue-section {
  padding: 0 20% 1rem 20%;
  color: var(--color-black);
  margin-bottom: 1rem;
}

/* Transition sections - right aligned */
.transition-section {
  padding: 1rem 2rem;
  margin-bottom: 1rem;
  text-align: right;
}

.character-name {
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

/* .dialogue-block {
  margin-bottom: 1.5rem;
} */

.speaker {
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.dialogue-text {
  max-width: 500px;
  margin: 0 auto;
  text-align: left;
  line-height: 1.6;
}

.transition-line {
  text-align: right;
  font-weight: bold;
  margin: 2rem 0;
  color: #333;
}

.script-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 2px solid #e0e0e0;
  text-align: center;
  color: #666;
}

.script-stats {
  font-size: 0.9rem;
}

/* Custom scrollbar for the script content */
.script-content::-webkit-scrollbar {
  width: 8px;
}

.script-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.script-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

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

/* Audio Button Styles */
.btn-audio-play,
.btn-audio-generate {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #007bff;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.75rem;
  line-height: 1;
  position: relative;
}

/* Hide unavailable message for generate buttons */
.btn-audio-generate .audio-unavailable-message {
  display: none;
}

.btn-audio-play i,
.btn-audio-generate i {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  line-height: 1;
  margin: 0;
  padding: 0;
}

.btn-audio-play:hover,
.btn-audio-generate:hover {
  background-color: #0056b3;
  transform: scale(1.1);
}

.btn-audio-generate {
  background-color: #6c757d;
}

.btn-audio-generate:hover {
  background-color: #5a6268;
}

/* Playing state */
.btn-audio-play.playing {
  background-color: #28a745;
}

.btn-audio-play.playing:hover {
  background-color: #218838;
}

/* Word highlighting for lip-sync */
.dialogue-text .word-highlight {
  background-color: #ffeaa7;
  padding: 0 2px;
  border-radius: 2px;
  transition: all 0.1s;
}

.dialogue-text .word-active {
  background-color: #fdcb6e;
  font-weight: 500;
}

/* Scripts Index Page Styles */
.scripts-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 4rem;
  margin-top: var(--subnav-min-height);
}

.scripts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.scripts-header h1 {
  margin: 0;
  color: var(--color-text);
}

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

.scripts-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.script-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.script-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-light-gray);
  border-bottom: 1px solid var(--border-color);
}

.script-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: var(--color-text);
}

.script-badges {
  display: flex;
  gap: 0.5rem;
}

.script-actions {
  display: flex;
  gap: 0.5rem;
}

.script-card-body {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.script-stats {
  display: flex;
  gap: 1.5rem;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.script-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.script-stats i {
  font-size: 1rem;
}

.script-status {
  text-align: right;
}

.script-meta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}


/* Dark theme adjustments */
[data-theme="dark"] .script-card {
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .script-card-header {
  background: #333;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .scripts-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .badge-outline {
  border-color: rgba(255, 255, 255, 0.2);
}

/* Script View Dark Theme */
[data-theme="dark"] .script-view-container {
  background-color: #1e1e1e;
  color: var(--color-text-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .script-header {
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] .script-header h1 {
  color: var(--color-text-primary);
}

[data-theme="dark"] .script-meta {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .slug-line {
  color: var(--color-text-primary);
}

[data-theme="dark"] .script-scene-number {
  color: var(--color-text-muted);
}

[data-theme="dark"] .action-line {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .direction-line {
  color: var(--color-text-muted);
}

[data-theme="dark"] .dialogue-section {
  color: var(--color-text-primary);
}

[data-theme="dark"] .dialogue-text {
  color: var(--color-text-primary);
}

[data-theme="dark"] .speaker {
  color: var(--color-text-primary);
}

[data-theme="dark"] .transition-line {
  color: var(--color-text-primary);
}

[data-theme="dark"] .script-footer {
  border-top-color: var(--border-color);
  color: var(--color-text-secondary);
}

[data-theme="dark"] .script-content::-webkit-scrollbar-track {
  background: var(--bg-light-gray);
}

[data-theme="dark"] .script-content::-webkit-scrollbar-thumb {
  background: var(--color-text-muted);
}

[data-theme="dark"] .script-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}


/* Responsive */
@media (max-width: 768px) {
  .scripts-container {
    padding: 1.5rem;
  }
  
  .scripts-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .script-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .script-card-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .script-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .script-status {
    text-align: left;
    width: 100%;
  }
}