/* ============================================================
   EF Strategy Advisor — Plugin Stylesheet
   Version 5.0
   Applies Nottman brand kit (Sage, Honey, Coral, Cream, Blush, Charcoal)
   ============================================================ */

/* ===== Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Nunito+Sans:wght@300;400;500;600;700&family=Caveat:wght@400;500&display=swap');

/* ===== Reset & Base ===== */
#ef-advisor-app {
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  color: #2D3436;
}

/* ===== Header ===== */
.efa-header {
  background-color: #5B8A72;
  color: white;
  padding: 16px 24px;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.efa-header h1 {
  margin: 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: white;
}

.efa-header-sub {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #F5E6DC;
  display: block;
  margin-top: 2px;
}

.efa-new-session-btn {
  background-color: #D4A853;
  color: #2D3436;
  border: none;
  padding: 8px 18px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Nunito Sans', sans-serif;
  transition: background-color 0.2s;
}

.efa-new-session-btn:hover {
  background-color: #c99a42;
}

/* ===== Two-Panel Container ===== */
.efa-container {
  display: flex;
  border: 1px solid #dde3ea;
  border-top: none;
  border-radius: 0 0 8px 8px;
  min-height: 600px;
  background: #FAF6F0;
}

.efa-left {
  width: 42%;
  background: white;
  border-right: 1px solid #dde3ea;
  display: flex;
  flex-direction: column;
}

.efa-right {
  width: 58%;
  background: #FAF6F0;
  padding: 24px;
  overflow-y: auto;
  position: relative;
}

/* ===== Tabs ===== */
.efa-tabs {
  display: flex;
  border-bottom: 2px solid #e8ecf0;
}

.efa-tab {
  flex: 1;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Nunito Sans', sans-serif;
  color: #6b7c93;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -2px;
}

.efa-tab:hover {
  color: #5B8A72;
}

.efa-tab.active {
  color: #5B8A72;
  border-bottom-color: #D4A853;
}

/* ===== Tab Content ===== */
.efa-tab-content {
  display: none;
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.efa-tab-content.active {
  display: block;
}

.efa-tab-content h3 {
  font-size: 12px;
  letter-spacing: 1px;
  color: #5B8A72;
  margin: 0 0 8px 0;
  font-weight: 700;
}

.efa-description {
  font-size: 13px;
  color: #5F5E5A;
  margin-bottom: 16px;
  line-height: 1.5;
}

.efa-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #5B8A72;
  margin-bottom: 6px;
  display: block;
}

.efa-hint {
  font-size: 12px;
  color: #5F5E5A;
  margin-top: 6px;
  margin-bottom: 16px;
}

/* ===== Coach Name Input ===== */
#ef-advisor-coach-name {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  font-family: 'Nunito Sans', sans-serif;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  box-sizing: border-box;
  color: #2D3436;
}

#ef-advisor-coach-name:focus {
  outline: none;
  border-color: #5B8A72;
  box-shadow: 0 0 0 3px rgba(91, 138, 114, 0.12);
}

/* ===== Student Description Input ===== */
#ef-advisor-input {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  font-family: 'Nunito Sans', sans-serif;
  border: 1px solid #d1d9e0;
  border-radius: 6px;
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.5;
  color: #2D3436;
}

#ef-advisor-input:focus {
  outline: none;
  border-color: #5B8A72;
  box-shadow: 0 0 0 3px rgba(91, 138, 114, 0.12);
}

/* ===== Quick Examples ===== */
.efa-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.efa-example {
  padding: 10px 14px;
  background: #F5E6DC;
  border-radius: 6px;
  font-size: 13px;
  color: #2D3436;
  cursor: pointer;
  transition: background-color 0.2s;
  line-height: 1.4;
  border-left: 3px solid #5B8A72;
}

.efa-example:hover {
  background: #efd9c8;
}

/* ===== Generate Button ===== */
#ef-advisor-submit {
  margin-top: 20px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Nunito Sans', sans-serif;
  background-color: #5B8A72;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#ef-advisor-submit:hover {
  background-color: #4a7560;
}

#ef-advisor-submit:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
}

/* ===== Empty State ===== */
#efa-empty-state {
  text-align: center;
  padding: 80px 40px;
  color: #888780;
}

.efa-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

#efa-empty-state h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  color: #5B8A72;
  margin: 0 0 8px 0;
}

#efa-empty-state p {
  font-size: 14px;
  color: #888780;
  max-width: 360px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

/* ===== Progress Indicator ===== */
#efa-progress {
  text-align: center;
  padding: 60px 40px;
}

.efa-progress-container {
  max-width: 380px;
  margin: 0 auto;
}

.efa-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #F5E6DC;
  border-top: 4px solid #5B8A72;
  border-radius: 50%;
  animation: efaSpin 1s linear infinite;
  margin: 0 auto 28px;
}

@keyframes efaSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.efa-progress-stages {
  text-align: left;
}

.efa-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 6px;
  font-size: 13px;
  color: #888780;
  transition: all 0.3s;
}

.efa-stage.active {
  background: #F5E6DC;
  color: #5B8A72;
  font-weight: 600;
}

.efa-stage.done {
  color: #5B8A72;
}

