/**
 * Portal Enhancement Styles
 * Interview Scheduler, Launcher, Email Notifications, Onboarding
 * v1.1 — 2026-08-24
 *
 * Was never <link>-ed into portal/index.html despite styling components
 * that were reconnected the same day (interview-scheduler-integration.js,
 * email-notification-panel.js, onboarding-tour.js) — those were rendering
 * completely unstyled in production. Linked in 2026-08-24 after removing
 * the .btn/.btn-primary/.btn-secondary block that duplicated and would
 * have overridden index.html's own versions with different sizing.
 */

:root {
  --navy: #1B3A6B;
  --teal: #0E8B8B;
  --lteal: #D6F0F0;
  --lnavy: #D8E4F0;
  --lgrey: #F2F5F8;
  --orange: #E07B39;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --muted: #4B5768;
}

/* ════════════════════════════════════════════════════════════════════════════
   INTERVIEW SCHEDULER INTEGRATION
   ════════════════════════════════════════════════════════════════════════════ */

.interview-scheduler-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
  overflow: hidden;
  margin-bottom: 20px;
}

.interview-scheduler-card .card-header {
  background: var(--lnavy);
  padding: 20px;
  border-bottom: 2px solid var(--lteal);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.interview-scheduler-card .card-header h3 {
  color: var(--navy);
  font-size: 18px;
  margin-bottom: 5px;
}

.interview-scheduler-card .card-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.interview-scheduler-card .card-body {
  padding: 20px;
}

.appointment-info {
  background: var(--lteal);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
}

.appointment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(14, 139, 139, 0.2);
}

.appointment-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.appointment-row label {
  font-weight: 600;
  color: var(--navy);
  font-size: 13px;
}

