/**
 * Senier AI Demo - Embedded Verification UI Styles
 * Self-contained verification interface for Epic EHR Simulator
 */

/* ===== VERIFICATION BUTTON ===== */
.senier-verify-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  padding: 18px 24px;
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border-left: 4px solid #16A34A;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
}

.senier-verify-button {
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
  transition: all 0.2s ease;
  animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
  }
  50% {
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.5);
  }
}

.senier-verify-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #15803D 0%, #14532D 100%);
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.45);
  transform: translateY(-2px);
}

.senier-verify-button:active {
  transform: translateY(0);
}

.senier-verify-button:disabled {
  background: #94A3B8;
  cursor: not-allowed;
  box-shadow: none;
  animation: none;
}

.senier-icon {
  font-size: 20px;
}

.senier-status {
  font-size: 14px;
  color: #64748B;
  font-style: italic;
}

/* ===== LOADING OVERLAY ===== */
.senier-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.senier-loading.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.senier-loading-content {
  background: white;
  padding: 40px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.senier-loading-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.senier-loading-header h3 {
  margin: 0;
  font-size: 20px;
  color: #1E293B;
}

.senier-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #E2E8F0;
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.senier-progress-container {
  margin-bottom: 20px;
}

.senier-progress-bar {
  width: 100%;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.senier-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563EB 0%, #1D4ED8 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.senier-progress-stages {
  display: flex;
  justify-content: space-between;
}

.senier-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94A3B8;
  transition: color 0.3s ease;
  flex: 1;
  text-align: center;
}

.senier-stage.active {
  color: #2563EB;
  font-weight: 600;
}

.senier-stage.complete {
  color: #10B981;
}

.senier-stage-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #CBD5E1;
  transition: all 0.3s ease;
}

.senier-stage.active .senier-stage-dot {
  background: #2563EB;
  transform: scale(1.3);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.senier-stage.complete .senier-stage-dot {
  background: #10B981;
}

.senier-loading-footer {
  text-align: center;
  color: #64748B;
  font-size: 14px;
}

.senier-loading-footer p {
  margin: 8px 0;
}

.senier-eta {
  font-size: 12px;
  color: #94A3B8;
}

/* ===== RESULTS SIDE PANEL ===== */
.senier-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 480px;
  height: 100vh;
  background: #F9FAFB;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.senier-panel:not(.hidden) {
  transform: translateX(0);
}

@media (max-width: 768px) {
  .senier-panel {
    width: 100vw;
  }
}

