/* -------------------- GLOBAL STYLES -------------------- */
body {
  font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: linear-gradient(to bottom right, #ffffff, #f7fafd);
  margin: 0;
  padding: 0;
  color: #2c3e50;
}

h1, h2, h3 {
  font-weight: 600;
  color: #ff8c2d; /* Changed to darker orange */
}

a {
  color: #ff8c2d;
  text-decoration: none;
}

/* -------------------- APP CONTAINER -------------------- */

.app-header {
  padding-right: 20px;
  padding-left: 20px;
}

/* -------------------- HEADER -------------------- */
h1 {
  text-align: center;
  margin-top: 10px; /* Reduced from 40px */
  margin-bottom: 10px; /* Reduced from 40px */
}

.main-content {
  padding-right: 20px;
  padding-left: 20px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px; /* Reduced from 20px */
  border-bottom: 1px solid #e0e0e0;
}

.app-header h1 {
  font-size: 1.4em; /* Reduced from 1.8em */
  color: #ff8c2d;
  margin: 0;
}

.deposition-status {
  background-color: #fff5eb;
  color: #ff8c2d;
  padding: 4px 8px; /* Reduced from 6px 12px */
  border-radius: 20px;
  font-size: 0.8em; /* Reduced from 0.85em */
}

/* -------------------- FORM & BUTTONS -------------------- */
.schedule-section {
  text-align: center;
  margin: auto;
}

#scheduleForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

#scheduleForm input,
#scheduleForm button {
  padding: 12px;
  font-size: 1em;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
}

#scheduleForm button {
  background-color: #ff8c2d;
  color: #fff;
  border: none;
  transition: background-color 0.2s ease;
}

#scheduleForm button:hover {
  background-color: #da8540;
}

/* -------------------- LIVE SECTION -------------------- */
.live-section {
  display: flex;
  flex-direction: column;
  /* margin-top: 13px; */
}

/* -------------------- BOT CONTROLS -------------------- */
.bot-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px; /* Reduced from 15px */
  margin-bottom: 12px; /* Reduced from 20px */
  padding: 10px; /* Reduced from 15px */
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.bot-buttons{
  display: flex;
  justify-content: center;
  align-items: stretch; /* equal button heights across primary/secondary */
  gap: 8px; /* Increased from 4px for better button spacing */
  flex-wrap: wrap;
}

/* Inside the bot controls row, align the secondary "Live Transcript Page"
   button to the same height as the primary buttons next to it (drop the
   results-area margin-top and match the primary button padding). */
.bot-buttons .btn-secondary {
  margin-top: 0;
  padding: 10px 20px;
}

.btn-primary {
  background-color: #ff8c2d;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #da8540;
}

.btn-primary:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 12px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

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

.bot-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  color: #495057;
}

.bot-status.active {
  color: #ff8c2d
}

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

/* Enhanced bot status styles */
.bot-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.bot-status.joining {
  background-color: #e3f2fd;
  color: #1976d2;
  border: 1px solid #bbdefb;
}

.bot-status.waiting {
  background-color: #fff3e0;
  color: #f57c00;
  border: 1px solid #ffcc02;
}

.bot-status.connected {
  background-color: #fff8e1;
  color: #f9a825;
  border: 1px solid #ffeb3b;
}

.bot-status.recording {
  background-color: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #4caf50;
}

.bot-status.permission_denied {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #f44336;
}

