/* Tailwind toggle switch extra styling */
input:checked+.block {
  background-color: rgb(34 197 94);
  /* tailwind green-500 */
}

input:checked+.block+.dot {
  transform: translateX(24px);
  background-color: rgb(34 197 94);
  /* tailwind green-500 */
}

/* Visa grön ikon när togglen är aktiv */
input:checked~#klar-icon svg {
  color: white !important;
  stroke: white !important;
}

#klar-icon svg {
  color: rgb(209 213 219);
  stroke: rgb(209 213 219);
  transition: color 0.2s, stroke 0.2s;
}


/* Lägg till detta i din CSS */
.toastui-editor-toolbar-icons.undo {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M125.7 160l50.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L48 224c-17.7 0-32-14.3-32-32L16 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"/></svg>');
  background-size: 18px 18px;
  background-repeat: no-repeat;
  background-position: center;
}

.toastui-editor-toolbar-icons.redo {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M386.3 160L336 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 51.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0s-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3s163.8-62.5 226.3 0L386.3 160z"/></svg>');
  background-size: 18px 18px;
  background-repeat: no-repeat;
  background-position: center;
}


/* Tooltip styling */
.tooltip {
  position: relative;
  top: 0;
  padding: 0;
  border: 0;
  background-color: transparent;
  color: #0a0a0a;
  font-weight: 600;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #374151;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: normal;
  white-space: nowrap;
  max-width: 300px;
  white-space: normal;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  line-height: 1.3;
}

.tooltip:hover::before {
  content: "";
  position: absolute;
  bottom: 117%;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #374151;
  z-index: 1000;
}

/* Longform editor tweaks */
#text-longform textarea {
  width: 1200px !important;
  max-width: 100% !important;
}

/* Loading states */
.processing {
  opacity: 0.7;
  pointer-events: none;
}

.processing::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Focus improvements */
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Verbesserte Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* AI response cards förbättringar */
#text-cards .bg-white {
  transition: box-shadow 0.2s ease-in-out;
}

#text-cards .bg-white:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Toast improvements */
#save-message {
  transition: all 0.3s ease-in-out;
  max-width: 90vw;
  word-wrap: break-word;
}

/* Modal improvements */
#compare-modal {
  backdrop-filter: blur(4px);
}

#compare-modal .bg-white {
  max-height: 95vh;
  overflow-y: auto;
}

/* Markdown content styling */
.markdown-content {
  line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  color: #374151;
}

.markdown-content ul {
  list-style-type: disc;
  padding-left: 1rem;
}

.markdown-content li {
  margin-bottom: 0.25rem;
}

.markdown-content p {
  margin-bottom: 0.75rem;
}

.markdown-content strong {
  font-weight: 600;
}

.markdown-content em {
  font-style: italic;
}

/* Button states for originaltext accordion */
.originaltext-btn.active {
  background-color: #d1d5db;
  color: #374151;
}

/* Combined comparison accordion styles */
.original-content,
.highlight-content {
  transition: opacity 0.2s ease;
}

.original-content.hidden,
.highlight-content.hidden {
  display: none;
}

/* Main tab buttons in combined accordion */
#show-original-btn.active,
#compare-texts-btn.active {
  background-color: #d1d5db !important;
  color: #374151 !important;
}

/* Toast UI Editor auto-height support */
#originaltext-editor-container .toastui-editor {
  height: auto !important;
  min-height: 150px;
}

#originaltext-editor-container .toastui-editor-ww-container {
  height: auto !important;
}

#originaltext-editor-container .toastui-editor-ww-container .toastui-editor {
  height: auto !important;
  min-height: 150px;
  overflow: hidden !important;
  resize: none;
}

#originaltext-editor-container .toastui-editor-contents {
  overflow: visible !important;
}

/* Ensure the editor container itself is flexible */
#originaltext-editor-container {
  height: auto;
  overflow: visible;
}

/* Remove any max-height constraints that might interfere */
#originaltext-editor-container .toastui-editor-ww-container .toastui-editor-ww,
#originaltext-editor-container .toastui-editor-ww-container .toastui-editor-ww .tui-editor-contents {
  max-height: none !important;
  overflow: visible !important;
}

/* AI Text Editor Sticky Toolbar */
#aitext-textarea-editor .toastui-editor-toolbar,
#originaltext-editor-container .toastui-editor-toolbar {
  position: sticky !important;
  top: 0px !important;
  z-index: 100 !important;
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  margin-bottom: 8px !important;
}