body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  color: #333;
  line-height: 1.5;
  background-color: #f9fafb;
}

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

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }
}

h1,
h2 {
  color: #1a202c;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-top: 0;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2rem;
}

/* Controls */
#controls {
  margin: 1.5rem 0;
  display: flex;
  gap: 1rem;
  align-items: center;
}

label {
  font-weight: 500;
}

select {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background-color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  min-width: 200px;
  font-size: 0.95rem;
}

/* Buttons */
button {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  margin-right: 0.5rem;
  background-color: #f3f4f6;
  color: #4b5563;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

button:hover {
  background-color: #e5e7eb;
}

#recordBtn {
  background-color: #ef4444;
  color: white;
}

#recordBtn:hover {
  background-color: #dc2626;
}

#stopBtn {
  background-color: #4b5563;
  color: white;
}

#stopBtn:hover {
  background-color: #374151;
}

/* Recording Timer */
#recordingTimer {
  display: flex; /* Use flexbox for alignment */
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  padding: 0.5rem;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ef4444;
  background-color: #fef2f2;
  border-radius: 6px;
  min-width: 60px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative; /* For positioning children */
  overflow: hidden; /* Hide overflowing content */
}

#recordingTimer #audioVisualizer {
  position: absolute; /* Position the audio visualizer relative to the timer */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  border-radius: 3px; /* Slightly rounded corners for the canvas */
}

@media (max-width: 768px) {
  #recordingTimer {
    font-size: 0.95rem;
    padding: 0.35rem;
    min-width: 50px;
  }
}

/* Table */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 1rem 0 2rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

thead {
  background-color: #f3f4f6;
}

th {
  text-align: left;
  font-weight: 600;
  padding: 0.75rem 1rem;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
}

/* Set minimum width for the audio column (2nd column) */
th:nth-child(2),
td:nth-child(2) {
  min-width: 300px;
  width: 300px;
}

@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
  }

  th:nth-child(2),
  td:nth-child(2) {
    min-width: 200px;
    width: 200px;
  }

  th,
  td {
    padding: 0.5rem;
  }

  .copyBtn,
  .transcribeBtn,
  .deleteBtn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.5rem; /* Add vertical spacing */
    display: block; /* Ensure buttons stack vertically */
    width: 100%;
  }

  .deleteBtn {
    margin-bottom: 0; /* Remove margin from last button */
  }
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  background-color: white;
}

tr:last-child td {
  border-bottom: none;
}

/* Audio controls */
audio {
  height: 36px;
  width: 100%;
}

/* Action buttons */
.copyBtn,
.retranscribeBtn {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.retranscribeBtn {
  background-color: #f3f4f6;
  color: #4b5563;
}

.retranscribeBtn:hover {
  background-color: #e5e7eb;
}

.deleteBtn {
  background-color: #ef4444;
  color: white;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.deleteBtn:hover {
  background-color: #dc2626;
}

.copyBtn,
#modalCopy {
  background-color: #3b82f6;
  color: white;
}

.copyBtn:hover,
#modalCopy:hover {
  background-color: #2563eb;
}

.copyBtn:disabled,
#modalCopy:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

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

.clickable {
  cursor: pointer;
  color: #3b82f6;
}

.clickable:hover {
  text-decoration: underline;
}

/* Modal */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-content {
  background: white;
  padding: 1.5rem;
  width: 650px;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

#modalText {
  align-self: center;
  width: 100%;
  height: 300px;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  resize: vertical;
  margin-bottom: 1rem;
  outline: none;
}

#modalText:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.modal-actions {
  text-align: right;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

#modalSave {
  background-color: #10b981;
  color: white;
}

#modalSave:hover {
  background-color: #059669;
}

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

  #modalText {
    height: 200px;
  }

  .modal-actions {
    flex-wrap: wrap;
    justify-content: center;
  }

  .modal-actions button {
    margin: 0.25rem;
  }
}

/* Add styles for the warning banner */
.warning-banner {
  background-color: #f8d7da;
  color: #721c24;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.warning-banner p {
  margin: 0;
}

.warning-banner button {
  background-color: #721c24;
  color: white;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

.warning-banner button:hover {
  background-color: #5a171c;
}

/* Error Notification */
.error-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fef2f2; /* Light red background */
  color: #b91c1c; /* Dark red text */
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  text-align: center;
  max-width: 400px;
  width: 90%;
  border: 1px solid #ef4444; /* Red border */
}

.error-notification p {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.error-notification .error-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.error-notification button {
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.error-notification button#tryAgainBtn {
  background-color: #3b82f6; /* Blue */
  color: white;
}

.error-notification button#tryAgainBtn:hover {
  background-color: #2563eb;
}

.error-notification button#downloadAudioBtn {
  background-color: #10b981; /* Green */
  color: white;
}

.error-notification button#downloadAudioBtn:hover {
  background-color: #059669;
}

.error-notification button#dismissErrorBtn {
  background-color: #6b7280; /* Gray */
  color: white;
}

.error-notification button#dismissErrorBtn:hover {
  background-color: #4b5563;
}

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

  .error-notification p {
    font-size: 1rem;
  }

  .error-notification button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .warning-banner {
    flex-direction: column;
    padding: 0.5rem;
  }

  .warning-banner p {
    margin-bottom: 0.5rem;
    text-align: center;
  }
}

/* Tab Lock Message */
.tab-lock-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  font-size: 1.2rem;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  max-width: 90%;
  z-index: 9999;
}

.tab-lock-message h2 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #721c24;
}

.tab-lock-message p {
  margin-bottom: 15px;
}

.tab-lock-message .reload-button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: #007bff;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 15px;
}

.tab-lock-message .reload-button:hover {
  background: #0069d9;
}

/* API Key Management */
.settings-section {
  margin: 1rem 0;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  border-radius: 8px;
  background-color: #f9fafb;
}

.api-key-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.api-key-form label {
  font-weight: 500;
  flex: 0 0 auto;
}

.api-key-form input {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
}

.api-key-form input:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.api-key-save-btn {
  background-color: #10b981;
  color: white;
  padding: 0.5rem 1rem;
}

.api-key-save-btn:hover {
  background-color: #059669;
}

.api-key-success {
  color: #059669;
  font-weight: 500;
  margin-left: 0.5rem;
}

@media (max-width: 768px) {
  .api-key-form {
    flex-direction: column;
    align-items: stretch;
  }

  .api-key-form input {
    width: 100%;
  }

  .api-key-form button {
    align-self: flex-end;
  }
}

/* GitHub Corner */
.github-corner:hover .octo-arm {
  animation: octocat-wave 560ms ease-in-out;
}

@keyframes octocat-wave {
  0%,
  100% {
    transform: rotate(0);
  }
  20%,
  60% {
    transform: rotate(-25deg);
  }
  40%,
  80% {
    transform: rotate(10deg);
  }
}

@media (max-width: 500px) {
  .github-corner:hover .octo-arm {
    animation: none;
  }
  .github-corner .octo-arm {
    animation: octocat-wave 560ms ease-in-out;
  }
}