.bot-status.call_ended {
  background-color: #f5f5f5;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

.bot-status.done {
  background-color: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #9c27b0;
}

.bot-status.error,
.bot-status.fatal {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #f44336;
}

/* Pulsing animation for recording status */
.status-indicator.pulsing {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Button states */
.btn-primary.joining {
  background-color: #007bff;
  opacity: 0.7;
}

.btn-primary.recording {
  background-color: #28a745;
}

.btn-primary.error {
  background-color: #dc3545;
}

.transcript-container,
.insights-container {
  background-color: #fdfefe;
  border-radius: 10px;
  overflow-y: auto;
  padding: 8px; /* Added small padding */
}

#liveInsights,
#liveTranscript {
  min-height: 120px; /* Increased from 100px */
  max-height: 85vh; /* Increased from 80vh */
  overflow-y: auto;       
}

.key-container-title {
  margin-top: 12px; /* Reduced from 20px */
  margin-bottom: 8px; /* Added */
  color: #ff8c2d;
  font-size: 1.1em; /* Slightly larger */
}

/* Real-time Transcript header with a live status pill (mirrors the browser
   Live Transcript page: Connected / Paused / Reconnecting / Ended). */
.transcript-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.transcript-title-row .key-container-title {
  margin: 0;
}

.transcript-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78em;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background-color: #f5f5f5;
  color: #6c757d;
  border: 1px solid #e0e0e0;
  white-space: nowrap;
}

.transcript-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.transcript-status.connected {
  background-color: #e8f5e8;
  color: #2e7d32;
  border-color: #4caf50;
}

.transcript-status.connecting {
  background-color: #fff8e1;
  color: #f9a825;
  border-color: #ffeb3b;
}

.transcript-status.paused {
  background-color: #fff3e0;
  color: #f57c00;
  border-color: #ffcc02;
}

.transcript-status.disconnected,
.transcript-status.ended {
  background-color: #ffebee;
  color: #c62828;
  border-color: #f44336;
}

.transcript {
  font-size: 0.9em;
  line-height: 1.4;
}

