
/* Color Palette:
  - Background: #f8f4ee
  - Primary (Dark Green): #264c28
  - Secondary (Light Green): #67914b
  - Component BG: #ffffff
  - Borders: #d8d1c7
*/

/* Theme & Color Palette System */
:root,
[data-theme='lexicraft'] {
  --bg-primary: #f8f4ee;
  --bg-secondary: #ffffff;
  --bg-tertiary: #fdfbf9;
  --text-primary: #264c28;
  --text-secondary: #67914b;
  --accent-primary: #264c28;
  --accent-secondary: #67914b;
  --border-color: #d8d1c7;
  --border-hover: #ab9e8d;
  --error-color: #721c24;
  --error-bg: #f8d7da;
  --text-on-accent: #ffffff;
  --accent-primary-transparent: rgba(38, 76, 40, 0.1);
}

[data-theme='monochrome'] {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #fafafa;
  --text-primary: #212121;
  --text-secondary: #757575;
  --accent-primary: #212121;
  --accent-secondary: #616161;
  --border-color: #e0e0e0;
  --border-hover: #bdbdbd;
  --error-color: #b71c1c;
  --error-bg: #ffebee;
  --text-on-accent: #ffffff;
  --accent-primary-transparent: rgba(33, 33, 33, 0.1);
}

[data-theme='parchment'] {
  --bg-primary: #fdf6e3;
  --bg-secondary: #ffffff;
  --bg-tertiary: #fefcf5;
  --text-primary: #654321;
  --text-secondary: #8b5a2b;
  --accent-primary: #d2691e;
  --accent-secondary: #8b4513;
  --border-color: #eee8d5;
  --border-hover: #cdc8b1;
  --error-color: #d32f2f;
  --error-bg: #ffcdd2;
  --text-on-accent: #ffffff;
  --accent-primary-transparent: rgba(210, 105, 30, 0.15);
}

[data-theme='veridian'] {
  --bg-primary: #f0f4f0;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8f8f8;
  --text-primary: #1e392a;
  --text-secondary: #3b6b4f;
  --accent-primary: #00796b;
  --accent-secondary: #004d40;
  --border-color: #d0d5d0;
  --border-hover: #b0b5b0;
  --error-color: #c62828;
  --error-bg: #ffcdd2;
  --text-on-accent: #ffffff;
  --accent-primary-transparent: rgba(0, 121, 107, 0.15);
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* Navigation */
.navigation {
  width: 280px;
  background: var(--bg-secondary);
  padding: 0 0 2rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  border-right: 1px solid var(--border-color);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.nav-brand {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.nav-brand h1 {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.7;
  position: relative;
  overflow: hidden;
}

.nav-brand .nav-logo {
  max-width: 180px;
  height: auto;
  transition: transform 0.3s ease;
}

.nav-brand .nav-logo:hover {
  transform: scale(1.05);
}

.nav-links {
  list-style: none;
  padding: 0;
  flex-grow: 1;
}

.nav-links li {
  margin-bottom: 0.25rem;
}

.nav-links a {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 0;
  margin: 0;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
  opacity: 1;
}

.nav-links a.active {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  transform: none;
  box-shadow: none;
  opacity: 1;
}

.nav-icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

.theme-selector {
  padding: 1rem 1.5rem;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

.theme-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.theme-selector select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
}

/* Mobile Navigation Styles */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hamburger {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-primary);
  margin: 5px 0;
  transition: all 0.3s ease-in-out;
  border-radius: 3px;
}

.mobile-menu-toggle.open .hamburger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.open .hamburger span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.open .hamburger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.mobile-nav-overlay.show {
  display: block;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem;
  background: var(--bg-primary);
}

.component {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
  max-width: 1200px;
  margin: 0 auto;
}

.component h2 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
}

/* Form Elements */
.text-area {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.mode-select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--bg-secondary);
  cursor: pointer;
  color: var(--text-primary);
}

.button {
  padding: 0.75rem 1.5rem;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: none;
  letter-spacing: normal;
}

