/* Modal is ALWAYS hidden by default — JS opens it via style.display=flex */
.ve-bdr-modal,
.ve-bdr-modal--hidden {
  display: none !important;
}
/* Only when JS sets aria-hidden=false does it become visible */
.ve-bdr-modal[aria-hidden="false"] {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* ============================================================
   VE Broken Download Reporter — Stylesheet
   ============================================================ */

/* Trigger button */
.ve-bdr-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ve-bdr-trigger {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
  font-family: system-ui, sans-serif;
  background: rgba(250, 189, 20, 0.18);
  transition: background 0.15s;
  line-height: 1.4;
}
.ve-bdr-trigger:hover {
  background: rgba(250, 189, 20, 0.32);
}
.ve-bdr-success-msg {
  font-size: 13px;
  color: #16a34a;
  font-weight: 600;
}

/* ── Modal overlay ── */
.ve-bdr-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  display: flex;          /* toggled via JS: none ↔ flex */
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ve-bdr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

/* ── Dialog ── */
.ve-bdr-dialog {
  position: relative;
  z-index: 1;               /* above overlay */
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  font-family: system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Head ── */
.ve-bdr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #1c1917, #292524);
  padding: 18px 20px;
  flex-shrink: 0;
  position: relative;
}
.ve-bdr-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 0% 50%, rgba(244,171,62,.2) 0%, transparent 70%);
  pointer-events: none;
}
.ve-bdr-head-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  font-size: 22px;
}
.ve-bdr-head-title {
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  margin-bottom: 3px;
  line-height: 1.3;
}
.ve-bdr-head-sub {
  font-size: 12.5px;
  color: #a8a29e;
}
.ve-bdr-x {
  position: relative;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  padding: 0;
}
.ve-bdr-x:hover { background: rgba(255,255,255,.2); }

/* ── Body ── */
.ve-bdr-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

/* ── Fields ── */
.ve-bdr-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ve-bdr-lbl {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  display: block;
}
.ve-bdr-req     { color: #dc2626; }
.ve-bdr-optional{ font-size: 12px; font-weight: 500; color: #9ca3af; }
.ve-bdr-hint    { font-size: 12px; color: #6b7280; }
.ve-bdr-err     { font-size: 12.5px; color: #dc2626; font-weight: 600; }

/* ── Email input ── */
.ve-bdr-email-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  font-family: inherit;
}
.ve-bdr-email-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.ve-bdr-email-input.is-invalid { border-color: #dc2626; }

/* Logged-in badge */
.ve-bdr-loggedin-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ve-bdr-badge-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
  font-size: 12.5px;
  font-weight: 700;
}

/* ── Link type grid ──
   Radio inputs are visually hidden but remain in the DOM so :checked works.
   We do NOT use display:none or visibility:hidden because some browsers
   skip :checked on hidden inputs.
   position:fixed with zero dimensions keeps them out of layout entirely.
*/
.ve-bdr-link-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 440px) {
  .ve-bdr-link-grid { grid-template-columns: repeat(4, 1fr); }
}

.ve-bdr-link-label {
  cursor: pointer;
  display: block;
  margin: 0;
  padding: 0;
}

/* Hide the raw radio without removing it from layout flow */
.ve-bdr-link-radio {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ve-bdr-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 8px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.ve-bdr-link-label:hover .ve-bdr-link-card {
  border-color: #fbbf24;
  background: #fffdf7;
}
.ve-bdr-link-icon { font-size: 20px; }
.ve-bdr-link-name { font-size: 11.5px; font-weight: 600; color: #374151; line-height: 1.3; }

/* Selected state driven by JS class (more reliable than :checked across themes) */
.ve-bdr-link-card.is-selected {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}
.ve-bdr-link-card.is-selected .ve-bdr-link-name {
  color: #92400e;
  font-weight: 800;
}

/* ── Textarea ── */
.ve-bdr-desc {
  width: 100%;
  padding: 10px 12px;
  font-size: 13.5px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  outline: none;
  resize: vertical;
  min-height: 100px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.ve-bdr-desc:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}

.ve-bdr-char-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ve-bdr-char-count { font-size: 12px; color: #9ca3af; }
.ve-bdr-char-ok    { font-size: 12px; color: #16a34a; font-weight: 700; }

/* ── Upload ── */
.ve-bdr-file {
  /* visually hidden, triggered via label */
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.ve-bdr-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  border: 1.5px dashed #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.ve-bdr-upload-label:hover {
  border-color: #f59e0b;
  background: #fffbeb;
}
.ve-bdr-upload-icon { font-size: 22px; }
.ve-bdr-upload-text { font-size: 13.5px; font-weight: 600; color: #374151; }
.ve-bdr-upload-sub  { font-size: 11.5px; color: #9ca3af; }

.ve-bdr-file-name {
  font-size: 12.5px;
  color: #16a34a;
  font-weight: 600;
  padding: 5px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
}

/* ── Footer ── */
.ve-bdr-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #f3f4f6;
  flex-shrink: 0;
}
.ve-bdr-btn-cancel {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #374151;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
}
.ve-bdr-btn-cancel:hover { background: #f3f4f6; }

.ve-bdr-btn-submit {
  background: linear-gradient(180deg, #f59e0b, #d97706);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13.5px;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(217,119,6,.25);
  transition: opacity 0.15s;
}
.ve-bdr-btn-submit:hover    { opacity: 0.92; }
.ve-bdr-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* body scroll lock when modal open */
body.ve-bdr-locked { overflow: hidden !important; }
