/* Kanban drag and drop styles */
.dragging {
  @apply shadow-lg transform rotate-2 opacity-90;
}

.sortable-ghost {
  @apply bg-base-200 opacity-50;
}

.drop-zone-active {
  @apply ring-2 ring-primary/30 bg-primary/10;
}

/* Semantic button extensions for DaisyUI */
.btn-info {
  @apply btn bg-info text-info-content border-info;
}

.badge-info {
  @apply badge bg-info text-info-content;
}

/* Status indicator semantic classes */
.status-recording {
  @apply bg-error/20 text-error;
}

.status-processing {
  @apply bg-warning/20 text-warning;
}

.status-completed {
  @apply bg-success/20 text-success;
}

.status-analyzing {
  @apply bg-secondary/20 text-secondary;
}

/* Custom animations */
.animate-fade-in {
  animation: fadeIn 0.2s ease-in-out;
}

.animate-fade-out {
  animation: fadeOut 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Flash message slide animations */
.animate-slide-in {
  animation: slideIn 0.2s ease-out;
}

.animate-slide-out {
  animation: slideOut 0.2s ease-in forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Atlas FAB coin-flip — 3D flip transition for the dual-face button */
.atlas-fab-coin {
  transition: transform 0.6s ease-in-out;
}

/* Atlas FAB glow — subtle amber pulse when unread high-confidence insights exist */
.atlas-fab-glow {
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
  animation: atlas-fab-pulse 2s ease-in-out infinite;
}

@keyframes atlas-fab-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  50% { box-shadow: 0 0 12px 4px rgba(245, 158, 11, 0.3); }
}

/* Flatpickr calendar z-index fix — must render above native <dialog> (default z-index 2147483647) */
.flatpickr-calendar {
  z-index: 2147483648 !important;
}

/* Inline flatpickr in defer forms — remove shadow/border since it's embedded */
[data-controller="defer-picker"] .flatpickr-calendar.inline {
  box-shadow: none;
  border: 1px solid oklch(var(--b3));
  border-radius: 0.25rem;
}

/* ========================================================================
   Meeting-specific styles (formerly meetings.css, was pulled in via the
   Sprockets `*= require meetings` directive under the old pipeline).
   ======================================================================== */

.transcript-container {
  position: relative;
}

.transcript-text {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  max-height: calc(1.5em * 5);
}

.transcript-container.expanded .transcript-text {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow-y: auto;
  max-height: 200px;
  text-overflow: unset;
}

.transcript-toggle {
  margin-top: 8px;
  font-size: 0.875rem;
  color: #6B7280;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.transcript-toggle:hover {
  color: #374151;
}

/* Prose content styling — scoped to .prose class */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.25rem; }
.prose h3 { font-size: 1.125rem; }

.prose p {
  margin-bottom: 1rem;
}

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

.prose li {
  margin-bottom: 0.25rem;
}

.prose code {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', 'Roboto Mono', monospace;
}

.prose pre {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.prose pre code {
  background-color: transparent;
  padding: 0;
}

.prose blockquote {
  border-left: 4px solid #D1D5DB;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
}

.prose strong {
  font-weight: 600;
}

.prose em {
  font-style: italic;
}

/* Manual transcript UI */
.manual-transcript-container {
  background: linear-gradient(135deg, #e0f2fe 0%, #f3e5f5 100%);
  border: 1px solid #b3e5fc;
}

.manual-transcript-textarea {
  resize: vertical;
  min-height: 200px;
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  border: 2px solid #e3f2fd;
  border-radius: 8px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.manual-transcript-textarea:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.manual-transcript-textarea::placeholder {
  color: #9e9e9e;
  font-style: italic;
}

.character-counter {
  font-size: 0.75rem;
  color: #666;
  transition: color 0.3s ease;
}

.character-counter.warning {
  color: #ff9800;
  font-weight: 500;
}

.character-counter.error {
  color: #f44336;
  font-weight: 600;
}

.or-divider {
  position: relative;
}

.or-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e0e0e0;
}

.or-divider span {
  background: white;
  padding: 0 1rem;
  color: #757575;
  font-size: 0.875rem;
  position: relative;
  z-index: 1;
}

/* Custom button effects */
.btn-manual-transcript {
  transition: all 0.3s ease;
  transform: translateY(0);
}

.btn-manual-transcript:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-analyze {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  transition: all 0.3s ease;
}

.btn-analyze:hover {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  transform: translateY(-1px);
}

/* Status messages */
.error-message {
  background: #ffebee;
  border: 1px solid #ffcdd2;
  color: #c62828;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
}

.error-message svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.success-message {
  background: #e8f5e8;
  border: 1px solid #c8e6c9;
  color: #2e7d32;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
}

.success-message svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* Mermaid diagram container styling (rendered diagram wrapper) */
.mermaid {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem;
  background-color: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow-x: auto;
}

.mermaid-rendered {
  background-color: transparent;
}

.mermaid-rendered svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.mermaid-error {
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', 'Roboto Mono', monospace;
}

.mermaid-error details {
  margin-top: 0.5rem;
}

.mermaid-error summary {
  outline: none;
  user-select: none;
}

.mermaid-error summary:hover {
  text-decoration: underline;
}

.mermaid-error pre {
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ========================================================================
   Mermaid clickable viewer (formerly components/mermaid_viewer.css, was
   pulled in via a broken `@import` in application.tailwind.css that
   Tailwind CLI v3 does not resolve without postcss-import).
   ======================================================================== */

.mermaid-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 0.125rem;
  padding: 1rem;
  position: relative;
}

.mermaid-clickable:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.mermaid-clickable:focus-visible {
  outline: 2px solid hsl(var(--p));
  outline-offset: 2px;
}

.mermaid-clickable::after {
  content: "Click to expand";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: hsl(var(--b1) / 0.9);
  border: 1px solid hsl(var(--bc) / 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: hsl(var(--bc) / 0.6);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.mermaid-clickable:hover::after {
  opacity: 1;
}

#mermaid-viewer-modal .modal-box {
  background-color: hsl(var(--b1));
}

#mermaid-viewer-modal svg {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  display: block;
  margin: 0 auto;
}

#mermaid-viewer-modal {
  z-index: 9999;
}

.focus-visible:focus-visible {
  outline: 2px solid hsl(var(--p));
  outline-offset: 2px;
}
