/**
 * JDA Visibility Grader — Additional CSS
 *
 * This is ADDITIVE to the existing styles on the /grader/ page.
 * It only adds styles for new elements introduced by the plugin:
 *   - Required email field treatment
 *   - Consent checkbox
 *   - Error banner
 *   - Contact modal
 *   - Score bar color for low scores
 *   - Not-found hero note anchor styling
 *
 * Naming uses the .jda- prefix for all new components to avoid collisions.
 *
 * @package JDA_Visibility_Grader
 */

/* --------------------------------------------------------------------------
   Consent checkbox field
-------------------------------------------------------------------------- */
.field--consent {
  margin-top: 8px;
  margin-bottom: 4px;
}

.consent-label {
  font-size: 13px;
  color: var(--muted, #64748B);
  line-height: 1.5;
  cursor: pointer;
}

.consent-label input[type="checkbox"] {
  accent-color: var(--blue, #0F62FE);
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Error banner
-------------------------------------------------------------------------- */
#jda-error-banner {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 6px;
  color: #991B1B;
  font-size: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

#jda-error-banner .btn {
  font-size: 13px;
  padding: 6px 14px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Score bar — low/red variant (plugin adds this; good/mid are in existing CSS)
-------------------------------------------------------------------------- */
.score-bar__fill--low {
  background: #EF4444;
}

/* --------------------------------------------------------------------------
   Contact modal
-------------------------------------------------------------------------- */
#jda-contact-modal {
  /* Base layout set inline via JS for display toggling.
     Styles here handle the inner box. */
}

.jda-modal__box {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15, 22, 42, 0.25);
  animation: jda-modal-in 0.18s ease;
}

@keyframes jda-modal-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

.jda-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted, #64748B);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.jda-modal__close:hover {
  background: #F1F5F9;
  color: var(--body, #1E293B);
}

#jda-contact-form .field {
  margin-bottom: 14px;
}

#jda-contact-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--body, #1E293B);
  margin-bottom: 5px;
}

#jda-contact-form input,
#jda-contact-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--body, #1E293B);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

#jda-contact-form input:focus,
#jda-contact-form textarea:focus {
  outline: none;
  border-color: var(--blue, #0F62FE);
  box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.12);
}

#jda-contact-form textarea {
  resize: vertical;
  min-height: 72px;
}

/* --------------------------------------------------------------------------
   Responsive: modal full-screen on small screens
-------------------------------------------------------------------------- */
@media (max-width: 520px) {
  .jda-modal__box {
    border-radius: 8px;
    padding: 24px 18px;
    max-height: 100vh;
  }
}

/* --------------------------------------------------------------------------
   v1.1.0: Recommended Engagement Panel
-------------------------------------------------------------------------- */
.jda-rec-panel {
  margin-top: 32px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #E2E8F0;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 22, 42, 0.06);
}

.jda-rec-panel__header {
  background: linear-gradient(135deg, #0F62FE 0%, #0043CE 100%);
  padding: 24px 28px 20px;
  color: #fff;
}

.jda-rec-panel__badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 10px;
  border: 1.5px solid rgba(255,255,255,0.4);
}

.jda-rec-panel__title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
}

.jda-rec-panel__sub {
  margin: 0;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
}

.jda-rec-panel__cards {
  padding: 20px 28px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jda-rec-card {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 14px 18px;
  background: #F8FAFC;
  transition: box-shadow 0.15s;
}

.jda-rec-card:hover {
  box-shadow: 0 2px 8px rgba(15, 22, 42, 0.08);
}

.jda-rec-card--featured {
  background: #EFF6FF;
  border: 2px solid #0F62FE;
  position: relative;
}

.jda-rec-card--featured::after {
  content: 'Recommended';
  position: absolute;
  top: -1px;
  right: 14px;
  background: #0F62FE;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 0 0 6px 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.jda-rec-card__label {
  font-size: 11px;
  font-weight: 700;
  color: #0F62FE;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.jda-rec-card__name {
  font-size: 15px;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 4px;
}

.jda-rec-card__price {
  font-size: 14px;
  font-weight: 700;
  color: #0F62FE;
  margin-left: 6px;
}

.jda-rec-card__desc {
  font-size: 13px;
  color: #64748B;
  line-height: 1.5;
}

.jda-rec-panel__cta {
  padding: 16px 28px 24px;
  text-align: center;
  border-top: 1px solid #E2E8F0;
  margin-top: 8px;
}

.jda-rec-cta-btn {
  display: inline-block;
  background: #0F62FE;
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: -0.2px;
}

.jda-rec-cta-btn:hover {
  background: #0043CE;
  transform: translateY(-1px);
}

.jda-rec-panel__cta-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #94A3B8;
}

@media (max-width: 640px) {
  .jda-rec-panel__header { padding: 18px 18px 14px; }
  .jda-rec-panel__cards  { padding: 14px 18px 4px; }
  .jda-rec-panel__cta    { padding: 14px 18px 18px; }
  .jda-rec-card--featured::after { display: none; }
}

/* --------------------------------------------------------------------------
   v1.1.1: LatePoint Booking Modal
-------------------------------------------------------------------------- */

/* Overlay */
.jda-lp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Modal card */
.jda-lp-modal-card {
  background: #ffffff;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  border-radius: 16px;
  padding: 0;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.18);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Header */
.jda-lp-modal-header {
  position: sticky;
  top: 0;
  background: #ffffff;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  flex-shrink: 0;
}

.jda-lp-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1E293B;
  line-height: 1.3;
}

/* Close button */
.jda-lp-modal-close {
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 24px;
  line-height: 1;
  color: #64748B;
  cursor: pointer;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.jda-lp-modal-close:hover {
  background: #f1f5f9;
  color: #1E293B;
}

/* Body */
.jda-lp-modal-body {
  padding: 24px;
  flex: 1 1 auto;
}

/* Loader */
.jda-lp-modal-loader {
  text-align: center;
  padding: 32px 0;
  color: #64748B;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.jda-lp-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #e5e7eb;
  border-top-color: #0F62FE;
  border-radius: 50%;
  animation: jda-lp-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes jda-lp-spin {
  to { transform: rotate(360deg); }
}

/* Mobile: full-screen */
@media (max-width: 640px) {
  .jda-lp-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .jda-lp-modal-card {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 16px 16px 0 0;
    width: 100%;
  }
}
