/* ==============================================================================
   ClassKit Global - Coordinate Grid Mystery Studio Stylesheet
   Pure Vanilla CSS | A4 210mm x 297mm Vector Print Engine
   Quadrant 1 Ordered Pairs & Spatial Geometry (CCSS 5.G.A.1, 5.G.A.2)
   Strict Rule 4 Compliance: Under 600 lines
   ============================================================================== */

:root {
  --coord-border-thick: 2px solid #0F172A;
  --coord-border-thin: 1.5px solid #CBD5E1;
  --coord-blue: #2563EB;
  --coord-blue-bg: rgba(37, 99, 235, 0.08);
  --coord-green: #16A34A;
  --coord-green-bg: rgba(22, 163, 74, 0.1);
}

/* ------------------------------------------------------------------------------
   1. Left Control Panel Options & Form Elements
   ------------------------------------------------------------------------------ */
.form-group-wb { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-label-wb { font-size: 12px; font-weight: 800; color: var(--text-main, #0F172A); }
.form-input-wb {
  height: 38px; padding: 0 12px; border: 1.5px solid var(--border-medium, #CBD5E1);
  border-radius: var(--radius-sm, 6px); font-size: 13px; font-weight: 700;
  color: var(--text-main, #0F172A); outline: none; background: #FFFFFF;
  box-sizing: border-box; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input-wb:focus { border-color: var(--primary, #4F46E5); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12); }
.form-row-checkboxes { display: flex; flex-direction: column; gap: 8px; }
.checkbox-label-wb { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-main, #1E293B); cursor: pointer; user-select: none; }
.checkbox-label-wb input[type="checkbox"] { accent-color: var(--primary, #4F46E5); width: 16px; height: 16px; cursor: pointer; }

.option-label-sub { font-size: 11.5px; font-weight: 700; color: var(--text-muted, #64748B); margin-bottom: 6px; letter-spacing: -0.2px; }
.segmented-control { display: flex; gap: 4px; background: #EDF2F7; padding: 4px; border-radius: 8px; }
.seg-btn {
  flex: 1; padding: 8px 4px; font-size: 11.5px; font-weight: 700; color: #64748B;
  background: transparent; border: none; border-radius: 6px; cursor: pointer;
  transition: all 0.15s ease; text-align: center; user-select: none; white-space: nowrap;
}
.seg-btn:hover { color: #0F172A; }
.seg-btn.active { background: #FFFFFF; color: #0F172A; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.layout-hint-text { font-size: 11.5px; color: #64748B; line-height: 1.4; margin-top: 8px; padding: 4px 6px; }

.btn-secondary-action {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 700; background: #FFFFFF; color: #334155; border: 1px solid #CBD5E1;
  cursor: pointer; transition: all 0.15s ease;
}
.btn-secondary-action:hover { background: #F8FAFC; border-color: #94A3B8; color: #0F172A; }

.btn-sidebar-generate {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px;
  border-radius: 10px; font-size: 13.5px; font-weight: 800; background: #F1F5F9; border: 1.5px solid #CBD5E1;
  color: #1E293B; cursor: pointer; transition: all 0.18s ease;
}
.btn-sidebar-generate:hover { background: #E2E8F0; border-color: #94A3B8; color: #0F172A; transform: translateY(-1px); }

/* ------------------------------------------------------------------------------
   2. A4 Printable Sheet Engine (Portrait 210mm x 297mm)
   ------------------------------------------------------------------------------ */
.print-pages-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.coord-sheet {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  max-height: 297mm;
  box-sizing: border-box;
  padding: 10mm 14mm 8mm 14mm;
  background: #FFFFFF;
  color: #0F172A;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

/* Standardized Worksheet Header Block (No Badges, Top-Right Metadata) */
.sheet-header-block {
  display: flex;
  flex-direction: column;
  gap: 2mm;
  border-bottom: 2px solid #0F172A;
  padding-bottom: 2mm;
  margin-bottom: 2.5mm;
}

.sheet-meta-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6mm;
  font-size: 8.5pt;
  font-weight: 700;
  color: #334155;
}

.sheet-name-field {
  display: inline-block;
  min-width: 26mm;
  border-bottom: 1.5px solid #0F172A;
}

.sheet-answer-tag {
  font-size: 9pt;
  font-weight: 900;
  color: #166534;
  background: #DCFCE7;
  padding: 1mm 3mm;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.sheet-main-title {
  font-size: 16pt;
  font-weight: 900;
  color: #0F172A;
  margin: 0;
  line-height: 1.2;
}

/* ------------------------------------------------------------------------------
   3. Directive Instructions Banner
   ------------------------------------------------------------------------------ */
.coord-hero-banner {
  background: #EEF2FF;
  border: 1.5px solid #C7D2FE;
  border-radius: 7px;
  padding: 2mm 3.5mm;
  margin-bottom: 2.5mm;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.coord-directive-text {
  font-size: 8.5pt;
  color: #1E293B;
  line-height: 1.35;
}

.coord-directive-text strong {
  color: #312E81;
}

.coord-answer-banner {
  background: #DCFCE7;
  border: 1.5px solid #86EFAC;
  border-radius: 7px;
  padding: 2mm 3.5mm;
  margin-bottom: 2.5mm;
  box-sizing: border-box;
}

.ans-banner-text {
  font-size: 8.5pt;
  color: #14532D;
  line-height: 1.35;
}

/* ------------------------------------------------------------------------------
   4. Side-by-Side Worksheet Workspace (Checklist + Vector Plane)
   ------------------------------------------------------------------------------ */
.coord-workspace {
  display: flex;
  gap: 5mm;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  margin-bottom: 2.5mm;
}

/* Left Column: Ordered Pairs Checklist */
.coord-points-column {
  flex: 0 0 82mm;
  width: 82mm;
  display: flex;
  flex-direction: column;
}

.coord-checklist-box {
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  padding: 2mm 2.5mm;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-sizing: border-box;
}

.coord-checklist-title {
  font-size: 8.8pt;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 1.2mm;
  display: flex;
  align-items: center;
  gap: 1.5mm;
  border-bottom: 1.5px solid #E2E8F0;
  padding-bottom: 1.2mm;
}

.coord-checklist-title .badge-count {
  font-size: 7.2pt;
  background: #E2E8F0;
  color: #475569;
  padding: 0.4mm 1.5mm;
  border-radius: 4px;
  margin-left: auto;
}

.coord-sequence-list {
  display: flex;
  flex-direction: column;
  gap: 1.5mm;
  overflow: visible;
  scrollbar-width: none;
  flex: 1;
}

.coord-sequence-list::-webkit-scrollbar {
  display: none;
}

.coord-line-group {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 5px;
  padding: 1.2mm 1.6mm;
  margin-bottom: 0.8mm;
}

.coord-line-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 7.2pt;
  font-weight: 800;
  color: #334155;
  margin-bottom: 0.8mm;
}

.line-badge {
  background: #EEF2FF;
  color: #3730A3;
  padding: 0.4mm 1.6mm;
  border-radius: 3px;
}

.line-point-count {
  color: #64748B;
  font-size: 6.8pt;
}

.coord-points-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8mm;
}

.coord-pill {
  display: flex;
  align-items: center;
  gap: 1mm;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 3px;
  padding: 0.5mm 0.8mm;
  font-size: 7.2pt;
  font-weight: 700;
  color: #0F172A;
  box-sizing: border-box;
}

.coord-pill.is-start {
  border-color: #93C5FD;
  background: #EFF6FF;
}

.coord-checkbox {
  width: 2.2mm;
  height: 2.2mm;
  border: 1.2px solid #64748B;
  border-radius: 2px;
  background: #FFFFFF;
  flex-shrink: 0;
}

.coord-text {
  font-family: 'Inter', monospace, sans-serif;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.coord-stop-divider {
  margin-top: 1mm;
  background: #FEF2F2;
  border: 1px dashed #F87171;
  border-radius: 3px;
  padding: 0.4mm 1.5mm;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1mm;
  font-size: 6.8pt;
  font-weight: 800;
  color: #991B1B;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

/* Right Column: High Resolution Vector Coordinate Plane */
.coord-plane-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.coord-plane-card {
  border: 2px solid #0F172A;
  border-radius: 8px;
  background: #FFFFFF;
  padding: 2mm;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  box-sizing: border-box;
}

.coord-plane-svg {
  width: 100%;
  height: 100%;
  max-width: 145mm;
  max-height: 145mm;
  aspect-ratio: 1 / 1;
}

/* Answer Key Reveal Banner */
.coord-reveal-banner {
  margin-top: 2.5mm;
  background: #F0FDF4;
  border: 1.5px solid #86EFAC;
  border-radius: 6px;
  padding: 2mm 3.5mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reveal-title {
  font-size: 10pt;
  font-weight: 900;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 2mm;
}

.reveal-desc {
  font-size: 8pt;
  font-weight: 600;
  color: #15803D;
}

/* ------------------------------------------------------------------------------
   5. Worksheet Footer Branding
   ------------------------------------------------------------------------------ */
.sheet-footer-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #CBD5E1;
  padding-top: 1.5mm;
  font-size: 7.5pt;
  color: #64748B;
  font-weight: 600;
}

.footer-brand-tag {
  font-weight: 800;
  color: #0F172A;
}

/* ------------------------------------------------------------------------------
   6. Print Media Styles (A4 Pagination Standard)
   ------------------------------------------------------------------------------ */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body, html {
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .studio-header,
  .studio-sidebar,
  .pro-modal-backdrop,
  #serverUserInfo {
    display: none !important;
  }

  .studio-body {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .studio-viewport {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  .a4-wrapper {
    padding: 0 !important;
    margin: 0 !important;
  }

  .print-pages-container {
    gap: 0 !important;
  }

  .coord-sheet {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: always !important;
    break-after: page !important;
    margin: 0 !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .coord-sheet:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .coord-checklist-box,
  .coord-sequence-list {
    overflow: visible !important;
    scrollbar-width: none !important;
  }
}

