/* =====================================================
   WPD Cockpit — Site Stylesheet
   Page-specific overrides & bridges (not layout/chrome)
   Layout lives in layout.css, tokens in base.css.
   ===================================================== */

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.wpd-login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #162032 100%);
  padding: 2rem 1rem;
}

.wpd-login-wrap {
  width: 100%;
  max-width: 440px;
}

.wpd-login-card {
  background: #fff;
  border-radius: 12px;
  padding: 2.25rem 2rem;
  border: 2px solid #e2e8f0;
}

.wpd-login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

/* =====================================================
   GRID LAYOUT
   ===================================================== */

.wpd-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing);
}

@media (max-width: 768px) {
  .wpd-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   CHECK ICON (circular)
   ===================================================== */

.wpd-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #d4edda;
  color: #155724;
  font-size: 0.65rem;
}

/* =====================================================
   CHIPS
   ===================================================== */

.wpd-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--color-grey-100);
  color: var(--color-text);
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: nowrap;
}

/* =====================================================
   AFVAARTEN PAGE
   ===================================================== */

.afvaart-row {
  display: block;
  padding: var(--spacing-sm) var(--spacing);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-fast);
}

.afvaart-row:last-child {
  border-bottom: none;
}

.afvaart-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

.afvaart-row--editable {
  cursor: pointer;
}

.afvaart-row--editable:hover {
  background: rgba(0, 0, 0, 0.04);
}
.afvaart-row--editable:hover .afvaart-edit-icon {
  color: var(--color-brand-1);
}

.afvaart-row--cancelled {
  opacity: 0.5;
}

/* =====================================================
   DASHBOARD STAT CARD ICON
   ===================================================== */

.wpd-stat-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* =====================================================
   UTILITIES / SMALL FIXES
   ===================================================== */

/* Font monospace for IPs and times */
.font-monospace {
  font-family: var(--fontfamily-mono);
}

/* =====================================================
   DROPDOWN BRIDGE
   Views use .dropdown-menu / .dropdown-item (no Bootstrap CSS loaded)
   ===================================================== */

.dropdown {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.dropdown:has(.dropdown-menu.is-open) {
  z-index: 1051;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1050;
  min-width: 180px;
  background: #fff;
  border: 1px solid #cdd0d4;
  border-radius: 6px;
  padding: 4px 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    opacity 0.15s ease-out,
    transform 0.15s ease-out;
}

.dropdown-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  color: #0e0e10;
  text-decoration: none;
  font-size: 0.9rem;
  font-family: "futura-pt", Arial, sans-serif;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s ease;
}
.dropdown-item:hover {
  background: #f5f6f6;
  color: #df091e;
}

.dropdown-divider {
  height: 0;
  border: none;
  border-top: 1px solid #cdd0d4;
  margin: 4px 0;
}

.dropdown-menu li.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.dropdown-menu li.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Dropdown toggle arrow */
.dropdown-toggle::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-left: 0.45rem;
  vertical-align: middle;
  opacity: 0.65;
  flex-shrink: 0;
}

/* =====================================================
   FILTER CHIPS  (wagenborg.com style)
   ===================================================== */

/* Button element support for wpd-filter__chip */
button.wpd-filter__chip,
button.wpd-filter__chip--active {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  cursor: pointer;
}

/* Ghost dropdown toggle inside filter area → pill chip style */
.wpd-button--ghost.dropdown-toggle {
  padding: 0.3rem 0.55rem 0.3rem 0.9rem;
  border: 1.5px solid #cdd0d4;
  border-radius: 999px;
  background: #fff;
  color: #0e0e10;
  font-size: 0.9rem;
  font-family: "futura-pt", Arial, sans-serif;
  text-transform: none;
  letter-spacing: 0;
}
.wpd-button--ghost.dropdown-toggle:hover {
  border-color: #df091e;
  color: #df091e;
  background: #fff;
}

.wpd-filter {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.wpd-filter__label {
  font-family: "futura-pt", Arial, sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: #0e0e10;
  white-space: nowrap;
  margin-right: 0.25rem;
}

.wpd-filter__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 32px;
  padding: 0 0.7rem;
  border: 1px solid var(--color-grey-300);
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-text);
  font-size: var(--fontsize-small);
  font-family: var(--fontfamily-default);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  line-height: 32px;
  transition:
    border-color 0.12s,
    background 0.12s,
    color 0.12s;
}

