/*
 * 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.
 */

/* Global font */
body {
  font-family: 'Poppins', sans-serif;
}

/* Hide file attachment button in Trix editor for section text */
.trix-content-wrapper trix-toolbar .trix-button-group--file-tools {
  display: none !important;
}

/* Trix editor styling */
.trix-content-wrapper trix-editor {
  min-height: 120px;
  padding: 0.75rem;
  background: white;
}

.trix-content-wrapper trix-toolbar {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem;
}

.trix-content-wrapper trix-toolbar .trix-button {
  border-radius: 0.375rem;
}

.trix-content-wrapper trix-toolbar .trix-button:hover {
  background: #e5e7eb;
}

.trix-content-wrapper trix-toolbar .trix-button.trix-active {
  background: #d1fae5;
}

/* Link styling in Trix editor */
.trix-content-wrapper trix-editor a {
  color: #2563eb;
  text-decoration: underline;
}

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

/* Link styling in Introduction page */
.prose a {
  color: #2563eb !important;
  text-decoration: underline !important;
}

.prose a:hover {
  color: #1d4ed8 !important;
}

/* Trix editor content styling - blockquote */
.trix-content-wrapper trix-editor blockquote {
  border-left: 4px solid #d1d5db;
  padding-left: 1rem;
  margin: 0.5rem 0;
  color: #6b7280;
  font-style: italic;
}

/* Trix editor content styling - ordered list */
.trix-content-wrapper trix-editor ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

/* Trix editor content styling - unordered list */
.trix-content-wrapper trix-editor ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.trix-content-wrapper trix-editor li {
  margin: 0.25rem 0;
}

/* Prose (Introduction page) - blockquote */
.prose blockquote {
  border-left: 4px solid #d1d5db !important;
  padding-left: 1rem !important;
  margin: 1rem 0 !important;
  color: #6b7280 !important;
  font-style: italic !important;
}

/* Prose (Introduction page) - ordered list */
.prose ol {
  list-style-type: decimal !important;
  padding-left: 1.5rem !important;
  margin: 1rem 0 !important;
}

/* Prose (Introduction page) - unordered list */
.prose ul {
  list-style-type: disc !important;
  padding-left: 1.5rem !important;
  margin: 1rem 0 !important;
}

.prose li {
  margin: 0.25rem 0 !important;
}

/* Tom Select Custom Styling for Country Selector */
.ts-wrapper.country-select-wrapper {
  width: 100% !important;
}

.ts-wrapper.country-select-wrapper .ts-control {
  border: 1px solid #d1d5db !important;
  border-radius: 0.5rem !important;
  padding: 0.5rem 1rem !important;
  background: white !important;
  min-height: 42px !important;
  max-height: 42px !important;
  box-shadow: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  overflow: hidden !important;
}

.ts-wrapper.country-select-wrapper .ts-control:hover {
  border-color: #10b981 !important;
}

.ts-wrapper.country-select-wrapper.focus .ts-control {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
  outline: none !important;
}

