/* ===========================================================
   COCKPIT.CSS — Toolkit #4 Local UI (FINAL)
   Controls:
   - Header
   - Reflex cards + dual button layout
   - Sector switcher
   - 6-Month Navigator (full-width with month cards)
   - Graphic dock
   - Small modal (quick pulse)
   - Full modal (deep assessment)
=========================================================== */

/* ---------------------------------------
   ROOT + BASE
--------------------------------------- */
:root {
  --teal: #2F7C7D;
  --teal-light: #3DA5A6;
  --teal-dark: #245D5E;

  --slate: #2D353E;
  --slate-dark: #232B33;
  --slate-light: #3C4651;

  --soft-gray: #F3F5F7;
  --border-gray: #E2E6E9;
  --white: #FFFFFF;

  --text-dark: #1F1F1F;
  --text-light: #F8FAFB;
  --text-muted: #A9B1B8;

  --radius: 8px;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
}

body {
  background-color: var(--slate-dark);
  color: var(--text-light);
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
}

/* ---------------------------------------
   HEADER
--------------------------------------- */
.cockpit-header {
  background: linear-gradient(135deg, var(--slate-dark), var(--teal-dark));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.4rem 2rem 1.6rem;
}

.cockpit-title {
  font-size: 2rem;
  margin: 0;
  font-weight: 600;
}

.subtitle {
  font-size: 0.98rem;
  opacity: 0.9;
  margin-top: 0.35rem;
}

/* ---------------------------------------
   MAIN LAYOUT
--------------------------------------- */
#layout-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 1.75rem;
  padding: 2rem;
  box-sizing: border-box;
}

#cockpit-main {
  min-width: 0;
}

/* ---------------------------------------
   REFLEX CARDS
--------------------------------------- */
#reflex-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.25rem;
}

.reflex-card {
  background: radial-gradient(circle at top left, var(--teal-light), var(--slate));
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  min-height: 140px;
}

.reflex-title {
  font-size: 1.06rem;
  font-weight: 600;
  margin: 0 0 0.9rem 0;
}

/* ---------------------------------------
   DUAL BUTTON ROW (Quick + Full)
--------------------------------------- */
.dual-btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.reflex-btn {
  flex: 1;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s ease;
}

/* Primary = Quick */
.quick-btn {
  background-color: var(--teal);
  color: var(--white);
}
.quick-btn:hover {
  background-color: var(--teal-dark);
}

/* Secondary = Full */
.secondary-btn {
  background-color: var(--slate);
  color: var(--soft-gray);
}
.secondary-btn:hover {
  background-color: var(--slate-light);
}

/* ---------------------------------------
   SECTOR SWITCHER
--------------------------------------- */
#sector-switcher {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.sector-tab {
  padding: 0.45rem 1rem;
  background-color: rgba(60, 70, 81, 0.7);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--soft-gray);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.sector-tab:hover {
  background-color: var(--slate-light);
}

.sector-tab.active {
  background-color: var(--teal);
  border-color: var(--teal-light);
  color: var(--white);
}

/* ---------------------------------------
   NAVIGATOR (Full-width with month cards)
--------------------------------------- */
#navigator {
  grid-column: 1 / -1;
  background-color: var(--white);
  color: var(--text-dark);
  border-radius: var(--radius);
  padding: 1.8rem 1.5rem;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.navigator-title {
  font-size: 1.15rem;
  margin: 0 0 1.1rem;
  font-weight: 600;
  color: var(--slate);
}

.navigator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}

/* Month cards grid - 3 columns x 2 rows for optimal usability */
/* Multiple selectors for maximum specificity to override theme.css */
#navigator #nav-months.months-grid,
#navigator .months-grid,
#nav-months.months-grid,
div#nav-months.months-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1rem !important;
  margin: 1.5rem 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Individual month card styling */
.month-card {
  background: var(--soft-gray);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.month-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--teal-dark);
  margin: 0 0 0.6rem 0;
  border-bottom: 2px solid var(--teal-light);
  padding-bottom: 0.4rem;
}

.month-content {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  background: #2D353E !important;
  color: #FFFFFF !important;
}

.month-content::placeholder {
  color: #CCCCCC !important;
  opacity: 1 !important;
}

.month-content:focus {
  outline: 2px solid var(--teal-light);
  border-color: var(--teal);
}

.navigator-actions {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.cta-primary {
  background-color: var(--teal);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 500;
}
.cta-primary:hover {
  background-color: var(--teal-dark);
}

.cta-secondary {
  background-color: var(--slate);
  color: var(--white);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 500;
}
.cta-secondary:hover {
  background-color: var(--slate-light);
}

/* ---------------------------------------
   GRAPHIC DOCK
--------------------------------------- */
.layout-graphic {
  background-color: var(--slate);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-md);
  height: fit-content;
  align-self: start;
}

#toolkit-graphic {
  width: 100%;
  border-radius: var(--radius);
}

.graphic-placeholder {
  text-align: center;
  margin-top: 0.8rem;
  padding: 0.9rem;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  color: var(--soft-gray);
}

/* ---------------------------------------
   SMALL MODAL
--------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 18, 24, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: var(--slate-light);
  border-radius: var(--radius);
  width: 92%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  padding: 1.4rem 1.5rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--soft-gray);
  font-size: 1.4rem;
  cursor: pointer;
}
.modal-close:hover {
  color: var(--white);
}

.modal-textarea {
  width: 100%;
  min-height: 80px;
  border-radius: var(--radius);
  border: 1px solid var(--border-gray);
  padding: 0.6rem;
  margin-top: 0.5rem;
  font-family: inherit;
}

/* ---------------------------------------
   FULL MODAL (Scrollable)
--------------------------------------- */
.full-modal {
  max-width: 760px;
  width: 95%;
  max-height: 92vh;
  overflow-y: auto;
  padding-bottom: 1.5rem;
}

.full-q-title {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.full-q-text {
  margin: 0 0 0.4rem;
  opacity: 0.9;
}

.full-q-input {
  width: 100%;
  min-height: 90px;
  border-radius: var(--radius);
  padding: 0.6rem;
  border: 1px solid var(--border-gray);
  resize: vertical;
  font-family: inherit;
  margin-bottom: 1.2rem;
}

/* ---------------------------------------
   RESPONSIVE
--------------------------------------- */
@media (max-width: 900px) {
  .months-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  .months-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 960px) {
  #layout-wrapper {
    grid-template-columns: 1fr;
  }
  .layout-graphic {
    order: -1;
  }
}

@media (max-width: 700px) {
  #layout-wrapper {
    padding: 1.25rem 1rem;
  }
  #reflex-cards {
    grid-template-columns: 1fr;
  }
  .navigator-grid,
  .months-grid {
    grid-template-columns: 1fr;
  }
  .modal-card {
    width: 96%;
  }
}

@media (max-width: 600px) {
  .months-grid {
    grid-template-columns: 1fr;
  }
}