html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Raleway', sans-serif;
}

/* Disabled button state for transcribe button */
#transcribeBtn:disabled {
  background-color: #9ca3af !important;
  cursor: not-allowed;
  opacity: 0.7;
}

#transcribeBtn:disabled:hover {
  background-color: #9ca3af !important;
}

.input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.url-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 500px;
}

.url-input-wrapper input {
  padding-right: 70px;
}

.url-input-buttons {
  position: absolute;
  right: 8px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.url-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 4px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.url-action-btn:hover {
  background: #f3f4f6;
  color: #4f46e5;
}

.url-action-btn:active {
  background: #e5e7eb;
}

.url-action-btn svg {
  width: 18px;
  height: 18px;
}

.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
  flex: 1;
  z-index: 100;
}

#thumbnail {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#thumbnail img {
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  object-fit: cover;
}

.thumbnail-img {
  width: 100%;
  border-radius: 16px;
}

.custom-h1 {
  font-size: 48px;
  font-weight: bold;
}

.button-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button-container > * {
  flex: 1;
  min-width: 0;
}

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

/* Ensure tooltip works in flex container */
.button-container .tooltip {
  display: flex;
}

.button-container .tooltip button {
  width: 100%;
}

.vertical-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar {
  z-index: 500;
}

.footer {
  flex-shrink: 0;
  margin-top: auto;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 10px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

.transcript-container {
  max-height: 500px;
  min-height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 15px;
  visibility: visible !important;
  opacity: 1 !important;
  border-radius: 8px;
  background-color: #ffffff !important;
  margin: 20px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#transcription,
#transcription.prose {
  background-color: #ffffff !important;
}

#transcription {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-family: inherit;
  color: #333;
  margin: 0;
  padding: 0;
  background-color: #ffffff !important;
}

/* Ensure prose class has white background */
#transcription.prose,
#transcription .prose {
  background-color: #ffffff !important;
}

#transcription pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  font-family: inherit;
  color: #333;
  background: none;
  border: none;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.loading-message {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.loading-message .loading {
  margin-right: 10px;
}

/* Fix loading spinner centering in transcript container */
#transcription > .flex,
#transcription.prose > .flex {
  max-width: none !important;
  width: 100% !important;
  margin: 0 auto;
}

/* Ensure transcription container doesn't have prose max-width constraints during loading */
#transcription:has(> .flex) {
  max-width: none !important;
  width: 100% !important;
}

/* Fallback for browsers without :has() support */
#transcription.prose {
  max-width: none;
  width: 100%;
}

/* Center the radial progress spinner */
#transcription .radial-progress {
  margin: 0 auto;
}

/* Center the loading text */
#transcription .loading-message-text {
  display: block;
  text-align: center;
  width: 100%;
}

.summary-container {
  max-height: 500px;
  min-height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 10px;
  display: block;
  background-color: #ffffff !important;
}

#summary-content {
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.5;
  display: block;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  overflow: visible !important;
}

/* Markdown content styling */
#summary-content .prose {
  color: #333;
  line-height: 1.6;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
}

/* Override any code block styling that might be applied */
#summary-content .prose pre {
  background-color: #2d3748 !important;
  color: #e2e8f0 !important;
  padding: 1rem !important;
  border-radius: 8px !important;
  overflow-x: auto !important;
  margin: 1rem 0 !important;
  white-space: pre-wrap !important;
  font-family: 'Courier New', monospace !important;
}

/* Ensure regular paragraphs are not treated as code */
#summary-content .prose p {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 1rem !important;
  color: #4a5568 !important;
  font-family: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
}

#summary-content .prose h1,
#summary-content .prose h2,
#summary-content .prose h3,
#summary-content .prose h4,
#summary-content .prose h5,
#summary-content .prose h6 {
  color: #1a202c;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

#summary-content .prose h1 {
  font-size: 1.875rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

#summary-content .prose h2 {
  font-size: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.25rem;
}

#summary-content .prose h3 {
  font-size: 1.25rem;
}

#summary-content .prose p {
  margin-bottom: 1rem;
  color: #4a5568;
}

#summary-content .prose ul,
#summary-content .prose ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

#summary-content .prose li {
  margin-bottom: 0.5rem;
  color: #4a5568;
}

#summary-content .prose strong {
  font-weight: 600;
  color: #2d3748;
}

#summary-content .prose em {
  font-style: italic;
  color: #4a5568;
}