.wpd-filter__chip:hover {
  border-color: var(--color-brand-1);
  color: var(--color-brand-1);
  text-decoration: none;
}

.wpd-filter__chip--active {
  background: var(--color-brand-1);
  border-color: var(--color-brand-1);
  color: #fff;
}

.wpd-filter__chip--active:hover {
  background: #c4071b;
  border-color: #c4071b;
  color: #fff;
}

.wpd-filter__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 12%);
  color: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.wpd-filter__chip--active .wpd-filter__count {
  background: rgb(255 255 255 / 25%);
}

.wpd-filter__divider {
  width: 1px;
  height: 20px;
  background: var(--color-grey-300);
  align-self: center;
}

/* Reduce right padding when chip contains a count badge or acts as a dropdown toggle */
.wpd-filter__chip:has(.wpd-filter__count),
.wpd-filter__chip.dropdown-toggle {
  padding-right: 0.55rem;
}

/* Dropdown toggle chips: no uppercase, no bold, tighter padding */
.wpd-filter__chip.dropdown-toggle {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  padding-right: 0.35rem;
}

.wpd-filter__chip.dropdown-toggle::after {
  margin-left: 0.3rem;
}

/* =====================================================
   FILTER BAR  (container for search + filter pills)
   ===================================================== */

.wpd-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Dropdown buttons inside the filter bar match input styling */
.wpd-filter-bar .dropdown > .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: var(--spacing-2xs) var(--spacing-xs);
  border: 1px solid var(--color-grey-300);
  border-radius: var(--border-radius-input);
  background: var(--color-white);
  color: var(--color-text);
  font-size: var(--fontsize-small);
  font-family: var(--fontfamily-default);
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  padding-right: 0.35rem;
}

.wpd-filter-bar .dropdown > .dropdown-toggle:hover {
  border-color: var(--color-grey-800);
}

.wpd-filter-bar .dropdown > .dropdown-toggle::after {
  margin-left: 0.3rem;
}

/* =====================================================
   SEARCH WRAP  (input + icon button on the right)
   ===================================================== */

.wpd-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.wpd-search-wrap .wpd-input {
  padding-right: 2.4rem;
  width: 220px;
}

.wpd-search-wrap__btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0;
  background: none;
  border: none;
  color: var(--color-grey-500);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--border-radius-sm);
  transition:
    background 0.15s,
    color 0.15s;
}

.wpd-search-wrap__btn:hover {
  color: var(--color-brand-1);
  background: rgba(223, 9, 30, 0.07);
}

/* =====================================================
   LEAFLET — hide attribution logo
   ===================================================== */
.leaflet-control-attribution {
  display: none !important;
}

/* Quill editor inside forms */
.ql-container {
  min-height: 200px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}
.ql-toolbar {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

/* =====================================================
   BOOTSTRAP BRIDGE — list-group, img-thumbnail, etc.
   (Used in views but no Bootstrap CSS loaded)
   ===================================================== */

/* ---- Text ---- */
.text-decoration-none {
  text-decoration: none;
}
.text-decoration-line-through {
  text-decoration: line-through;
}
.fw-semibold {
  font-weight: 600;
}
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-primary {
  color: var(--color-brand-1);
}
.small, small {
  font-size: 0.8125rem;
}
.fs-5 {
  font-size: 1.1rem;
}

/* ---- Display ---- */
.d-none {
  display: none !important;
}
.d-block {
  display: block;
}

/* ---- Spacing ---- */
.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: 0.25rem;
}
.mt-1 {
  margin-top: 0.25rem;
}
.ms-2 {
  margin-inline-start: 0.5rem;
}
.my-3 {
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.m-1 {
  margin: 0.25rem;
}
.p-2 {
  padding: 0.5rem;
}
.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.py-4 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.pt-2 {
  padding-top: 0.5rem;
}
.ps-3 {
  padding-inline-start: 0.75rem;
}

/* ---- Background ---- */
.bg-light {
  background-color: #f8f9fa;
}
.bg-white {
  background-color: #fff;
}
.bg-danger-subtle {
  background-color: #f8d7da;
}

/* ---- Border ---- */
.border {
  border: 1px solid #dee2e6;
}
.border-top {
  border-top: 1px solid #dee2e6;
}
.border-start {
  border-left: 1px solid #dee2e6;
}
.border-primary {
  border-color: var(--color-brand-1) !important;
}
.border-danger {
  border-color: var(--color-status-alert) !important;
}
.border-3 {
  border-width: 3px !important;
}

/* ---- Table ---- */
.table-light {
  background-color: #f8f9fa;
}
.table-bordered td,
.table-bordered th {
  border: 1px solid #dee2e6;
}

/* ---- Misc ---- */
.stretched-link::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  content: "";
}
.opacity-75 {
  opacity: 0.75;
}
.min-w-0 {
  min-width: 0;
}