.senier-panel-header {
  background: linear-gradient(to right, #2563EB, #4F46E5);
  color: white;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.senier-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
}

.senier-logo-icon {
  width: 32px;
  height: 32px;
}

.senier-close-button {
  background: transparent;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 0;
  width: 32px;
  height: 32px;
}

.senier-close-button:hover {
  opacity: 1;
}

/* ===== SUMMARY BAR ===== */
.senier-summary-bar {
  padding: 20px 24px;
  background: white;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
}

.senier-pass-fail {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.senier-pass-fail.fail {
  color: #EF4444;
}

.senier-pass-fail.pass {
  color: #10B981;
}

.senier-summary-stats {
  display: flex;
  gap: 24px;
}

.senier-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.senier-stat-label {
  font-size: 11px;
  color: #6B7280;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.senier-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

/* ===== SEVERITY SUMMARY BADGES ===== */
.senier-severity-summary {
  padding: 16px 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: white;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
}

.senier-severity-badge {
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.senier-severity-badge.critical {
  background: #EF4444;
}

.senier-severity-badge.critical:hover {
  background: #DC2626;
}

.senier-severity-badge.high {
  background: #F59E0B;
}

.senier-severity-badge.high:hover {
  background: #D97706;
}

.senier-severity-badge.medium {
  background: #EAB308;
}

.senier-severity-badge.medium:hover {
  background: #CA8A04;
}

.senier-severity-badge.low {
  background: #3B82F6;
}

.senier-severity-badge.low:hover {
  background: #2563EB;
}

.senier-severity-badge .count {
  font-weight: 700;
  font-size: 15px;
}

/* ===== FLAGS CONTAINER ===== */
.senier-flags-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #F9FAFB;
}

/* ===== FLAG CARD ===== */
.senier-flag-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.senier-flag-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.senier-flag-card[data-severity="critical"] {
  border-color: #FECACA;
}

.senier-flag-card[data-severity="high"] {
  border-color: #FED7AA;
}

.senier-flag-card[data-severity="medium"] {
  border-color: #FDE68A;
}

.senier-flag-card[data-severity="low"] {
  border-color: #BFDBFE;
}

.senier-flag-header {
  padding: 16px;
  cursor: pointer;
  background: white;
}

.senier-flag-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.senier-flag-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.senier-severity-tag {
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

.senier-severity-tag.critical {
  background: #EF4444;
}

.senier-severity-tag.high {
  background: #F59E0B;
}

.senier-severity-tag.medium {
  background: #EAB308;
}

.senier-severity-tag.low {
  background: #3B82F6;
}

.senier-type-tag {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  border: 1px solid;
}

.senier-type-tag[data-type="hallucination"] {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FECACA;
}

.senier-type-tag[data-type="omission"] {
  background: #FFEDD5;
  color: #C2410C;
  border-color: #FED7AA;
}

.senier-type-tag[data-type="clinical_inconsistency"] {
  background: #F3E8FF;
  color: #7C3AED;
  border-color: #E9D5FF;
}

.senier-type-tag[data-type="coding_gap"] {
  background: #E0E7FF;
  color: #4338CA;
  border-color: #C7D2FE;
}

.senier-type-tag[data-type="medical_necessity"] {
  background: #FCE7F3;
  color: #BE185D;
  border-color: #FBCFE8;
}

.senier-type-tag[data-type="documentation_gap"] {
  background: #FEF3C7;
  color: #A16207;
  border-color: #FDE68A;
}

.senier-expand-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #64748B;
}

.senier-chevron {
  width: 20px;
  height: 20px;
  transition: transform 0.2s;
}

.senier-flag-body:not(.collapsed) ~ .senier-flag-header .senier-chevron {
  transform: rotate(180deg);
}

.senier-flag-title {
  font-size: 15px;
  font-weight: 600;
  color: #1E293B;
  margin: 0;
}

.senier-flag-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 16px;
}

.senier-flag-body:not(.collapsed) {
  max-height: 2000px;
  padding: 16px;
}

.senier-flag-description {
  margin-bottom: 16px;
  color: #475569;
  line-height: 1.6;
}

.senier-flag-description p {
  margin: 0;
}

/* ===== COMPARISON BOXES ===== */
.senier-comparison {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.senier-comparison-box {
  padding: 12px;
  border-radius: 6px;
  border: 1px solid;
}

.senier-comparison-box.note-value {
  background: #FEF2F2;
  border-color: #FECACA;
}

.senier-comparison-box.ehr-value {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

.senier-flag-card[data-severity="critical"] .senier-comparison-box.note-value {
  background: #FEF2F2;
  border-color: #FECACA;
}

.senier-flag-card[data-severity="high"] .senier-comparison-box.note-value {
  background: #FFFBEB;
  border-color: #FED7AA;
}

.senier-flag-card[data-severity="medium"] .senier-comparison-box.note-value {
  background: #FEFCE8;
  border-color: #FDE68A;
}

.senier-flag-card[data-severity="low"] .senier-comparison-box.note-value {
  background: #EFF6FF;
  border-color: #BFDBFE;
}

.senier-comparison-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #6B7280;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.senier-comparison-content {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Courier New', monospace;
  font-size: 14px;
  color: #111827;
  word-break: break-word;
  line-height: 1.5;
}

.senier-comparison-arrow {
  display: none;
}

/* ===== SUGGESTION BOX ===== */
.senier-suggestion {
  background: white;
  padding: 0;
  border-radius: 0;
  margin-bottom: 16px;
}

.senier-suggestion-label {
  display: none;
}

.senier-suggestion p {
  font-size: 14px;
  color: #4B5563;
  line-height: 1.6;
  margin: 0;
}

/* ===== EVIDENCE SOURCE ===== */
.senier-evidence {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 12px;
  padding-top: 12px;
  background: transparent;
  border-top: 1px solid #F3F4F6;
  font-style: italic;
}

.senier-evidence-label {
  font-weight: 400;
}

.senier-evidence-text {
  font-family: inherit;
}

/* ===== CONFIDENCE BAR ===== */
.senier-confidence {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
}

.senier-confidence-label {
  font-weight: 600;
  color: #475569;
}

.senier-confidence-bar {
  flex: 1;
  height: 8px;
  background: #E2E8F0;
  border-radius: 4px;
  overflow: hidden;
}

.senier-confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981 0%, #059669 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.senier-confidence-value {
  font-weight: 700;
  color: #10B981;
}

/* ===== FLAG ACTIONS ===== */
.senier-flag-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.senier-flag-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.senier-accept-button {
  background: white;
  color: #15803D;
  border: 2px solid #16A34A;
}

.senier-accept-button:hover {
  background: #16A34A;
  color: white;
}

.senier-dismiss-button {
  background: white;
  color: #374151;
  border: 1px solid #D1D5DB;
}

.senier-dismiss-button:hover {
  background: #F9FAFB;
}

.senier-show-in-note-button {
  background: transparent;
  color: #2563EB;
  border: none;
  text-decoration: none;
  padding: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.senier-show-in-note-button:hover {
  color: #1D4ED8;
  text-decoration: underline;
}

/* ===== FLAG STATES ===== */
.senier-flag-card.accepted {
  opacity: 0.7;
  border-color: #10B981 !important;
}

.senier-flag-card.accepted .senier-flag-header {
  background: #ECFDF5;
}

.senier-flag-card.accepted .senier-flag-header::after {
  content: "✓ Accepted";
  position: absolute;
  right: 60px;
  top: 16px;
  font-size: 12px;
  font-weight: 700;
  color: #10B981;
  background: #D1FAE5;
  padding: 4px 10px;
  border-radius: 12px;
}

.senier-flag-card.dismissed {
  opacity: 0.5;
  border-color: #CBD5E1 !important;
}

.senier-flag-card.dismissed .senier-flag-header {
  background: #F1F5F9;
}

.senier-flag-card.dismissed .senier-flag-header::after {
  content: "✗ Dismissed";
  position: absolute;
  right: 60px;
  top: 16px;
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  background: #E2E8F0;
  padding: 4px 10px;
  border-radius: 12px;
}

/* ===== PANEL FOOTER ===== */
.senier-panel-footer {
  padding: 20px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.senier-approve-button {
  background: #10B981;
  color: white;
  border: none;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.senier-approve-button:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.senier-approve-button:disabled {
  background: #CBD5E1;
  cursor: not-allowed;
}

.senier-reset-button {
  background: white;
  color: #64748B;
  border: 1px solid #CBD5E1;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.senier-reset-button:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}

/* ===== SUCCESS MODAL ===== */
.senier-success-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.senier-success-content {
  background: white;
  padding: 40px;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.senier-success-icon {
  width: 80px;
  height: 80px;
  background: #10B981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: white;
  margin: 0 auto 20px;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.senier-success-content h2 {
  margin: 0 0 10px 0;
  font-size: 24px;
  color: #1E293B;
}

.senier-success-content > p {
  color: #64748B;
  margin-bottom: 20px;
}

.senier-audit-info {
  background: #F8FAFC;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  border: 1px solid #E2E8F0;
}

.senier-audit-info strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  color: #64748B;
  margin-bottom: 8px;
}

.senier-audit-info code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #1E293B;
  background: white;
  padding: 8px 12px;
  border-radius: 4px;
  display: block;
  word-break: break-all;
  border: 1px solid #E2E8F0;
}

.senier-summary-stats-modal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.senier-summary-stats-modal .stat {
  background: #F8FAFC;
  padding: 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.senier-summary-stats-modal .label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748B;
}

.senier-summary-stats-modal .value {
  font-size: 20px;
  font-weight: 700;
  color: #1E293B;
}

.senier-close-modal-button {
  background: #2563EB;
  color: white;
  border: none;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.senier-close-modal-button:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
}

/* ===== TOAST NOTIFICATIONS ===== */
.senier-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10002;
  animation: slideInUp 0.3s ease;
  max-width: 400px;
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.senier-toast.success {
  border-left: 4px solid #10B981;
}

.senier-toast.info {
  border-left: 4px solid #2563EB;
}

.senier-toast.error {
  border-left: 4px solid #EF4444;
}

.senier-toast-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.senier-toast-message {
  flex: 1;
  font-size: 14px;
  color: #1E293B;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none !important;
}

/* Make sure flag header is positioned for ::after pseudo-elements */
.senier-flag-card.accepted .senier-flag-header,
.senier-flag-card.dismissed .senier-flag-header {
  position: relative;
}