.button:hover {
  background: var(--accent-secondary);
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.button.secondary {
  background: var(--accent-secondary);
  color: var(--text-on-accent);
}

.button.secondary:hover {
  background: var(--accent-primary);
}

.button.small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.error-message {
  background: var(--error-bg);
  color: var(--error-color);
  padding: 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  border-left: 3px solid var(--error-color);
  border: 1px solid var(--error-color);
}

.results {
  background: var(--bg-primary);
  border-radius: 6px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  border: 1px solid var(--border-color);
}

/* Enhanced Paraphraser Styles */
.enhanced-paraphraser .advanced-controls {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

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

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
}

.literary-textarea {
  font-family: 'Georgia', serif;
  line-height: 1.8;
  background: var(--bg-secondary);
}

.enhanced-results {
  border-left: 3px solid var(--accent-secondary);
  background: var(--bg-primary);
}

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

/* Grammar Checker Styles */
.grammar-checker .check-controls {
  margin-bottom: 1.5rem;
}

.grammar-results {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 2rem;
  margin-top: 1.5rem;
  border: 1px solid var(--border-color);
}

.analysis-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: center;
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.score-card {
  text-align: center;
}

.score-card h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.score-bar {
  width: 200px;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.score-fill {
  height: 100%;
  background: var(--accent-primary);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.issue-counts {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.issue-count {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.875rem;
  text-align: center;
  min-width: 80px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.issue-count.critical {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.issue-count.major {
  background: var(--accent-secondary);
  color: var(--text-on-accent);
}

.issue-count.minor {
  background: var(--text-secondary);
  color: var(--text-on-accent);
}

.issues-list {
  margin-bottom: 2rem;
}

.issue-item {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--bg-secondary);
  transition: all 0.2s ease;
}

.issue-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: none;
}

.issue-item.critical {
  border-left: 3px solid var(--accent-primary);
}

.issue-item.major {
  border-left: 3px solid var(--accent-secondary);
}

.issue-item.minor {
  border-left: 3px solid var(--text-secondary);
}

.issue-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.severity-badge {
  color: var(--text-on-accent);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  background: var(--accent-secondary);
}

.suggestion {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  border-left: 3px solid var(--accent-secondary);
  border: 1px solid var(--border-color);
}

.apply-btn {
  margin-top: 0.5rem;
  background: var(--accent-secondary);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.apply-btn:hover {
  background: var(--accent-primary);
}

.style-insights {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.insight-item {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
}

/* Character Assistant Styles */
.character-assistant .character-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.character-name-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.action-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.character-analysis {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 2rem;
  margin-top: 1.5rem;
  border: 1px solid var(--border-color);
}

.analysis-sections {
  margin-top: 1.5rem;
}

.analysis-sections > div {
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border-left: 3px solid var(--accent-primary);
  border: 1px solid var(--border-color);
}

.traits-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.trait-tag {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.875rem;
  font-weight: 500;
}

.voice-section ul {
  list-style: none;
  padding: 0;
}

.voice-section li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.voice-section li:last-child {
  border-bottom: none;
}

.inconsistency-item {
  color: var(--error-color);
  padding: 0.5rem;
  background: var(--error-bg);
  border-radius: 4px;
  margin: 0.25rem 0;
  border: 1px solid var(--error-color);
}

.character-suggestions {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 2rem;
  margin-top: 1.5rem;
  border: 1px solid var(--border-color);
}

.suggestion-item {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--bg-secondary);
  transition: all 0.2s ease;
}

.suggestion-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: none;
}

.suggestion-example {
  background: var(--bg-primary);
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  font-style: italic;
  border-left: 3px solid var(--accent-secondary);
  border: 1px solid var(--border-color);
}

/* Manuscript Manager Styles */
.manuscript-manager {
  max-width: 1400px;
}

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

.manuscript-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.stat-card {
  text-align: center;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.manuscript-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  height: 600px;
}

.chapters-sidebar {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 1.5rem;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

.add-chapter-btn {
  width: 100%;
  margin-bottom: 1rem;
  background: var(--accent-secondary);
}

.add-chapter-btn:hover {
  background: var(--accent-primary);
}

.chapters-list {
  list-style: none;
  padding: 0;
}

.chapter-item {
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
}

.chapter-item:hover {
  background: var(--border-color);
  transform: none;
}

.chapter-item.active {
  background: var(--accent-primary);
  color: var(--text-on-accent);
}

.chapter-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chapter-meta {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

.progress-indicator {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-secondary);
  transition: width 0.3s ease;
}

.editor-area {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

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

.editor-controls {
  display: flex;
  gap: 0.5rem;
}

.chapter-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  line-height: 1.7;
  background: transparent;
  color: var(--text-primary);
}

/* Scene Builder Styles */
.scene-builder {
  max-width: 1400px;
}

.scene-tabs,
.readability-tabs {
  display: flex;
  margin-bottom: 2rem;
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 0.25rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tab-btn {
  flex: 1;
  padding: 0.875rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  position: relative;
}

.tab-btn.active {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  box-shadow: 0 2px 8px rgba(38, 76, 40, 0.15);
}

.tab-btn:hover:not(.active) {
  background: var(--border-color);
  color: var(--text-primary);
}

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

.scene-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.scene-workspace {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  height: 600px;
}

.scene-editor {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.scene-textarea {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  line-height: 1.7;
  resize: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.scene-analysis-panel {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 1.5rem;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.rating-card {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.rating-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin: 0 auto 1rem;
}

.rating-number {
  font-size: 1.25rem;
}

.rating-info h4 {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.rating-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.analysis-section {
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.analysis-section h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.conflict-tag,
.technique-tag {
  display: inline-block;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  margin: 0.25rem 0.25rem 0.25rem 0;
}

.strengths-improvements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.strength-item {
  color: var(--accent-secondary);
  margin-bottom: 0.5rem;
}

.improvement-item {
  color: var(--error-color);
  margin-bottom: 0.5rem;
}

.scene-suggestions {
  margin-top: 2rem;
}

.suggestion-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.suggestion-type {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.suggestion-content p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.suggestion-example {
  background: var(--bg-primary);
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  font-style: italic;
  border-left: 3px solid var(--accent-secondary);
  border: 1px solid var(--border-color);
}

.scene-guidelines {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.scene-guidelines h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.guidelines-list {
  list-style: none;
  padding: 0;
}

.guidelines-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  position: relative;
  padding-left: 1.5rem;
}

.guidelines-list li:before {
  content: "•";
  color: var(--accent-secondary);
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 0.75rem;
}

.guidelines-list li:last-child {
  border-bottom: none;
}

.scene-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Readability Optimizer Styles */
.readability-optimizer {
  max-width: 1200px;
}

.readability-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.audience-info {
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.audience-info h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.text-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.stat-item {
  text-align: center;
  padding: 0.5rem;
}

.readability-results {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  margin-top: 2rem;
}

.readability-overview {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.score-section {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.score-circle-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.score-details {
  flex: 1;
}

.component-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.component-score {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.component-score h4 {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status.good {
  background: var(--accent-secondary);
  color: var(--text-on-accent);
}

.status.fair {
  background: #fff3cd;
  color: #856404;
}

.status.poor {
  background: var(--error-bg);
  color: var(--error-color);
}

.strengths-section,
.improvements-section {
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.strengths-section h3,
.improvements-section h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.strength-icon {
  color: var(--accent-secondary);
  font-weight: 600;
}

.improvement-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.improvement-header h4 {
  color: var(--error-color);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.improvement-content p {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.improvement-example {
  background: var(--bg-primary);
  padding: 0.5rem;
  border-radius: 4px;
  font-style: italic;
  color: var(--text-secondary);
  border-left: 3px solid var(--border-color);
}

.optimized-version {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.optimized-version h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.optimized-text {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  line-height: 1.6;
  color: var(--text-primary);
}

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

.guidelines-section {
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.guidelines-section h4 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

/* Plot Analyzer Styles */
.plot-analyzer .plot-overview {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  text-align: center;
}

.score-number {
  font-size: 1.75rem;
  font-weight: 600;
}

.score-label {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* MainEditor Styles */
.main-editor {
  max-width: 1400px;
  margin: 0 auto;
}

.main-editor h1 {
  font-size: 1.5rem;
  font-weight: 600;
  font-style: italic;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

.author-info a {
  color: var(--accent-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.author-info a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.editor-header h1 {
  color: var(--text-primary);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.5px;
  font-style: normal;
}

.compare-btn {
  padding: 0.6rem 1.2rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.compare-btn.active,
.compare-btn:hover {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border-color: var(--accent-primary);
}

.api-key-btn {
  padding: 0.6rem 1.2rem;
  background: var(--accent-secondary);
  color: var(--text-on-accent);
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.api-key-btn:hover {
  background: var(--accent-primary);
  transform: translateY(-1px);
}

.word-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  background: var(--bg-primary);
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.editor-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  margin-top: 2rem;
}

.input-section {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.main-textarea {
  width: 100%;
  min-height: 500px;
  padding: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Georgia', serif;
  line-height: 1.7;
  resize: vertical;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.main-textarea::placeholder {
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.7;
}

.frozen-words {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.frozen-words h4 {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.frozen-word {
  display: inline-block;
  background: var(--accent-secondary);
  color: var(--text-on-accent);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.frozen-word:hover {
  background: var(--accent-primary);
  transform: scale(1.05);
}

.tools-section {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  height: fit-content;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tool-group {
  margin-bottom: 2rem;
}

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

.tool-group h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.mode-buttons,
.analysis-buttons {
  display: grid;
  gap: 0.75rem;
}

.mode-btn,
.analysis-buttons button {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.mode-btn:hover,
.analysis-buttons button:hover {
  background: var(--border-color);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.mode-btn:disabled,
.analysis-buttons button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.mode-btn:disabled:hover,
.analysis-buttons button:disabled:hover {
  background: var(--bg-primary);
  transform: none;
}

.synonym-popup {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 300px;
}

.synonym-popup h4 {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.synonym-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.synonym-option {
  padding: 0.5rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.synonym-option:hover {
  background: var(--border-color);
  border-color: var(--border-hover);
}

.freeze-btn {
  width: 100%;
  padding: 0.5rem;
  background: var(--accent-secondary);
  color: var(--text-on-accent);
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.freeze-btn:hover {
  background: var(--accent-primary);
}

.results-section {
  margin-top: 2rem;
}

.compare-results {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.compare-item {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.compare-item h4 {
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.result-item {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.result-item h3 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.tone-results {
  display: grid;
  gap: 0.75rem;
}

.tone-results p {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg-primary);
}

.tone-results p:last-child {
  border-bottom: none;
}

/* Enhanced Chapter Management */
.manuscript-manager .chapter-input-section {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chapter-title-input {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.chapter-content-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: 'Georgia', serif;
  line-height: 1.6;
  resize: vertical;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.chapter-input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.chapters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.chapter-display {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.chapter-display:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

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

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

.edit-btn,
.delete-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.edit-btn {
  background: var(--accent-secondary);
  color: var(--text-on-accent);
}

.edit-btn:hover {
  background: var(--accent-primary);
}

.delete-btn {
  background: var(--error-color);
  color: var(--text-on-accent);
}

.delete-btn:hover {
  background-color: #c82333;
}

.chapter-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.status.draft {
  background: #fff3cd;
  color: #856404;
}

.status.review {
  background: #cce7ff;
  color: #004085;
}

.status.final {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.chapter-preview {
  color: var(--text-secondary);
  line-height: 1.5;
  font-style: italic;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-align: center;
}

.api-key-steps {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 6px;
  margin: 1rem 0;
}

.api-key-steps ol {
  margin: 0.5rem 0 0 1rem;
}

.input-group {
  margin: 1rem 0;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.key-input-container {
  position: relative;
}

.key-input-container input {
  width: 100%;
  padding: 0.75rem;
  padding-right: 3rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.show-key-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.security-note {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  border-left: 3px solid var(--accent-secondary);
}

.security-note p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.submit-btn {
  width: 100%;
  padding: 0.875rem;
  background: var(--accent-secondary);
  color: var(--text-on-accent);
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-btn:hover {
  background: var(--accent-primary);
  transform: translateY(-1px);
}

/* Quill Editor Styles */
.main-textarea.ql-container,
.chapter-content-input.ql-container {
  font-size: 1rem;
}

.main-textarea .ql-editor,
.chapter-content-input .ql-editor {
  font-family: 'Georgia', serif;
  line-height: 1.7;
  color: var(--text-primary);
}

.main-textarea .ql-editor {
  min-height: 420px;
}

.chapter-content-input .ql-editor {
  min-height: 200px;
}

.main-textarea .ql-toolbar,
.chapter-content-input .ql-toolbar {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-color: var(--border-color);
  background: var(--bg-tertiary);
}

.main-textarea .ql-container,
.chapter-content-input .ql-container {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border-color: var(--border-color);
}

/* Focus states for accessibility */
.button:focus,
.mode-select:focus,
.text-area:focus,
.character-name-input:focus,
.scene-textarea:focus,
.main-textarea:focus,
.chapter-title-input:focus,
.chapter-content-input:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-transparent);
}

.text-area:focus,
.mode-select:focus,
.character-name-input:focus,
.scene-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-primary-transparent);
}

/* Responsive Design Improvements */
@media (max-width: 1024px) {
  .navigation {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }

  .navigation.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .editor-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .mode-buttons,
  .analysis-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }

  .component {
    padding: 1.5rem;
  }

  .component h2 {
    font-size: 1.5rem;
  }

  .editor-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    flex-wrap: wrap;
  }

  .editor-controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .control-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .chapter-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .chapter-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .scene-tabs,
  .readability-tabs {
    flex-direction: column;
  }

  .tab-btn {
    margin-bottom: 0.25rem;
  }

  .mode-buttons,
  .analysis-buttons {
    grid-template-columns: 1fr;
  }

  .text-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .manuscript-content,
  .scene-workspace,
  .readability-results,
  .character-assistant .character-controls {
    grid-template-columns: 1fr;
  }

  .chapters-sidebar,
  .scene-analysis-panel {
    height: auto;
    max-height: 400px;
  }
}

@media (max-width: 480px) {
  .main-textarea,
  .scene-textarea {
    min-height: 300px;
    font-size: 0.9rem;
  }

  .text-stats {
    grid-template-columns: 1fr;
  }

  .stat-number {
    font-size: 1.25rem;
  }
}

/* Print Styles */
@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  .navigation,
  .editor-controls,
  .action-buttons,
  .tools-section,
  .mobile-menu-toggle {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .component {
    box-shadow: none;
    border: 1px solid var(--border-color);
  }

  .editor-container {
    grid-template-columns: 1fr;
  }
}


/* Script Breakdown Styles */
.script-breakdown {
  max-width: 1400px;
}

.script-textarea {
  min-height: 400px;
  font-family: 'Courier New', monospace;
  line-height: 1.5;
}

.script-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.script-buttons {
  display: flex;
  gap: 1rem;
}

.file-input-label {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-input-label:hover {
  background: var(--border-color);
}

.element-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.script-textarea-container {
  position: relative;
}

.tag-popup {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 300px;
}

.tag-popup h4 {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.tag-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.element-select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.tag-btn {
  padding: 0.5rem;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-btn:hover {
  background: var(--accent-secondary);
}

.breakdown-sheet-tab {
  margin-top: 1.5rem;
}

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

.breakdown-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.breakdown-category {
  background: var(--bg-primary);
  border-radius: 6px;
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.breakdown-category h4 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.no-items {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.breakdown-items {
  list-style: none;
  padding: 0;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.remove-item {
  background: none;
  border: none;
  color: var(--error-color);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
}

.ai-suggestions-tab {
  margin-top: 1.5rem;
}

.suggestions-header {
  margin-bottom: 1.5rem;
}

.suggestions-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.suggestions-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.suggestion-category {
  background: var(--bg-primary);
  border-radius: 6px;
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.suggestion-category h4 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.suggestion-items {
  list-style: none;
  padding: 0;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.suggestion-item:hover {
  background: var(--bg-secondary);
}

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

.add-item {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Shot List Manager Styles */
.shot-list-manager {
  max-width: 1400px;
}

.shot-list-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.shot-list-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.scene-input {
  width: 60px;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  margin-left: 0.5rem;
}

.shot-list-table-container {
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
}

.shot-list-table {
  width: 100%;
  border-collapse: collapse;
}

.shot-list-table th {
  position: sticky;
  top: 0;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  padding: 0.75rem;
  text-align: left;
  font-size: 0.9rem;
}

.shot-list-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.shot-row:hover {
  background: var(--bg-primary);
}

.description-cell {
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shot-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shot-icon {
  font-size: 1.2rem;
}

.action-cell {
  white-space: nowrap;
}

.storyboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.storyboard-card {
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.storyboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.storyboard-frame {
  height: 150px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.frame-representation {
  text-align: center;
}

.frame-icon {
  font-size: 3rem;
}

.frame-type {
  margin-top: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.storyboard-details {
  padding: 1rem;
}

.storyboard-shot-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.scene-shot {
  font-weight: 600;
  font-size: 0.9rem;
}

.storyboard-description {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.storyboard-technical {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.storyboard-technical span {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-primary);
  border-radius: 12px;
  color: var(--text-secondary);
}

.storyboard-actions {
  display: flex;
  justify-content: flex-end;
}

.shot-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.shot-editor {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.shot-editor h3 {
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.selected-script-segment {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.selected-script-segment h4 {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.selected-script-segment p {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.shot-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
}

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

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .breakdown-categories,
  .suggestions-categories {
    grid-template-columns: 1fr;
  }
  
  .storyboard-grid {
    grid-template-columns: 1fr;
  }
}