/* ---- List group ---- */
.list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.list-group-flush {
  border-radius: 0;
}

.list-group-item {
  position: relative;
  display: block;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  text-decoration: none;
  color: inherit;
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item-action {
  cursor: pointer;
  transition: background 0.1s;
}

.list-group-item-action:hover {
  background: #fafafa;
}

.img-thumbnail {
  padding: 0.25rem;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  max-width: 100%;
  height: auto;
}

/* =====================================================
   UPLOAD DROPZONE
   (replaces repeated inline dashed-border styles)
   ===================================================== */

.upload-dropzone {
  border: 2px dashed #cdd0d4;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--color-brand-1);
  background: rgba(223, 9, 30, 0.02);
}

/* =====================================================
   TYPE CARD — radio-button card selector
   (Messages, WindMessages, Triggers type pickers)
   ===================================================== */

.wpd-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  border: 2px solid #cdd0d4;
  border-radius: 8px;
  padding: 12px 20px;
  text-align: center;
  min-width: 120px;
  transition:
    border-color 0.15s,
    background 0.15s;
  background: #fff;
}

.wpd-type-card:hover {
  border-color: #999;
}

.wpd-type-card input[type="radio"] {
  display: none;
}

.wpd-type-card .wpd-type-card__icon {
  font-size: 1.5rem;
  color: #999;
  transition: color 0.15s;
}

.wpd-type-card .wpd-type-card__label {
  font-size: 0.8rem;
  font-weight: 600;
}

.wpd-type-card--active {
  border-color: var(--color-brand-1);
  background: rgba(223, 9, 30, 0.03);
}

.wpd-type-card--active .wpd-type-card__icon {
  color: var(--color-brand-1);
}

.wpd-type-card--active:hover {
  border-color: var(--color-brand-1);
}

/* =====================================================
   BOOTSTRAP BRIDGE — Badge
   ===================================================== */

.badge {
  display: inline-block;
  padding: 0.25em 0.55em;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--border-radius-pill);
  color: var(--color-white);
}
.bg-info {
  background-color: #0dcaf0;
}
.bg-info.text-dark {
  color: #000;
}
.bg-warning {
  background-color: #ffc107;
}
.bg-warning.text-dark {
  color: #000;
}
.bg-danger {
  background-color: var(--color-status-alert);
}
.bg-dark {
  background-color: var(--color-brand-2);
}
.bg-secondary {
  background-color: var(--color-grey-500);
}

/* =====================================================
   BOOTSTRAP BRIDGE — Pagination
   ===================================================== */

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.25rem;
  align-items: center;
}
.page-item .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.65rem;
  font-size: var(--fontsize-small);
  font-family: var(--fontfamily-default);
  color: var(--color-brand-2);
  text-decoration: none;
  border: 1px solid var(--color-grey-300);
  border-radius: var(--border-radius-input);
  background: var(--color-white);
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
}
.page-item .page-link:hover {
  background: var(--color-grey-100);
  color: var(--color-brand-1);
}
.page-item.active .page-link {
  background: var(--color-brand-1);
  border-color: var(--color-brand-1);
  color: var(--color-white);
  pointer-events: none;
}

/* Pagination wrapper nav bar */
.navbar {
  display: flex;
  align-items: center;
  padding: 0.75rem var(--spacing-xl);
}
.navbar-text {
  font-size: var(--fontsize-small);
  color: var(--color-grey-600);
}
.navbar-expand-sm {
  flex-wrap: nowrap;
}
.navbar-light {
  /* inherits from .navbar */
}

/* =====================================================
   BOOTSTRAP BRIDGE — text-nowrap
   ===================================================== */

.text-nowrap {
  white-space: nowrap;
}
.text-dark {
  color: #000;
}
.text-info {
  color: #0dcaf0;
}