.ts-wrapper.country-select-wrapper .ts-control input {
  font-size: 0.875rem !important;
  color: #374151 !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* Hide input when item is selected (but not when focused for searching) */
.ts-wrapper.country-select-wrapper.has-items:not(.focus) .ts-control input {
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  position: absolute !important;
}

/* When focused with items, allow input to show for searching */
.ts-wrapper.country-select-wrapper.has-items.focus .ts-control input {
  width: auto !important;
  flex: 1 !important;
  opacity: 1 !important;
  position: relative !important;
}

.ts-wrapper.country-select-wrapper .ts-control input::placeholder {
  color: #9ca3af !important;
}

.ts-wrapper.country-select-wrapper .ts-control > .item {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: #374151 !important;
  font-size: 0.875rem !important;
  display: flex !important;
  align-items: center !important;
  line-height: 1.5 !important;
}

.ts-wrapper.country-select-wrapper .ts-dropdown {
  border: 1px solid #e5e7eb !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  margin-top: 4px !important;
  padding: 0.25rem !important;
  background: white !important;
  max-height: 300px !important;
  overflow-y: auto !important;
}

.ts-wrapper.country-select-wrapper .ts-dropdown .ts-dropdown-content {
  max-height: none !important;
  padding: 0 !important;
}

.ts-wrapper.country-select-wrapper .ts-dropdown .option {
  padding: 0.625rem 0.75rem !important;
  border-radius: 0.375rem !important;
  margin: 2px 0 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.ts-wrapper.country-select-wrapper .ts-dropdown .option:hover,
.ts-wrapper.country-select-wrapper .ts-dropdown .option.active {
  background-color: #ecfdf5 !important;
  color: #065f46 !important;
}

.ts-wrapper.country-select-wrapper .ts-dropdown .option.selected {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
}

.ts-wrapper.country-select-wrapper .ts-dropdown .option .flag-emoji {
  font-size: 1.25rem !important;
  margin-right: 0.75rem !important;
}

.ts-wrapper.country-select-wrapper .ts-dropdown .option .country-name {
  color: #374151 !important;
  font-size: 0.875rem !important;
}

/* Hide the caret/arrow */
.ts-wrapper.country-select-wrapper .ts-control::after {
  display: none !important;
}

/* Custom dropdown arrow */
.ts-wrapper.country-select-wrapper .ts-control {
  padding-right: 2.5rem !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
  background-position: right 0.75rem center !important;
  background-repeat: no-repeat !important;
  background-size: 1.25rem !important;
}

/* Code block styling - Trix editor */
.trix-content-wrapper trix-editor pre {
  display: block;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  padding: 1rem;
  margin: 0.5rem 0;
  background-color: #1e293b;
  color: #e2e8f0;
  border-radius: 0.5rem;
  overflow-x: auto;
  white-space: pre;
}

/* Code block styling - Display (prose) */
.prose pre {
  display: block !important;
  width: 100% !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
  font-size: 0.875rem !important;
  line-height: 1.7 !important;
  padding: 1rem !important;
  margin: 1rem 0 !important;
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-radius: 0.5rem !important;
  overflow-x: auto !important;
  white-space: pre !important;
}

/* Inline code styling */
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
  font-size: 0.875em !important;
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  padding: 0.15rem 0.4rem !important;
  border-radius: 0.25rem !important;
}

/* Quill tooltip z-index fix */
.ql-tooltip {
  z-index: 9999 !important;
}

/* Quill Editor Styling */
.quill-wrapper .ql-toolbar {
  border: none !important;
  border-bottom: 1px solid #e5e7eb !important;
  background: #f9fafb;
  font-family: 'Poppins', sans-serif;
}

.quill-wrapper .ql-container {
  border: none !important;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
}

.quill-wrapper .ql-editor {
  min-height: 150px;
  padding: 0.75rem;
}

.quill-wrapper .ql-editor.ql-blank::before {
  color: #9ca3af;
  font-style: normal;
}

/* Quill code block styling */
.quill-wrapper .ql-editor pre.ql-syntax {
  background-color: #1e293b;
  color: #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  overflow-x: auto;
}

/* Quill font picker labels - style-based font attributor uses font-family value as data-value */
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before { content: "Default"; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Poppins, sans-serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Poppins, sans-serif"]::before { content: "Poppins"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Poppins, sans-serif"] { font-family: 'Poppins', sans-serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Roboto, sans-serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Roboto, sans-serif"]::before { content: "Roboto"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Roboto, sans-serif"] { font-family: 'Roboto', sans-serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Open Sans, sans-serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Open Sans, sans-serif"]::before { content: "Open Sans"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Open Sans, sans-serif"] { font-family: 'Open Sans', sans-serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Lato, sans-serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Lato, sans-serif"]::before { content: "Lato"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Lato, sans-serif"] { font-family: 'Lato', sans-serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Montserrat, sans-serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Montserrat, sans-serif"]::before { content: "Montserrat"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Montserrat, sans-serif"] { font-family: 'Montserrat', sans-serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Inter, sans-serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Inter, sans-serif"]::before { content: "Inter"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Inter, sans-serif"] { font-family: 'Inter', sans-serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Raleway, sans-serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Raleway, sans-serif"]::before { content: "Raleway"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Raleway, sans-serif"] { font-family: 'Raleway', sans-serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Playfair Display, serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Playfair Display, serif"]::before { content: "Playfair Display"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Playfair Display, serif"] { font-family: 'Playfair Display', serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Noto Sans KR, sans-serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Noto Sans KR, sans-serif"]::before { content: "Noto Sans KR"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Noto Sans KR, sans-serif"] { font-family: 'Noto Sans KR', sans-serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Dancing Script, cursive"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Dancing Script, cursive"]::before { content: "Dancing Script"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Dancing Script, cursive"] { font-family: 'Dancing Script', cursive; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Georgia, serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Georgia, serif"]::before { content: "Georgia"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Georgia, serif"] { font-family: Georgia, serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Arial, sans-serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Arial, sans-serif"]::before { content: "Arial"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Arial, sans-serif"] { font-family: Arial, sans-serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Verdana, sans-serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Verdana, sans-serif"]::before { content: "Verdana"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Verdana, sans-serif"] { font-family: Verdana, sans-serif; }

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="Courier New, monospace"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Courier New, monospace"]::before { content: "Courier New"; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="Courier New, monospace"] { font-family: 'Courier New', monospace; }

/* Quill font picker width */
.ql-snow .ql-picker.ql-font { width: 150px !important; }
.ql-snow .ql-picker.ql-font .ql-picker-options { width: 170px !important; }

/* Quill size picker labels */
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before { content: "Default"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="10px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="10px"]::before { content: "10px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="12px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12px"]::before { content: "12px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before { content: "14px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="16px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16px"]::before { content: "16px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="18px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18px"]::before { content: "18px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="20px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20px"]::before { content: "20px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="24px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24px"]::before { content: "24px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="28px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="28px"]::before { content: "28px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="32px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="32px"]::before { content: "32px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="36px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="36px"]::before { content: "36px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="48px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="48px"]::before { content: "48px"; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="64px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="64px"]::before { content: "64px"; }

/* Tooltip styles are handled by tooltip_controller.js */
