/* Shared popup and button styles for the Pedigree Tree and Family Builder pages.
   Both pages load this file so their dialogs look and behave the same. */

.vr-overlay {
  position: fixed; inset: 0; z-index: 15000;
  display: flex; justify-content: center; align-items: center;
  padding: 16px; background: rgba(0, 0, 0, 0.6);
}
.vr-modal {
  width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; box-sizing: border-box;
  background: #f5eedc; border: 3px solid #4a3a22; border-radius: 10px; padding: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: 'Cormorant Garamond', serif; color: #2a1f10; text-align: left;
}
.vr-modal.narrow { max-width: 360px; text-align: center; }
.vr-modal-title {
  font-family: 'Cinzel Decorative', serif; font-size: 17px; color: #3e2b1a;
  margin: 0 0 10px; line-height: 1.3;
}
.vr-modal-title.danger { color: #991b1b; }
.vr-modal-text { font-size: 15px; line-height: 1.5; margin: 0 0 12px; }
.vr-modal-text:last-child { margin-bottom: 0; }
.vr-note {
  background: #fff8e1; border: 1px solid #e6c27a; border-radius: 6px;
  padding: 10px 12px; margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: #5a4320;
}
.vr-note .vr-btn { margin-top: 8px; }
.vr-label {
  display: block; margin: 0 0 4px; font-family: 'Cinzel Decorative', serif;
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #6b5537;
}
.vr-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 2px solid #8a7a5a; border-radius: 6px; background: #fff;
  font-family: 'Cormorant Garamond', serif; font-size: 16px; color: #2a1f10;
}
.vr-input:focus { outline: none; border-color: #4a3a22; }

.vr-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 42vh; overflow-y: auto; }
.vr-list-head {
  font-family: 'Cinzel Decorative', serif; font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; color: #8a7a5a; margin-top: 4px;
}
.vr-list-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: #fff; border: 1.5px solid #c9b896; border-radius: 6px; padding: 9px 12px;
  font-family: 'Cormorant Garamond', serif; font-size: 15px; color: #2a1f10;
}
.vr-list-item:hover, .vr-list-item:focus { border-color: #4a3a22; outline: none; }
.vr-list-item b { font-weight: 600; }
.vr-list-item .sub { display: block; font-size: 12px; color: #6b5537; margin-top: 2px; }
.vr-empty { font-size: 14px; color: #6b5537; font-style: italic; padding: 6px 2px; }

.vr-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.vr-modal.narrow .vr-actions { justify-content: center; }
.vr-btn {
  padding: 9px 16px; border: 2px solid #4a3a22; border-radius: 6px; cursor: pointer;
  background: #f5eedc; color: #4a3a22;
  font-family: 'Cinzel Decorative', serif; font-size: 12px; line-height: 1.2;
}
.vr-btn:hover { background: #ece2c8; }
.vr-btn.primary { background: #4a3a22; color: #f5eedc; }
.vr-btn.primary:hover { background: #3e2b1a; }
.vr-btn.green { background: #4a6b4a; border-color: #4a6b4a; color: #fff; }
.vr-btn.green:hover { background: #3d5a3d; }
.vr-btn.danger { background: #5c2a2a; border-color: #5c2a2a; color: #f5eedc; }
.vr-btn.danger:hover { background: #4a2020; }
.vr-btn.block { display: block; width: 100%; text-align: center; margin-bottom: 8px; }
.vr-btn:disabled { opacity: 0.45; cursor: default; }

/* GEDCOM popup: two big choices side by side, stacked on phones */
.vr-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.vr-choice {
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  background: #fff; border: 1.5px solid #c9b896; border-radius: 8px; padding: 14px 10px;
  font-family: 'Cormorant Garamond', serif; color: #2a1f10; text-align: center;
}
.vr-choice:hover { border-color: #4a3a22; }
.vr-choice .big { font-size: 22px; }
.vr-choice b { font-family: 'Cinzel Decorative', serif; font-size: 12px; font-weight: 400; color: #3e2b1a; }
.vr-choice span { font-size: 13px; color: #6b5537; }
@media (max-width: 420px) { .vr-choice-grid { grid-template-columns: 1fr; } }

/* Privacy pop-up: sized to the screen so it never needs scrolling.
   Wider on computers (shorter lines), tighter as the window gets shorter. */
.vr-priv-overlay {
  display: none; position: fixed; inset: 0; z-index: 10003;
  background: rgba(0,0,0,0.85); justify-content: center; align-items: center; padding: 12px;
}
.vr-priv-card {
  background: #f5eedc; border: 3px solid #4a3a22; border-radius: 8px;
  width: min(100%, 400px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  overflow-y: auto; padding: clamp(12px, 3vh, 24px) clamp(14px, 4vw, 24px);
  font-family: 'Cormorant Garamond', serif;
}
.vr-priv-head { text-align: center; margin-bottom: clamp(8px, 2vh, 16px); }
.vr-priv-lock { font-size: clamp(26px, 6vh, 48px); line-height: 1.1; margin-bottom: clamp(2px, 1vh, 8px); }
.vr-priv-title { font-family: 'Cinzel Decorative', serif; font-size: 18px; color: #3e2b1a; margin-bottom: 4px; }
.vr-priv-sub { font-size: 13px; color: #6b5537; }
.vr-priv-list { font-size: 13px; color: #2a1f10; line-height: 1.55; margin-bottom: clamp(8px, 2vh, 16px); }
.vr-priv-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: clamp(4px, 1.2vh, 10px); }
.vr-priv-item:last-child { margin-bottom: 0; }
.vr-priv-icon { font-size: 18px; flex-shrink: 0; width: 22px; text-align: center; }
.vr-priv-compare {
  background: #e8f0e0; border: 1px solid #6b8e5a; border-radius: 6px; padding: 8px 10px;
  margin-bottom: clamp(8px, 2vh, 16px); font-size: 12px; color: #3a5a2a; line-height: 1.45;
}
.vr-priv-actions { display: flex; flex-direction: column; gap: 4px; }
.vr-priv-ok {
  width: 100%; padding: 12px; border: 2px solid #4a3a22; border-radius: 4px; background: #4a3a22;
  color: #f5eedc; font-family: 'Cinzel Decorative', serif; font-size: 13px; cursor: pointer;
}
.vr-priv-forever {
  width: 100%; padding: 8px; border: none; background: transparent; color: #6b5537;
  font-family: 'Cormorant Garamond', serif; font-size: 12px; cursor: pointer; text-decoration: underline;
}
/* Computers and tablets: a wider card means fewer lines per point */
@media (min-width: 700px) {
  .vr-priv-card { width: min(100%, 600px); }
  .vr-priv-actions { flex-direction: row; align-items: center; gap: 12px; }
  .vr-priv-ok { flex: 1; }
  .vr-priv-forever { width: auto; flex-shrink: 0; }
}
/* Short windows (laptops, phones): lock beside the title, tighter lines */
@media (max-height: 700px) {
  .vr-priv-head { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 10px; }
  .vr-priv-lock { grid-row: span 2; margin: 0; }
  .vr-priv-title { font-size: 16px; margin-bottom: 0; }
  .vr-priv-list { line-height: 1.4; }
  .vr-priv-ok { padding: 9px; }
}
/* Small phones: smaller type (laptops with short windows keep full size) */
@media (max-height: 520px) and (max-width: 699px), (max-height: 460px) {
  .vr-priv-list { font-size: 12px; line-height: 1.35; }
  .vr-priv-compare { font-size: 11px; padding: 6px 8px; }
  .vr-priv-forever { padding: 4px; }
}
/* Very short (landscape phones): use the width, drop the subtitle */
@media (max-height: 460px) {
  .vr-priv-card { width: min(100%, 640px); }
  .vr-priv-sub { display: none; }
  .vr-priv-lock { grid-row: auto; font-size: 22px; }
  .vr-priv-actions { flex-direction: row; align-items: center; gap: 12px; }
  .vr-priv-ok { flex: 1; }
  .vr-priv-forever { width: auto; flex-shrink: 0; }
}