.appointment-row .value {
  color: var(--teal);
  font-weight: 700;
  font-size: 14px;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.status-confirmed {
  background: #d1fae5;
  color: var(--success);
}

.status-badge.status-pending {
  background: #fef3c7;
  color: var(--warning);
}

/* Added 2026-08-24 — dashboard-participant.js's questionnaire cards use
   .status-badge with these two modifiers, but they were never defined
   anywhere; cards rendered with the base pill shape only, no color. */
.status-badge.status-completed {
  background: #d1fae5;
  color: var(--success);
}

.status-badge.status-in-progress {
  background: var(--lteal);
  color: var(--teal);
}

.no-appointment {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-style: italic;
}

.appointment-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* .btn/.btn-primary/.btn-secondary intentionally NOT redefined here — this
   file previously shadowed index.html's own versions of those classes
   (10px/20px padding vs. index.html's 14px/28px, 8px radius vs. 10px),
   which would have silently resized every primary/secondary button across
   the whole portal the moment this file was linked in. Removed 2026-08-24
   when this file was finally wired in — see index.html for the canonical
   .btn-primary/.btn-secondary. */

.btn-secondary-small {
  padding: 6px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 6px;
  cursor: pointer;
}

.btn-primary-small {
  padding: 6px 12px;
  font-size: 12px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════════════════════════
   INTERVIEW LAUNCHER
   ════════════════════════════════════════════════════════════════════════════ */

.interview-launcher-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
  overflow: hidden;
  margin-bottom: 20px;
}

.interview-launcher-card .card-header {
  background: var(--lnavy);
  padding: 20px;
  border-bottom: 2px solid var(--lteal);
}

.interview-launcher-card .card-header h3 {
  color: var(--navy);
  font-size: 18px;
  margin-bottom: 5px;
}

.interview-launcher-card .card-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.interview-launcher-card .card-body {
  padding: 20px;
}

.launcher-status {
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.launcher-status.ready {
  background: #d1fae5;
  border-left: 4px solid var(--success);
}

.launcher-status.not-ready {
  background: #fef3c7;
  border-left: 4px solid var(--warning);
}

.status-message {
  margin-bottom: 15px;
}

.status-message p {
  margin: 0;
  color: var(--navy);
  font-weight: 500;
}

.launcher-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════════════════
   EMAIL NOTIFICATION PANEL
   ════════════════════════════════════════════════════════════════════════════ */

.email-bell {
  position: relative;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.email-bell:hover {
  transform: scale(1.1);
}

.unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

#emailNotificationPanel {
  position: fixed;
  right: 0;
  top: 60px;
  width: 350px;
  max-width: 100%;
  background: #fff;
  border-radius: 0 0 12px 0;
  box-shadow: -4px 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 999;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  display: none;
}

#emailNotificationPanel.show {
  display: block;
}

.email-panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.panel-header {
  background: var(--navy);
  color: #fff;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--teal);
}

.panel-header h4 {
  margin: 0;
  font-size: 16px;
}

.close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.panel-body {
  padding: 0;
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
}

.no-emails {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 13px;
}

.email-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.email-item {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
}

.email-item:hover {
  background: var(--lgrey);
}

.email-item.unread {
  background: var(--lteal);
  font-weight: 500;
}

.email-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.email-type {
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}

.email-time {
  color: var(--muted);
  font-size: 12px;
}

.email-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.delivery-status {
  color: var(--teal);
}

.mark-read-btn {
  background: transparent;
  border: none;
  color: var(--teal);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
}

/* ════════════════════════════════════════════════════════════════════════════
   ONBOARDING TOUR
   ════════════════════════════════════════════════════════════════════════════ */

.onboarding-tooltip {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  padding: 0;
  border: 2px solid var(--teal);
  box-sizing: border-box;
  max-width: calc(100vw - 32px);
}

.tooltip-content {
  padding: 20px;
}

.tooltip-content h3 {
  color: var(--navy);
  font-size: 16px;
  margin: 0 0 10px 0;
}

.tooltip-content p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 15px 0;
}

.tooltip-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.btn-close-tooltip {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-tooltip:hover {
  color: var(--navy);
}

.tooltip-progress {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.onboarding-highlight {
  box-shadow: 0 0 0 3px var(--teal), 0 0 0 6px rgba(14, 139, 139, 0.2) !important;
  border-radius: 8px;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  #emailNotificationPanel {
    width: 100%;
    right: 0;
    top: 50px;
    max-height: calc(100vh - 60px);
    border-radius: 12px 12px 0 0;
  }

  .appointment-actions {
    flex-direction: column;
  }

  .btn, .btn-primary, .btn-secondary {
    width: 100%;
  }

  .launcher-actions {
    flex-direction: column;
  }

  .launcher-actions button,
  .launcher-actions a {
    width: 100%;
  }

  .onboarding-tooltip {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    left: 16px !important;
    right: 16px !important;
    box-sizing: border-box !important;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   WITHDRAWAL FORM & CONSENT DISPLAY
   Added 2026-08-24 — reconnected the same day as the components above, but
   their container/layout classes (as opposed to their buttons/form-groups,
   already covered by index.html's shared rules) had no CSS anywhere.
   ════════════════════════════════════════════════════════════════════════════ */

.withdrawal-container,
.consent-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
  padding: 24px;
}

.consent-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.consent-header h2 {
  color: var(--navy);
  font-size: 18px;
  margin: 0;
}

.consent-badge {
  background: var(--lteal);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.consent-intro {
  color: var(--muted);
  margin-bottom: 16px;
}

.consent-summary,
.consent-legal {
  background: var(--lgrey);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.consent-summary ul,
.consent-summary li {
  line-height: 1.7;
}

.consent-actions,
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.consent-accepted-message,
.withdrawal-completed {
  text-align: center;
  padding: 20px;
}

.withdrawal-form .form-group {
  margin-bottom: 20px;
}

.radio-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 0;
}

.radio-option input[type="radio"] {
  width: 20px;
  height: 20px;
}

.withdrawal-notice {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 480px) {
  .tooltip-actions {
    flex-direction: column;
  }

  .btn-secondary-small,
  .btn-primary-small {
    width: 100%;
  }

  /* GUI-011: Questionnaire card footer wrapping on mobile */
  .questionnaire-footer {
    flex-wrap: wrap;
    gap: 12px;
  }
  .questionnaire-actions {
    width: 100%;
  }
  .questionnaire-actions button {
    width: 100%;
  }
}


/* GUI-012: Downloads Tab resources and guides card styling */
.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.resource-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 16px;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.resource-item .resource-icon {
  font-size: 2rem;
  line-height: 1;
}
.resource-item .resource-info {
  flex: 1;
}
.resource-item .resource-info h4 {
  margin: 0 0 4px 0;
  font-size: 1.05rem;
}
.resource-item .resource-info p {
  margin: 0;
  color: var(--text-secondary, #64748b);
  font-size: 0.9rem;
}
.resource-item .btn-secondary {
  align-self: flex-start;
  margin-top: auto;
}

/* GUI-013: Direct support channels responsive grid */
.support-channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.support-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.support-card h3 {
  margin: 0;
  font-size: 1.1rem;
}
.support-card p {
  margin: 0;
  color: var(--text-secondary, #64748b);
  font-size: 0.9rem;
}
.support-card .phone-number {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
}
.support-card .btn-primary {
  margin-top: auto;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 0.9rem;
  padding: 8px 12px;
}

/* GUI-022: Chatbot floating toggle clearance */
@media (max-width: 768px) {
  .chatbot-toggle {
    bottom: 24px;
    right: 16px;
  }
}

/* ===== Dashboard sections that had no styling (2026-10-07) =====
   Consent tab (.status-box, .signature-documents), Downloads "My Data" (.download-section) and
   Support (.support-form-container, .faq-section) were bare headings and buttons. Same card as .resource-item. */
.consent-status {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.status-box,
.signature-documents,
.download-section,
.support-form-container,
.faq-section {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 16px;
}
.consent-status .status-box { margin-bottom: 0; }
.status-box.completed { border-left: 4px solid var(--teal, #0E8B8B); }
.status-box h3,
.signature-documents h3,
.download-section h3,
.support-form-container h3,
.faq-section h3 { margin: 0 0 8px; }
.status-box .btn-outline,
.download-section .btn-primary { margin-top: 12px; }
.download-section small { display: block; margin-top: 8px; }
.signature-documents canvas { max-width: 100%; height: auto; }
.contact-update { margin-top: 16px; }
.faq-section .faq-item + .faq-item { margin-top: 8px; }

/* Logout button beside .nav-cta (index.html defines .nav-cta inline; portal/styles.css is not linked by the portal,
   so the rule added there on 2026-10-07 never applied). Navy text, teal outline. */
.nav-cta-secondary {
  background: transparent;
  color: var(--navy, #1B3A6B);
  border: 1px solid var(--teal, #0E8B8B);
  cursor: pointer;
  font-family: inherit;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: var(--fs-xs, 0.8rem);
  font-weight: 700;
  transition: opacity .2s;
  min-height: var(--touch, 44px);
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.nav-cta-secondary:hover { background: var(--light-teal, #D6F0F0); }
