/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/*
 *= require_tree .
 *= require_self
 */

/* Trix Editor Styling - Dark Theme */
trix-editor {
  background-color: #bfdbfe !important;
  border: 1px solid #3b82f6 !important;
  border-radius: 0 0 0.375rem 0.375rem !important;
  border-top: none !important;
  min-height: 200px !important;
  padding: 0.75rem !important;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif !important;
  line-height: 1.6 !important;
  color: #1e40af !important;
  max-height: 500px !important;
  overflow-y: scroll !important;
}

trix-editor:focus {
  outline: none !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
}

/* Trix Toolbar Styling - Dark Theme */
trix-toolbar {
  background-color: #1e3a8a !important;
  border: 1px solid #3b82f6 !important;
  border-bottom: none !important;
  border-radius: 0.375rem 0.375rem 0 0 !important;
  padding: 0.5rem !important;
  margin-bottom: 0 !important;
}

trix-toolbar .trix-button-group {
  margin-right: 0.5rem !important;
  border: none !important;
  border-radius: 0.375rem !important;
  overflow: hidden !important;
  background-color: transparent !important;
  display: inline-flex !important;
  gap: 0 !important;
}

trix-toolbar .trix-button {
  background-color: #3b82f6 !important;
  border: 1px solid #60a5fa !important;
  padding: 0.375rem 0.75rem !important;
  color: white !important;
  font-size: 0.875rem !important;
  transition: all 0.15s ease-in-out !important;
  font-weight: 500 !important;
  border-radius: 0 !important;
}

trix-toolbar .trix-button:first-child {
  border-top-left-radius: 0.375rem !important;
  border-bottom-left-radius: 0.375rem !important;
}

trix-toolbar .trix-button:last-child {
  border-top-right-radius: 0.375rem !important;
  border-bottom-right-radius: 0.375rem !important;
}

trix-toolbar .trix-button:not(:first-child) {
  border-left: none !important;
}

trix-toolbar .trix-button:hover {
  background-color: #2563eb !important;
  color: white !important;
  z-index: 1 !important;
  position: relative !important;
}

trix-toolbar .trix-button.trix-active {
  background-color: #60a5fa !important;
  color: #1e40af !important;
  font-weight: 600 !important;
  z-index: 1 !important;
  position: relative !important;
}

/* Ensure content area has proper styling */
trix-editor .trix-content {
  background-color: #bfdbfe !important;
  color: #1e40af !important;
}

/* Trix Dialog Styling - Dark Theme */
trix-toolbar .trix-dialog {
  background-color: #1f2937 !important;
  border: 1px solid #3b82f6 !important;
  border-radius: 0.375rem !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}

trix-toolbar .trix-dialog .trix-dialog__link-fields {
  background-color: #1e3a8a !important;
  border-radius: 0.375rem !important;
  padding: 0.5rem !important;
}

trix-toolbar .trix-dialog .trix-dialog__link-fields input {
  background-color: #bfdbfe !important;
  border: 1px solid #3b82f6 !important;
  border-radius: 0.375rem !important;
  color: #1e40af !important;
  padding: 0.375rem 0.5rem !important;
  margin-bottom: 0.5rem !important;
  max-width: 75% !important;
  display: block !important;
}

trix-toolbar .trix-dialog {
  margin: 10px 0 4px;
}

trix-toolbar .trix-dialog .trix-dialog__link-fields input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
  outline: none !important;
}

trix-toolbar .trix-dialog .trix-dialog__link-fields input::placeholder {
  color: #60a5fa !important;
}

/* Style the dialog buttons */
trix-toolbar .trix-dialog .trix-button--dialog {
  background-color: #1e3a8a !important;
  border: 1px solid #1e3a8a !important;
  color: white !important;
  padding: 0.375rem 0.75rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  border-radius: 0.375rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  margin-right: 0.25rem !important;
  display: inline-block !important;
}

trix-toolbar .trix-dialog .trix-button--dialog:last-child {
  margin-right: 0 !important;
}

trix-toolbar .trix-dialog .trix-button--dialog:hover {
  background-color: #1e40af !important;
  border-color: #1e40af !important;
  color: white !important;
  cursor: pointer !important;
}

trix-toolbar .trix-dialog .trix-button-group {
  margin: 0 !important;
  border: none !important;
  background-color: transparent !important;
}

/* Trix Content Styling */
trix-editor h1 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

trix-editor h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

trix-editor h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

trix-editor p {
  margin-bottom: 1rem;
}

trix-editor ul, trix-editor ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

trix-editor li {
  margin-bottom: 0.25rem;
}

trix-editor a {
  color: #3b82f6;
  text-decoration: underline;
}

trix-editor a:hover {
  color: #1d4ed8;
}

/* Dark theme compatibility for Trix in edit mode */
.trix-content {
  color: #f3f4f6;
}

/* Form styling improvements for dark theme */
textarea, input[type="text"], input[type="email"], 
.form-control, .form-input {
  background-color: #bfdbfe !important;
  border: 1px solid #3b82f6 !important;
  color: #1e40af !important;
}

/* Specific styling for notes field */
textarea[name*="notes"] {
  background-color: #bfdbfe !important;
  border: 1px solid #3b82f6 !important;
  color: #1e40af !important;
  padding: 0.75rem !important; /* Match Trix editor padding */
}

textarea:focus, input[type="text"]:focus, input[type="email"]:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3) !important;
  outline: none !important;
}

/* Placeholder text styling */
textarea::placeholder, input::placeholder {
  color: #60a5fa !important;
}

/* Button cursor styling */
button, input[type="submit"], .btn {
  cursor: pointer;
}

/* Turbo frame styling fixes */
turbo-frame {
  display: block;
}