.insight-item {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9em;
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.controls button {
  flex: 1;
  padding: 10px;
  background-color: #f2f4f8;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease;
}

.controls button:hover {
  background-color: #e4eaf3;
}

/* -------------------- BROWSER WARNING -------------------- */
.section-browser-warning {
  max-width: 600px;
  margin: 60px auto;
  padding: 40px;
  background-color: #ffffff;
  text-align: center;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.section-browser-warning h2 {
  color: #ff8c2d;
  margin-bottom: 10px;
}

.section-browser-warning p {
  font-size: 1em;
  color: #333;
  margin-bottom: 20px;
}

.btn-download {
  background-color: #ff8c2d;
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 500;
  display: inline-block;
  transition: background 0.2s ease;
}

.btn-download:hover {
  background-color: #da8540;
}


/* -------------------- UTILITIES -------------------- */
.hidden {
  display: none !important;
}


/* -------------------- REAUTH CONTAINER -------------------- */
.reauth-container {
  max-width: 600px;
  margin: 100px auto;
  padding: 40px 30px;
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.reauth-container h2 {
  color: #ff8c2d;
  margin-bottom: 20px;
}

.reauth-container p {
  color: #2c3e50;
  font-size: 1em;
  margin-bottom: 30px;
}

.btn-reconnect {
  background-color: #ff8c2d;
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 500;
  display: inline-block;
  text-decoration: none;
  transition: background 0.2s ease;
}

.btn-reconnect:hover {
  background-color: #da8540;
}

/* -------------------- LIVE TRANSCRIPT CONTAINER -------------------- */

.transcript-item {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: white;
  border-radius: 8px;
  border-left: 3px solid #42526E26;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.transcript-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12px;
}

.transcript-participant {
  font-weight: 600;
  color: #42526E;
}

.transcript-timestamp,
.transcript-index {
  color: #718096;
}

.transcript-words {
  color: #4a5568;
  line-height: 1.4;
}

/* -------------------- TRANSCRIPT PAGES -------------------- */
.transcript-page {
  margin-bottom: 24px;
  padding: 8px;
  border-radius: 12px;
  background-color: #f8f9fb;
  border: 1px solid #dce4ec;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.transcript-page-header {
  font-size: 10px;
  font-weight: 600;
  color: #42526E;
  background-color: #42526E26; /* rgba(66, 82, 110, 0.15) */
  border-radius: 3px;
  padding: 3px 6px;
  margin-bottom: 16px;
  display: inline-block;
  font-family: 'Inter', sans-serif;
}

/* -------------------- START MEETING SECTION -------------------- */
.start-meeting-section {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.btn-start-meeting {
  background-color: #ff8c2d;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

.btn-start-meeting:hover {
  background-color: #fff5eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-start-meeting:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.start-meeting-note {
  color: #6c757d;
  font-size: 0.9em;
  margin: 0;
  font-style: italic;
}

/* -------------------- FORM STYLING -------------------- */
.settings-section {
  background-color: #f8f9fa;
  border-radius: 12px;
  padding: 12px; /* Reduced from 16px */
  margin: 8px 0; /* Reduced from 10px 0 */
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-section h3 {
  margin-top: 0;
  margin-bottom: 12px; /* Reduced from 20px */
  color: #ff8c2d;
  font-size: 1.1em; /* Reduced from 1.3em */
  border-bottom: 2px solid #ff8c2d;
  padding-bottom: 6px; /* Reduced from 8px */
}

.form-row {
  display: flex;
  flex-direction: row;
  margin-bottom: 8px; /* Increased from 4px */
  gap: 8px; /* Increased from 4px */
  align-items: center;
}

.form-row label {
  font-weight: 600;
  color: #495057; /* Changed from #ff8c2d for better readability */
  font-size: 0.85em; /* Increased from 0.6em */
  width: 100px; /* Reduced from 128px */
  flex-shrink: 0;
  text-align: right;
  padding-right: 8px;
}

.form-row input,
.form-row select {
  padding: 6px 8px; /* Increased from 2px */
  border: 2px solid #e9ecef;
  border-radius: 6px; /* Reduced from 8px */
  font-size: 0.9em; /* Increased from 0.8em */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: #fff;
  flex: 1;
  min-width: 0;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #ff8c2d;
  box-shadow: 0 0 0 2px rgba(255, 140, 45, 0.1); /* Reduced from 3px */
}

.form-row input::placeholder {
  color: #adb5bd;
  font-style: italic;
  font-size: 0.85em; /* Slightly smaller for placeholders */
}

#savePrefsBtn {
  margin-top: 8px; /* Reduced from 16px */
  width: 100%;
  padding: 8px 12px; /* Reduced from 14px */
  font-size: 0.95em; /* Reduced from 1.1em */
  font-weight: 600;
  background-color: #ff8c2d;
  color: white;
  border: none;
  border-radius: 6px; /* Reduced from 8px */
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

#savePrefsBtn:hover {
  background-color: #da8540;
  transform: translateY(-1px);
}

#savePrefsBtn:active {
  transform: translateY(0);
}

.save-status {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9em;
  text-align: center;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  color: #495057;
}

/* -------------------- SUBMITTED RESULTS -------------------- */
.submitted-results {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}

.submitted-results h4 {
  margin-top: 0;
  margin-bottom: 16px;
  color: #155724;
  font-size: 1.1em;
}

.result-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #c3e6cb;
}

.result-item:last-of-type {
  border-bottom: none;
  margin-bottom: 12px;
}

.result-item label {
  font-weight: 600;
  color: #155724;
  font-size: 0.9em;
}

.result-item span {
  color: #495057;
  font-size: 0.9em;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

/* -------------------- READONLY FIELD STYLING -------------------- */
.readonly-field {
  background-color: #f8f9fa !important;
  color: #6c757d !important;
  cursor: not-allowed !important;
  border-color: #ced4da !important;
  font-family: 'Courier New', monospace !important;
  font-size: 0.85em !important;
}

.readonly-field:focus {
  border-color: #ced4da !important;
  box-shadow: none !important;
}

/* -------------------- BOT ID DISPLAY -------------------- */
.bot-id-container {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    font-size: 12px;
    color: #666;
}

.bot-id-container.hidden {
    display: none;
}

.bot-id-label {
    font-weight: 600;
    color: #333;
}

#botIdText {
    font-family: 'Courier New', monospace;
    background-color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #ccc;
    margin-left: 4px;
}