/* Application styles — keep most styling in Tailwind utilities */

/* Shake animation for invalid magic link code */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.animate-shake {
  animation: shake 0.3s ease-in-out;
}

/* Trix editor styling */
trix-editor {
  min-height: 12rem;
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: #fff;
  color: #111827; /* gray-900 */
  font-size: 0.875rem;
  line-height: 1.25rem;
}

trix-editor:focus {
  outline: none;
  border-color: #3b82f6; /* blue-500 */
  box-shadow: 0 0 0 1px #3b82f6;
}

trix-editor.trix-content {
  overflow-y: auto;
}

/* Trix toolbar styling */
trix-toolbar {
  border: 1px solid #d1d5db;
  border-bottom: none;
  border-radius: 0.5rem 0.5rem 0 0;
  background-color: #f9fafb; /* gray-50 */
  padding: 0.25rem;
}

trix-toolbar + trix-editor {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

trix-toolbar .trix-button-group {
  border-color: #d1d5db;
  border-radius: 0.375rem;
  overflow: hidden;
}

trix-toolbar .trix-button {
  border-bottom: none;
}

trix-toolbar .trix-button:not(:first-child) {
  border-left-color: #e5e7eb; /* gray-200 */
}

trix-toolbar .trix-button.trix-active {
  background-color: #dbeafe; /* blue-100 */
}

trix-toolbar .trix-button:hover:not(:disabled) {
  background-color: #f3f4f6; /* gray-100 */
}

trix-toolbar .trix-dialog {
  background-color: #fff;
  border-color: #d1d5db;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

trix-toolbar .trix-input--dialog {
  border-color: #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

/* Dark mode for Trix editor */
.dark trix-editor {
  border-color: #4b5563; /* gray-600 */
  background-color: #1f2937; /* gray-800 */
  color: #f3f4f6; /* gray-100 */
}

.dark trix-editor:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.dark trix-toolbar {
  border-color: #4b5563;
  background-color: #374151; /* gray-700 */
}

.dark trix-toolbar .trix-button-group {
  border-color: #4b5563;
}

.dark trix-toolbar .trix-button {
  color: rgba(255, 255, 255, 0.7);
}

.dark trix-toolbar .trix-button:not(:first-child) {
  border-left-color: #4b5563;
}

.dark trix-toolbar .trix-button.trix-active {
  background-color: #1e3a5f; /* blue-900ish */
  color: #93c5fd; /* blue-300 */
}

.dark trix-toolbar .trix-button:hover:not(:disabled) {
  background-color: #4b5563;
}

.dark trix-toolbar .trix-button--icon::before {
  filter: invert(1);
}

.dark trix-toolbar .trix-dialog {
  background-color: #374151;
  border-color: #4b5563;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.dark trix-toolbar .trix-input--dialog {
  border-color: #4b5563;
  background-color: #1f2937;
  color: #f3f4f6;
}

/* Dark mode for trix-content rendered output */
.dark .trix-content pre {
  background-color: #374151;
  color: #f3f4f6;
}

.dark .trix-content blockquote {
  border-left-color: #4b5563;
}

.dark .trix-content .attachment--file {
  color: #f3f4f6;
  border-color: #4b5563;
}
