/**
 * 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);
}

.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);
}

.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: 24px;
  height: 24px;
  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: 90vw !important;
    right: 5vw !important;
    left: auto !important;
    top: 100px !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%;
  }
}
