:root {
  font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;

  /* Witchy Purple Rose Palette */
  --witch-purple: #2B1B3D;
  --witch-plum: #44275A;
  --witch-rose: #A8577E;
  --witch-mauve: #D4A5C7;
  --witch-lavender: #E8D5E8;
  --witch-black: #0A0009;
  --witch-silver: #C0C0C0;
  --witch-moon: #F5F5F5;
  --witch-shadow: rgba(10, 0, 9, 0.7);

  /* Theme mappings */
  --primary-color: var(--witch-rose);
  --primary-hover: var(--witch-plum);
  --secondary-color: var(--witch-mauve);
  --danger-color: #D4658E;
  --bg-color: var(--witch-black);
  --surface-color: var(--witch-purple);
  --text-color: var(--witch-moon);
  --text-secondary: var(--witch-silver);
  --border-color: var(--witch-plum);
  --shadow: 0 4px 6px -1px var(--witch-shadow), 0 2px 4px -1px var(--witch-shadow);

  color: var(--text-color);
  background-color: var(--bg-color);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 2rem;
}

.app-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.app-header p {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* Warning Banner */
.warning-banner {
  background-color: var(--witch-plum);
  color: var(--witch-lavender);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  text-align: center;
  border: 1px solid var(--witch-rose);
}

/* App Content */
.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Controls Section */
.controls-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Audio Recorder */
.audio-recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.record-button {
  font-size: 1.25rem;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  border: 2px solid var(--witch-rose);
  background-color: var(--primary-color);
  color: var(--witch-moon);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.record-button:hover {
  background-color: var(--witch-mauve);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px var(--witch-shadow);
  border-color: var(--witch-lavender);
}

.record-button.recording {
  background-color: var(--danger-color);
}

.record-button.recording:hover {
  background-color: #B94A6D;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--danger-color);
  font-weight: 500;
}

.pulse {
  width: 0.75rem;
  height: 0.75rem;
  background-color: var(--danger-color);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Recording Controls */
.recording-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background-color: var(--surface-color);
  border: 1px solid var(--witch-rose);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
}

.recording-dot {
  width: 0.75rem;
  height: 0.75rem;
  background-color: var(--danger-color);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.real-time-indicator {
  font-size: 0.875rem;
  color: var(--secondary-color);
  font-style: italic;
}

.recording-duration {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 4rem;
}

.stop-button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 2px solid var(--witch-rose);
  background-color: transparent;
  color: var(--witch-rose);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.stop-button:hover {
  background-color: var(--witch-rose);
  color: var(--witch-moon);
  box-shadow: 0 2px 4px var(--witch-shadow);
}

/* Transcribing Indicator */
.transcribing-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
}

.transcribing-indicator span {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Small loading spinner variant */
.loading-spinner.small {
  width: 1.5rem;
  height: 1.5rem;
  border-width: 2px;
  margin: 0;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
}

.primary-button,
.secondary-button {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.primary-button {
  background-color: var(--witch-mauve);
  color: var(--witch-purple);
  font-weight: 600;
}

.primary-button:hover:not(:disabled) {
  background-color: var(--witch-rose);
  color: var(--witch-moon);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--witch-shadow);
}

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

.secondary-button {
  background-color: transparent;
  color: var(--witch-lavender);
  border: 1px solid var(--witch-plum);
}

.secondary-button:hover {
  background-color: var(--witch-plum);
  color: var(--witch-moon);
  border-color: var(--witch-rose);
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  flex: 1;
}

@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* Transcript Display */
.transcript-display,
.summary-display {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  max-height: 600px;
  box-shadow: var(--shadow);
}

.transcript-display h2,
.summary-display h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.transcript-segments,
.summary-content {
  flex: 1;
  overflow-y: auto;
}

.empty-state {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}

.segment {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.segment:last-child {
  border-bottom: none;
}

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

.speaker {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--witch-mauve);
}

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

.segment-text {
  line-height: 1.6;
}

/* Summary Display */
.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.download-button {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid var(--witch-plum);
  background-color: transparent;
  color: var(--witch-silver);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.download-button:hover {
  background-color: var(--witch-plum);
  color: var(--witch-moon);
}

.summary-text {
  white-space: pre-wrap;
  line-height: 1.6;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--witch-plum);
  border-top-color: var(--witch-rose);
  border-right-color: var(--witch-mauve);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Backend Logs */
.logs-toggle-button {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background-color: var(--surface-color);
  color: var(--text-color);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
  z-index: 100;
}

.logs-toggle-button:hover {
  background-color: var(--border-color);
}

.backend-logs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 300px;
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 0 -2px 10px var(--witch-shadow);
}

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

.logs-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
}

.logs-close-button {
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border-color);
  background-color: var(--surface-color);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.logs-close-button:hover {
  background-color: var(--border-color);
}

.logs-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.75rem;
  background-color: var(--witch-black);
  color: var(--witch-silver);
}

.logs-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}

.log-line {
  margin: 0;
  padding: 0.125rem 0;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.4;
}

/* Setup Screen */
.setup-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.setup-content {
  text-align: center;
  max-width: 500px;
  margin-bottom: 2rem;
}

.setup-content h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.setup-message {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.setup-info {
  text-align: left;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.setup-info p {
  margin-bottom: 1rem;
}

.setup-info ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.setup-info li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.setup-note {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
}

.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.error-message {
  color: var(--danger-color);
  background-color: rgba(212, 101, 142, 0.1);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--danger-color);
  max-width: 400px;
  word-break: break-word;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

/* Unified Witchy Purple Rose Theme - No Dark/Light Modes */

/* New layout styles */
.app-layout {
  display: flex;
  flex: 1;
  gap: 2rem;
  min-height: 0;
}

.transcripts-list {
  width: 300px;
  background-color: var(--surface-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  overflow-y: auto;
}

.transcripts-list h3 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

.no-transcripts {
  color: var(--text-secondary);
  font-style: italic;
}

.transcript-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.transcript-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--witch-purple);
  border: 1px solid var(--border-color);
}

.transcript-content {
  flex: 1;
  padding-right: 0.5rem;
}

.transcript-item:hover {
  background-color: var(--witch-plum);
  border-color: var(--witch-rose);
}

.transcript-item.selected {
  background-color: var(--witch-rose);
  color: var(--witch-moon);
  border-color: var(--witch-mauve);
}

.transcript-item.selected .transcript-time {
  color: var(--witch-moon);
}

.transcript-item.selected .transcript-status {
  color: var(--witch-lavender);
}

.transcript-title {
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.transcript-time {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.transcript-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.transcript-item .delete-button {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.7;
}

.transcript-item .delete-button:hover {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: white;
  opacity: 1;
}

.transcript-item.selected .delete-button {
  border-color: var(--witch-lavender);
  color: var(--witch-moon);
}

.transcript-item.selected .delete-button:hover {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-width: 0;
}

.transcript-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.transcript-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.transcript-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* Summary display improvements */
.summary-text {
  white-space: pre-wrap;
  line-height: 1.6;
}

.summary-text strong {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  max-width: 300px;
  margin: 1rem auto;
}

.progress-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(232, 213, 232, 0.2) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

/* Transcribing indicator update */
.transcribing-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
}
