/* MODAL OVERLAYS & BASE DIALOGS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 2px solid #EAE0D5;
  -webkit-overflow-scrolling: touch;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-crimson) 100%);
  color: white;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1;
}

.close-modal-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

/* SCRIPTURE PICKER MODAL (SIDE-BY-SIDE 39 OLD + 27 NEW) */
.picker-steps-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid #EAE0D5;
  padding-bottom: 8px;
}

.picker-step-pill {
  flex: 1;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  background: #F5EFEB;
  color: #777;
  cursor: pointer;
}

.picker-step-pill.active {
  background: var(--primary-crimson);
  color: white;
}

.side-by-side-testaments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.testament-col {
  display: flex;
  flex-direction: column;
}

.testament-header-title {
  font-weight: 800;
  font-size: 14px;
  color: var(--primary-crimson);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #E8DCCB;
}

.testament-books-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.picker-btn {
  text-align: left;
  background: #FAF6F0;
  border: 1px solid #E8DCCB;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.picker-btn:hover {
  background: #F0E6D8;
}

.picker-btn.active {
  background: var(--primary-crimson);
  color: white;
  border-color: var(--primary-crimson);
}

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

/* HUB & ADMIN STYLES */
.feature-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid #EAE0D5;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.google-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #E8F0FE;
  color: #1A73E8;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}

.admin-tab-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #CCC;
  background: #F5EFEB;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

.admin-tab-btn.active {
  background: var(--primary-crimson);
  color: white;
  border-color: var(--primary-crimson);
}

/* BADGE UNLOCK CELEBRATION TOAST */
.badge-unlock-toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border: 2px solid #FFD700;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1250;
  font-weight: 800;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.badge-unlock-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  .modal-dialog {
    max-width: 95vw;
    margin: 8px auto;
  }
}