.efa-stage-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* ===== Status Messages ===== */
#ef-advisor-status {
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
}

#ef-advisor-status.error {
  display: block !important;
  background-color: #fef2f2;
  color: #b91c1c;
}

/* ===== Inline Input Error (left panel, near textarea) — v5.2 ===== */
.efa-input-error {
  margin-top: 6px;
  margin-bottom: 6px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  background-color: #fef2f2;
  color: #b91c1c;
  border-left: 3px solid #b91c1c;
  line-height: 1.4;
}

/* ===== Screen-side Print Reminder Banner (above report actions) — v5.2 ===== */
.efa-screen-print-reminder {
  background: #FDF7E6;
  border: 1px solid #D4A853;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  color: #2D3436;
}

.efa-screen-print-reminder-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: #D4A853;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: Georgia, serif;
  line-height: 1;
}

.efa-screen-print-reminder-content {
  flex: 1;
}

.efa-screen-print-reminder-title {
  font-weight: 600;
  color: #8A6B2C;
  margin: 0 0 4px 0;
  font-size: 13px;
}

.efa-screen-print-reminder-text {
  margin: 0;
  color: #2D3436;
}

.efa-screen-print-reminder-text strong {
  font-weight: 600;
}

/* ===== Report Actions Bar ===== */
#efa-report-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #dde3ea;
}

#efa-report-actions button {
  padding: 8px 16px;
  font-size: 13px;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

#efa-report-actions button:first-child {
  background: white;
  color: #5B8A72;
  border: 1px solid #5B8A72;
}

#efa-report-actions button:first-child:hover {
  background: #F5E6DC;
}

#efa-report-actions button:last-child {
  background: #5B8A72;
  color: white;
  border: 1px solid #5B8A72;
}

#efa-report-actions button:last-child:hover {
  background: #4a7560;
}

/* ===== Report Container =====
   The generated report HTML comes with its own embedded styles.
   We scope any plugin overrides to #ef-advisor-report to avoid leaking. */
#ef-advisor-report {
  background: white;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ===== Browse by Domain ===== */
.efa-domain-item {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.efa-domain-item:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.efa-domain-header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: white;
  transition: background-color 0.2s;
}

.efa-domain-header:hover {
  background: #FAF6F0;
}

.efa-domain-header-left h4 {
  margin: 0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 15px;
  font-weight: 400;
  color: #5B8A72;
}

.efa-domain-header-left .efa-domain-tier {
  font-size: 10px;
  color: #888780;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.efa-domain-count {
  background: #F5E6DC;
  color: #5B8A72;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.efa-domain-strategies {
  display: none;
  padding: 0 14px 14px;
  background: #FAF6F0;
  border-top: 1px solid #e8ecf0;
}

.efa-domain-strategies.open {
  display: block;
}

.efa-strat-item {
  padding: 10px 0;
  border-bottom: 1px solid #F5E6DC;
}

.efa-strat-item:last-child {
  border-bottom: none;
}

.efa-strat-name {
  font-size: 13px;
  font-weight: 700;
  color: #2D3436;
  margin-bottom: 3px;
}

.efa-strat-ages {
  font-size: 10px;
  color: #888780;
  margin-left: 6px;
  font-weight: normal;
}

.efa-strat-desc {
  font-size: 12px;
  color: #5F5E5A;
  line-height: 1.5;
  margin-bottom: 4px;
}

.efa-strat-tool {
  font-size: 11px;
  color: #888780;
  margin-bottom: 4px;
}

.efa-strat-lp {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #D4A853;
  text-decoration: none;
  margin-top: 2px;
}

.efa-strat-lp:hover {
  text-decoration: underline;
}

/* ===== Lesson Plan Overlay ===== */
#efa-lp-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 52, 54, 0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#efa-lp-overlay.active {
  display: flex;
}

.efa-lp-modal {
  background: white;
  width: 90%;
  max-width: 900px;
  height: 90vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.efa-lp-toolbar {
  background: #5B8A72;
  color: white;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.efa-lp-toolbar-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 16px;
  font-weight: 400;
}

.efa-lp-toolbar-buttons {
  display: flex;
  gap: 8px;
}

.efa-lp-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  background: #D4A853;
  color: #2D3436;
}

.efa-lp-btn:hover {
  background: #c99a42;
}

.efa-lp-btn-close {
  background: transparent;
  color: white;
  border: 1px solid white;
}

.efa-lp-btn-close:hover {
  background: rgba(255,255,255,0.15);
}

.efa-lp-iframe {
  flex: 1;
  border: none;
  width: 100%;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .efa-container {
    flex-direction: column;
  }
  .efa-left,
  .efa-right {
    width: 100%;
  }
  .efa-right {
    border-top: 1px solid #dde3ea;
  }
}

/* ===== Print ===== */
@media print {
  .efa-header,
  .efa-left,
  #efa-report-actions,
  .efa-new-session-btn,
  .efa-screen-print-reminder {
    display: none !important;
  }
  .efa-container {
    border: none;
  }
  .efa-right {
    width: 100%;
    padding: 0;
    background: white;
  }
  #ef-advisor-report {
    box-shadow: none;
    padding: 0;
  }
}