#summary-content .prose blockquote {
  border-left: 4px solid #4299e1;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: #4a5568;
  background-color: #f7fafc;
  padding: 1rem;
  border-radius: 0 8px 8px 0;
}

#summary-content .prose code {
  background-color: #f1f5f9;
  padding: 0.125rem 0.25rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
  color: #e53e3e;
}

#summary-content .prose pre {
  background-color: #2d3748;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
}

#summary-content .prose pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

/* Loading spinner styling for AI Summary */
#summary-content .radial-progress {
  font-size: 1.5rem;
  font-weight: 600;
}

#summary-content .summary-loading-message-text {
  color: #4a5568;
  font-weight: 500;
}

/* Centering styles for loading messages and content */
.loading-message-text,
.summary-loading-message-text {
  text-align: center;
  display: block;
  width: 100%;
}

/* Center the AI Summary prompt text */
#summary-content .prose {
  text-align: left;
}

/* Ensure the "Click AI Summary button" text is centered */
#summary-content .prose:has(p:contains("Click")) {
  text-align: center;
}

/* Specific centering for the AI Summary prompt */
#summary-content .prose p:only-child {
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

/* Additional centering for the initial AI Summary prompt */
#summary-content .prose:has(p:contains("Click")) p,
#summary-content .prose p:contains("Click") {
  text-align: center !important;
  color: #6b7280 !important;
  font-style: italic !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
}

/* Specific styling for the initial prompt text */
#summary-content .prose p:only-child:contains("Click") {
  text-align: center !important;
  color: #6b7280 !important;
  font-style: italic !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
}

/* Style the initial AI Summary prompt span */
#summary-content .prose span:contains("Click") {
  text-align: center !important;
  color: #6b7280 !important;
  font-style: italic !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
  display: block !important;
  width: 100% !important;
}

/* Ensure the summary content container itself doesn't have code styling */
#summary-content {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
}

/* Ensure markdown content is properly rendered (not as code blocks) */
#summary-content .prose * {
  white-space: normal !important;
  font-family: inherit !important;
}

/* Override any pre/code styling that might be applied to markdown content */
#summary-content .prose:not(pre) {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
}

/* Only apply code styling to actual code blocks */
#summary-content .prose pre {
  background-color: #2d3748 !important;
  color: #e2e8f0 !important;
  padding: 1rem !important;
  border-radius: 8px !important;
  overflow-x: auto !important;
  margin: 1rem 0 !important;
  white-space: pre-wrap !important;
  font-family: 'Courier New', monospace !important;
}

#summary-section {
  margin-top: 2rem;
  display: block;
}

/* DaisyUI modal overrides - let daisyUI handle modal display */
dialog.modal::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

dialog.modal[open] {
  display: flex;
}

.modal-box {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 90%;
  width: 400px;
  text-align: center;
}

.modal-box .btn {
  margin-top: 10px;
}

svg.fill-current {
  fill: currentColor;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-content p {
  margin: 0;
}

.email {
  display: flex;
  align-items: center;
  margin-left: 5px;
}

.email-link {
  display: flex;
  align-items: center;
}

.email-icon {
  width: 16px;
  height: 16px;
  margin-right: 5px;
}

@media (max-width: 640px) {
  .page-container {
    margin: 0 20px;
  }

  .input-container {
    flex-direction: column;
    gap: 10px;
  }

  .url-input-wrapper {
    width: 100%;
    max-width: none;
  }

  .button-container {
    flex-direction: column;
    align-items: center;
  }

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

  .footer-content {
    flex-direction: column;
  }

  .email {
    margin-left: 0;
    margin-top: 5px;
  }

  .navbar-end .dropdown {
    display: block;
  }

  .navbar-end .hidden {
    display: none;
  }
  .debug-buttons {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  .debug-buttons button {
    width: 100%;
  }
}

@media (min-width: 641px) {
  .navbar-end .dropdown {
    display: none;
  }
}

/* Usage counter styling */
.usage-counter {
  display: block;
  padding: 8px 16px;
  border-radius: 20px;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.usage-counter.text-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  animation: pulse-warning 2s infinite;
}

.usage-counter.text-danger {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  animation: pulse-danger 2s infinite;
}

/* Rate limit banner styling */
.rate-limit-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

.rate-limit-banner .content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rate-limit-banner .sign-in-button {
  margin-left: auto;
}

@keyframes pulse-warning {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 193, 7, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
  }
}

@keyframes pulse-danger {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

/* Animation for fading out error messages */
.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}