/* Custom animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
  animation: slideUp 0.5s ease-out;
}

/* Dark mode transitions */
.transition-colors {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Custom focus styles */
button:focus, input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Copy button animation */
.copy-success {
  background-color: #10B981 !important;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
  background: #374151;
}

.dark ::-webkit-scrollbar-thumb {
  background: #6B7280;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

/* Tooltip styles */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 120px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -60px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Dark mode prose */
.dark .prose-dark {
  color: #e5e7eb;
}

.dark .prose-dark h1,
.dark .prose-dark h2,
.dark .prose-dark h3,
.dark .prose-dark h4,
.dark .prose-dark h5,
.dark .prose-dark h6 {
  color: #f9fafb;
}

.dark .prose-dark a {
  color: #93c5fd;
}

.dark .prose-dark strong {
  color: #f9fafb;
}

.dark .prose-dark ol > li::before {
  color: #9ca3af;
}

.dark .prose-dark ul > li::before {
  background-color: #6b7280;
}

.dark .prose-dark hr {
  border-color: #4b5563;
}

.dark .prose-dark blockquote {
  color: #9ca3af;
  border-left-color: #4b5563;
}

.dark .prose-dark table {
  border-color: #4b5563;
}

.dark .prose-dark th {
  color: #f9fafb;
  border-bottom-color: #4b5563;
}

.dark .prose-dark td {
  border-bottom-color: #4b5563;
}

/* Mobile optimizations */
@media (max-width: 640px) {
  input, button {
    font-size: 16px; /* Prevent auto-zoom on iOS */
  }
  
  #convertedLink {
    word-break: break-all;
    font-size: 14px;
  }
  
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  /* Improved tap targets */
  button, a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Adjust iframe container for mobile */
  #videoPreviewContainer {
    margin-top: 16px;
  }
  
  /* Make sure iframe doesn't overflow on small screens */
  #videoPreview {
    max-height: 80vh;
  }
  
  .relative.pt-\[56\.25\%\] {
    min-height: 200px;
  }
}

/* Fix for mobile Safari */
input[readonly] {
  -webkit-user-select: text;
  user-select: text;
}

/* Better scrolling on mobile */
html, body {
  -webkit-overflow-scrolling: touch;
}

/* Video preview container styles - improved visibility */
#videoPreviewContainer {
  transition: opacity 0.3s ease-in-out;
  background-color: #000;
  border-radius: 8px;
  margin-top: 20px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Ensure iframe is visible and properly sized */
#videoPreview {
  border: none;
  display: block !important;
  background-color: #000;
  z-index: 10;
}

/* Make the container visible even during loading */
.relative.pt-\[56\.25\%\] {
  background-color: #000;
  min-height: 250px;
}

/* Add a loading indicator for the iframe */
.relative.pt-\[56\.25\%\]::before {
  content: "Loading video...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16px;
  z-index: 1;
}

/* Ensure iframe has proper z-index and sizing */
.absolute.top-0.left-0.w-full.h-full {
  z-index: 2;
}

/* Player buttons style */
#playerButtons button {
  min-width: 100px;
  transition: all 0.3s ease;
}

#playerButtons button.active {
  transform: scale(1.05);
}

/* Details element styling */
details {
  border-radius: 4px;
  padding: 0.5em;
  border: 1px solid #ddd;
}

details[open] {
  padding-bottom: 1em;
}

details summary {
  font-weight: bold;
  cursor: pointer;
  padding: 0.5em 0;
}

details summary::-webkit-details-marker {
  color: #3B82F6;
}

.dark details {
  border-color: #4B5563;
}

.dark details summary::-webkit-details-marker {
  color: #60A5FA;
}