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

:root {
  --bs-body-bg: #f8fafc;
  --bs-body-color: #1f2933;
  --bs-primary: #3a6ea5;
  --bs-primary-rgb: 58, 110, 165;
  --bs-link-color: #2f5a87;
  --bs-link-hover-color: #24486a;
  --bs-border-color: #e2e8f0;
  --bs-focus-ring-color: rgba(58, 110, 165, 0.35);
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 0.5rem 1rem;
  background-color: #0d6efd;
  color: #ffffff;
  z-index: 1000;
  border-radius: 0 0 0.25rem 0.25rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
}

.card-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.card-panel.panel-open {
  max-height: 2000px;
}

.agreement-editor-body {
  min-height: 320px;
}

.agreement-editor-body .tpl-var,
.agreement-editor-text .tpl-var {
  position: relative;
  transition: border-color 0.15s ease-in-out;
  border-bottom: 1px dashed transparent;
}

.agreement-editor-body.show-hints .tpl-var {
  border-bottom-color: var(--bs-primary);
}

.agreement-editor-body.show-hints .tpl-var::after {
  content: attr(data-key);
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -0.25rem);
  background: rgba(15, 118, 255, 0.9);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease-in-out;
}

.agreement-editor-body.show-hints .tpl-var:hover::after {
  opacity: 1;
}

.field-tooltip-icon {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.field-tooltip-icon:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
  border-radius: 50%;
}

.template-preview-body .tpl-var {
  border-bottom: 1px dotted #6c757d;
  position: relative;
  cursor: help;
}

.template-preview-body .tpl-var::after {
  content: attr(data-key);
  position: absolute;
  left: 0;
  bottom: 100%;
  transform: translateY(-0.25rem);
  background: #fff;
  color: #495057;
  border: 1px solid #dee2e6;
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-in-out;
  z-index: 10;
}

.template-preview-body .tpl-var:hover::after {
  opacity: 1;
}

.agreement-preview.agreement-variable-hints--on .tpl-var {
  background-color: #fff200; // soft yellow highlight
  padding: 0 2px;            // tiny padding so the highlight doesn’t crash into text
  border-radius: 2px;
  cursor: help;
}

.ck-editor__editable[role="textbox"] {
  min-height: 320px;   /* or 400px, 500px, etc. */
}

/* Make form inputs and selects clearly visible everywhere */
.form-control,
.form-select {
  background-color: #ffffff !important;
  border: 1px solid #ced4da !important;
  color: #212529;
}

.form-control:focus,
.form-select:focus {
  background-color: #ffffff;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* CKEditor alignment classes (used instead of inline styles) */
.tpl-align-left {
  text-align: left;
}

.tpl-align-center {
  text-align: center;
}

.tpl-align-right {
  text-align: right;
}

.tpl-align-justify {
  text-align: justify;
}

.overview-summary-card {
  font-size: 0.9rem;
}

.overview-summary-card .overview-stat {
  padding: 0.5rem 0.75rem;
  background-color: #fff;
}

.overview-summary-card .overview-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.2;
}

.overview-summary-card .overview-stat-value.small {
  font-size: 0.95rem;
}

.overview-summary-card .overview-stat-label {
  font-size: 0.75rem;
  line-height: 1.25;
}

.bookmark-filter__control button {
  text-align: left;
}

.bookmark-filter__dropdown {
  max-height: 24rem;
  overflow-y: auto;
}

.bookmark-filter__options {
  max-height: 18rem;
  overflow-y: auto;
}

.bookmark-filter__option input[type="checkbox"] {
  flex-shrink: 0;
}

.bookmark-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.bookmark-edit-grid__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#bookmark-results {
  scroll-margin-top: 160px;
}
