* {
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  margin: 0;
  padding: 0;
  background-color: #121212;
  color: #f1f1f1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

main {
  width: min(1200px, 100%);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.controls {
  background-color: #1e1e1e;
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.controls h1 {
  flex-basis: 100%;
  margin: 0;
  font-size: 1.6rem;
  color: #4fc3f7;
}

.input-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-row input,
.input-row select {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #191919;
  color: #f1f1f1;
  font-size: 0.95rem;
}

.input-row select {
  cursor: pointer;
}

.input-row select:focus {
  outline: none;
  border-color: #4fc3f7;
}

.input-row label {
  color: #ddd;
  font-size: 0.9rem;
  font-weight: 500;
}

.button-row {
  display: flex;
  gap: 0.75rem;
}

.button-row button {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: #4fc3f7;
  color: #082538;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.button-row button:disabled {
  background: #555;
  color: #aaa;
  cursor: not-allowed;
}

.button-row button:hover:not(:disabled) {
  background: #81d4fa;
}

.status {
  flex-basis: 100%;
  margin: 0;
  color: #ddd;
}

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

.video-tile {
  background: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  min-height: 180px;
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-tile .label {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 0.35rem 0.6rem;
  background: rgba(0, 0, 0, 0.6);
  font-size: 0.9rem;
}

.transcript-analysis-container {
  display: flex;
  gap: 1.5rem;
}

.analysis-results {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1rem;
  min-height: 160px;
}

.analysis-results h2 {
  margin-top: 0;
  color: #4fc3f7;
}

.analysis-results-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.analysis-result-item {
  padding: 0.8rem;
  background: #191919;
  border-radius: 6px;
  border: 1px solid #333;
  color: #f1f1f1;
  word-wrap: break-word;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Markdown styling within analysis results */
.analysis-result-item h1,
.analysis-result-item h2,
.analysis-result-item h3,
.analysis-result-item h4,
.analysis-result-item h5,
.analysis-result-item h6 {
  color: #4fc3f7;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
  font-weight: 600;
}

.analysis-result-item h1 {
  font-size: 1.5em;
  border-bottom: 2px solid #333;
  padding-bottom: 0.3em;
}

.analysis-result-item h2 {
  font-size: 1.3em;
  border-bottom: 1px solid #333;
  padding-bottom: 0.3em;
}

.analysis-result-item h3 {
  font-size: 1.1em;
}

.analysis-result-item p {
  margin: 0.8em 0;
  line-height: 1.6;
}

.analysis-result-item ul,
.analysis-result-item ol {
  margin: 0.8em 0;
  padding-left: 1.5em;
}

.analysis-result-item li {
  margin: 0.4em 0;
  line-height: 1.6;
}

.analysis-result-item strong {
  color: #81d4fa;
  font-weight: 600;
}

.analysis-result-item em {
  font-style: italic;
  color: #ddd;
}

.analysis-result-item code {
  background: #0d0d0d;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #81d4fa;
}

.analysis-result-item pre {
  background: #0d0d0d;
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid #333;
  margin: 1em 0;
}

.analysis-result-item pre code {
  background: transparent;
  padding: 0;
  color: #f1f1f1;
}

.analysis-result-item blockquote {
  border-left: 4px solid #4fc3f7;
  padding-left: 1em;
  margin: 1em 0;
  color: #ccc;
  font-style: italic;
}

.analysis-result-item hr {
  border: none;
  border-top: 1px solid #333;
  margin: 1.5em 0;
}

.transcript {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1rem;
  min-height: 160px;
  flex: 1;
}

.transcript h2 {
  margin-top: 0;
  color: #4fc3f7;
}

.analysis-instructions {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1rem;
  min-height: 160px;
  flex: 1;
}

.analysis-instructions h2 {
  margin-top: 0;
  color: #4fc3f7;
}

.analysis-instructions-textarea {
  width: 100%;
  min-height: 200px;
  padding: 0.8rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #191919;
  color: #f1f1f1;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.95rem;
  resize: vertical;
}

.analysis-instructions-textarea:focus {
  outline: none;
  border-color: #4fc3f7;
}

.analysis-instructions-textarea::placeholder {
  color: #aaa;
}

.analyze-button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: #4fc3f7;
  color: #082538;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
}

.analyze-button:hover {
  background: #81d4fa;
}

.analyze-button:disabled {
  background: #555;
  color: #aaa;
  cursor: not-allowed;
}

.transcript-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.transcript-line {
  display: flex;
  gap: 0.5rem;
}

.transcript-line .timestamp {
  color: #888;
  font-size: 0.85rem;
  font-family: monospace;
  min-width: 80px;
  max-width: 100px;
}

.transcript-line .speaker {
  color: #81d4fa;
  font-weight: 600;
}

.hint {
  color: #aaa;
  margin: 0;
}

.transcript-actions {
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.paste-transcript-button,
.clear-transcript-button {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  background: #555;
  color: #f1f1f1;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.paste-transcript-button:hover,
.clear-transcript-button:hover {
  background: #666;
}

.paste-transcript-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.paste-transcript-dialog {
  background: #1e1e1e;
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.paste-transcript-dialog h3 {
  margin: 0;
  color: #4fc3f7;
}

.paste-transcript-textarea {
  width: 100%;
  min-height: 300px;
  padding: 0.8rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #191919;
  color: #f1f1f1;
  font-family: monospace;
  font-size: 0.9rem;
  resize: vertical;
}

.paste-transcript-textarea:focus {
  outline: none;
  border-color: #4fc3f7;
}

.paste-transcript-textarea::placeholder {
  color: #666;
}

.paste-transcript-dialog button {
  transition: background 0.2s ease;
}

.paste-transcript-dialog button:hover {
  opacity: 0.9;
}

.paste-transcript-dialog button:first-of-type:hover {
  background: #666 !important;
}

.paste-transcript-dialog button:last-of-type:hover {
  background: #81d4fa !important;
}

@media (max-width: 600px) {
  .button-row {
    width: 100%;
    flex-direction: column;
  }

  .button-row button {
    width: 100%;
  }

  .transcript-analysis-container {
    flex-direction: column;
  }
}


