/* ==========================================================================
   Outlook-style email simulation
   ========================================================================== */

.sim-layout { display: flex; flex-direction: column; gap: var(--space-md); }

.sim-instructions {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; background: #EFF6FF; border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm); font-size: 0.8rem; color: #1E40AF; line-height: 1.45;
}
.sim-instructions i { margin-top: 2px; flex-shrink: 0; }

.sim-body { display: grid; grid-template-columns: 1fr 260px; gap: var(--space-md); align-items: start; }

/* Outlook window chrome */
.outlook-window {
  border: 1px solid #8C8C8C; border-radius: var(--radius-sm);
  overflow: hidden; background: #FFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  font-family: 'Segoe UI', var(--font-sans);
}
.outlook-titlebar {
  background: #0078D4; color: white;
  padding: 6px 12px; font-size: 0.75rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.outlook-titlebar i { font-size: 0.85rem; }
.outlook-ribbon {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 6px 10px; background: #F3F2F1; border-bottom: 1px solid #E1DFDD;
}
.ribbon-btn {
  padding: 4px 10px; font-size: 0.7rem; color: #323130;
  border: 1px solid transparent; border-radius: 2px; background: transparent;
}
.ribbon-btn:hover { background: #EDEBE9; border-color: #C8C6C4; }
.ribbon-sep { width: 1px; height: 20px; background: #E1DFDD; margin: 0 4px; }

.outlook-body { display: grid; grid-template-columns: 140px 200px 1fr; min-height: 340px; }

/* Folder pane */
.outlook-folders {
  background: #F3F2F1; border-right: 1px solid #E1DFDD;
  padding: 8px 0; font-size: 0.75rem;
}
.folder-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; color: #323130; cursor: default;
}
.folder-item.active { background: #C7E0F4; font-weight: 600; }
.folder-item i { width: 14px; text-align: center; color: #0078D4; font-size: 0.7rem; }

/* Message list */
.outlook-list {
  border-right: 1px solid #E1DFDD; background: white;
  overflow-y: auto;
}
.outlook-list-header {
  padding: 8px 10px; font-size: 0.7rem; font-weight: 600;
  color: #323130; border-bottom: 1px solid #E1DFDD;
  background: #FAF9F8;
}
.list-message {
  padding: 10px; border-bottom: 1px solid #EDEBE9;
  cursor: pointer; background: #C7E0F4;
  border-left: 3px solid #0078D4;
}
.list-message-sender { font-size: 0.75rem; font-weight: 600; color: #323130; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-message-subject { font-size: 0.7rem; color: #605E5C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.list-message-preview { font-size: 0.65rem; color: #A19F9D; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Reading pane */
.outlook-reading { padding: 16px; overflow-y: auto; background: white; }
.reading-subject { font-size: 1.1rem; font-weight: 600; color: #323130; margin-bottom: 12px; line-height: 1.3; }
.reading-meta {
  display: flex; align-items: flex-start; gap: 10px;
  padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #EDEBE9;
}
.reading-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #0078D4; color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.reading-from-name { font-size: 0.8rem; font-weight: 600; color: #323130; }
.reading-from-email { font-size: 0.72rem; color: #605E5C; font-family: var(--font-mono); }
.reading-date { font-size: 0.7rem; color: #A19F9D; margin-left: auto; flex-shrink: 0; }
.reading-body { font-size: 0.85rem; line-height: 1.65; color: #323130; }
.reading-body p { margin-bottom: 10px; }

/* Email regions — select then mark suspicious */
.sim-region {
  border-radius: 4px;
  cursor: pointer;
  transition: outline-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.sim-region:hover:not(.found) { background: rgba(37, 99, 235, 0.04); }
.sim-region.selected {
  outline: 2px solid #2563EB;
  outline-offset: 3px;
  background: rgba(37, 99, 235, 0.1);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}
.sim-region.investigating {
  outline: 2px dashed #2563EB;
  outline-offset: 3px;
  background: rgba(37, 99, 235, 0.07);
  animation: pulseRegion 1.2s ease infinite;
}
.sim-region.found {
  outline: 2px solid #22C55E;
  outline-offset: 2px;
  background: rgba(34, 197, 94, 0.08);
  cursor: default;
}
.sim-region.incorrect-click { background: rgba(239, 68, 68, 0.12); animation: shake 0.35s ease; }
@keyframes pulseRegion { 50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.12); } }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.reading-meta.sim-region { padding: 8px; margin: -8px -8px 4px; border-radius: 6px; }

.investigation-tools { margin-bottom: var(--space-md); }
.investigation-hint {
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.45;
  margin-bottom: var(--space-sm); padding: 8px 10px;
  background: white; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.investigation-tool-actions { display: flex; flex-direction: column; gap: 6px; }
.investigation-tool-actions button { width: 100%; justify-content: center; }
.investigation-tool-actions .pulse { animation: pulseRegion 0.8s ease infinite; }

.sim-demo-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center; padding: var(--space-md);
}
.sim-demo-card {
  background: white; border-radius: var(--radius-md); padding: var(--space-xl);
  max-width: 480px; width: 100%; box-shadow: var(--shadow-lg);
}
.sim-demo-card h2 { font-size: 1.15rem; color: var(--primary); margin-bottom: var(--space-sm); }
.sim-demo-lead { font-size: 0.88rem; color: var(--text-muted); margin-bottom: var(--space-md); }
.sim-demo-steps { margin: 0 0 var(--space-lg) 1.1rem; font-size: 0.85rem; line-height: 1.6; color: var(--text); }
.sim-demo-steps li { margin-bottom: 8px; }
.sim-demo-actions { display: flex; flex-direction: column; gap: 8px; }

.sim-link { color: #0078D4; text-decoration: underline; font-family: var(--font-mono); font-size: 0.8rem; }

.findings-log { margin: var(--space-sm) 0; }
.finding-entry { font-size: 0.75rem; padding: 8px 0; border-bottom: 1px solid var(--border); }
.finding-entry strong { display: block; color: var(--primary); font-size: 0.78rem; margin-bottom: 2px; }
.finding-entry span { color: var(--text-muted); line-height: 1.4; }

.sim-attachment {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin-top: 8px;
  background: #F3F2F1; border: 1px solid #E1DFDD; border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.sim-attachment i { color: #D13438; }

/* Investigation panel */
.investigation-panel {
  background: #F8FAFC; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-md);
  position: sticky; top: 0;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
.investigation-panel h3 { font-size: 0.8rem; font-weight: 700; margin-bottom: var(--space-sm); color: var(--primary); }
.investigation-score { font-size: 0.75rem; font-weight: 600; color: var(--secondary); margin-bottom: var(--space-md); }

.sim-verdict { display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-md); }
.sim-verdict-prompt { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.sim-verdict button { width: 100%; justify-content: center; font-size: 0.8rem; padding: 10px; }

.assessment-email-preview {
  background: #FAFAFA; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: var(--space-md); margin-bottom: var(--space-md);
}
.assessment-email-preview .from-line { font-size: 0.8rem; font-family: var(--font-mono); margin-bottom: 6px; color: var(--text-muted); }
.assessment-email-preview .subject-line { font-weight: 700; font-size: 0.95rem; margin-bottom: var(--space-sm); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--border); }
.assessment-email-preview .body-line { font-size: 0.85rem; line-height: 1.6; }

.challenge-email-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--space-md); background: white;
}
.challenge-email-card .sender { font-weight: 600; font-size: 0.85rem; }
.challenge-email-card .subject { font-size: 0.8rem; color: var(--text-muted); margin: 4px 0; }
.challenge-email-card .preview { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }
.challenge-actions { display: flex; gap: var(--space-sm); justify-content: center; margin-top: var(--space-md); flex-wrap: wrap; }

@media (max-width: 900px) {
  .sim-body { grid-template-columns: 1fr; }
  .investigation-panel { position: static; }
  .outlook-body { grid-template-columns: 1fr; min-height: auto; }
  .outlook-folders { display: none; }
  .outlook-list { border-right: none; border-bottom: 1px solid #E1DFDD; max-height: 80px; }
  .outlook-reading { min-height: 240px; }
}

@media (max-width: 480px) {
  .outlook-body { grid-template-columns: 1fr; }
  .outlook-list { display: none; }
}
