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

/* ===== CHROME EXTENSION SIDE PANEL ===== */
.senier-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: 320px;
  height: 100vh;
  max-height: 100vh; /* Ensure it doesn't exceed viewport */
  background: #FFFFFF;
  border-left: 1px solid #E2E8F0;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 10000;
  transform: translateX(0); /* Always visible by default */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden; /* Prevent panel itself from scrolling */
  /* Isolate scroll context */
  contain: layout style paint;
}

/* Custom scrollbar styling for panel content */
.senier-panel *::-webkit-scrollbar {
  width: 8px;
}

.senier-panel *::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}

.senier-panel *::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
  transition: background 0.2s;
}

.senier-panel *::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

.senier-panel *::-webkit-scrollbar-thumb:active {
  background: #64748B;
}

/* Remove old scroll shadows rule - now handled by scroll wrapper */

.senier-panel.collapsed {
  transform: translateX(calc(100% - 40px)); /* Show only the tab */
}

/* Add tooltip to the panel tab */
.senier-panel-tab::after {
  content: attr(data-tooltip);
  position: absolute;
  left: -120px;
  background: #1E293B;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.senier-panel-tab:hover::after {
  opacity: 1;
}

/* Resize Handle */
.senier-panel-resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.senier-panel-resize-handle:hover {
  background: rgba(59, 130, 246, 0.1);
}

.senier-panel-resize-handle:active {
  background: rgba(59, 130, 246, 0.2);
}

.resize-handle-indicator {
  width: 3px;
  height: 40px;
  background: #CBD5E1;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.senier-panel-resize-handle:hover .resize-handle-indicator {
  opacity: 1;
  background: #3B82F6;
}

.senier-panel-resize-handle:active .resize-handle-indicator {
  opacity: 1;
  background: #2563EB;
}

/* Hide resize handle when panel is collapsed */
.senier-panel.collapsed .senier-panel-resize-handle {
  display: none;
}

/* Body cursor during resize */
body.resizing-panel {
  cursor: ew-resize !important;
  user-select: none;
}

body.resizing-panel * {
  cursor: ew-resize !important;
  user-select: none;
}

@media (max-width: 768px) {
  .senier-panel {
    width: 100vw;
  }
  .senier-panel.collapsed {
    transform: translateX(calc(100% - 40px));
  }
}

/* Adjust body to accommodate panel - now handled dynamically via JS */
body.senier-panel-open {
  /* margin-right set via JavaScript based on panel width */
  transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden; /* Prevent horizontal scroll */
  position: relative; /* Create stacking context */
}

body.senier-panel-collapsed {
  /* margin-right set to 40px via JavaScript */
  transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  position: relative;
}

/* Prevent body scroll when hovering over panel */
body.panel-hover {
  overflow: hidden !important;
  height: 100vh;
}

@media (max-width: 768px) {
  body.senier-panel-open,
  body.senier-panel-collapsed {
    margin-right: 0 !important;
  }
}

.senier-panel-header {
  background: #FFFFFF;
  color: #1E293B;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #E2E8F0;
  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;
}

/* Portal link in header */
.senier-portal-link-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  height: 36px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  text-decoration: none;
  color: white;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.senier-portal-link-header:hover {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.senier-portal-link-header:active {
  transform: translateY(0);
}

.senier-portal-icon-header {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

.senier-close-button {
  background: transparent;
  border: none;
  color: #64748B;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 0;
  width: 28px;
  height: 28px;
}

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

/* ===== 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 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  min-height: 0;
  max-height: 100%;
  position: relative;
  /* Add smooth scrolling */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  /* Scroll shadows with gray background */
  background:
    linear-gradient(#F9FAFB 30%, rgba(249,250,251,0)),
    linear-gradient(rgba(249,250,251,0), #F9FAFB 70%) 0 100%,
    radial-gradient(farthest-side at 50% 0, rgba(0,0,0,.12), rgba(0,0,0,0)),
    radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.12), rgba(0,0,0,0)) 0 100%;
  background-repeat: no-repeat;
  background-color: #F9FAFB;
  background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
  background-attachment: local, local, scroll, scroll;
}

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

/* ===== CHROME EXTENSION SPECIFIC STYLES ===== */

/* Panel Collapse/Expand Tab */
.senier-panel-tab {
  position: absolute;
  left: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 120px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  border: 2px solid #2563EB;
  border-right: none;
  border-radius: 12px 0 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: -4px 0 16px rgba(37, 99, 235, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10001;
}

.senier-panel-tab:hover {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  box-shadow: -6px 0 24px rgba(37, 99, 235, 0.4);
  transform: translateY(-50%) translateX(-2px);
}

.senier-panel-tab::before {
  content: '';
  font-size: 24px;
  color: white;
  font-weight: 700;
  transition: transform 0.3s;
}

/* Show different icons based on panel state */
.senier-panel:not(.collapsed) .senier-panel-tab::before {
  content: '›';
}

.senier-panel.collapsed .senier-panel-tab::before {
  content: '‹';
}

.senier-panel-tab:hover::before {
  transform: scale(1.2);
}

.senier-panel-tab-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Add a subtle pulsing animation to draw attention */
@keyframes tabPulse {
  0%, 100% {
    box-shadow: -4px 0 16px rgba(37, 99, 235, 0.3);
  }
  50% {
    box-shadow: -6px 0 24px rgba(37, 99, 235, 0.5);
  }
}

.senier-panel-tab {
  animation: tabPulse 3s ease-in-out infinite;
}

.senier-panel-tab:hover {
  animation: none;
}

/* ===== SCROLL WRAPPER - Universal scrollable container ===== */
.senier-scroll-wrapper {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  max-height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  /* Smooth scrolling */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Scroll shadows */
  background:
    linear-gradient(white 30%, rgba(255,255,255,0)),
    linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
    radial-gradient(farthest-side at 50% 0, rgba(0,0,0,.1), rgba(0,0,0,0)),
    radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.1), rgba(0,0,0,0)) 0 100%;
  background-repeat: no-repeat;
  background-color: white;
  background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
  background-attachment: local, local, scroll, scroll;
}

/* ===== VIEW CONTAINERS - All views need proper scrolling ===== */

/* Login View */
#login-view {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* No overflow on parent */
  min-height: 0;
  max-height: 100%;
  position: relative;
}

.senier-login-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* No overflow on container, scroll wrapper handles it */
  min-height: 0;
  max-height: 100%;
}

/* Authenticated View */
#authenticated-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow: hidden; /* No overflow on parent */
  min-height: 0;
  max-height: 100%;
  position: relative;
}

/* Loading View */
#loading-view {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* No overflow on parent */
  min-height: 0;
  max-height: 100%;
  position: relative;
}

/* Results View */
#results-view {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Parent doesn't scroll */
  min-height: 0;
  max-height: 100%;
  position: relative;
}

.senier-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 24px 24px 24px;
}

.senier-login-header {
  text-align: center;
  margin-bottom: 8px;
  padding: 24px 24px 0 24px;
}

.senier-login-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1E293B;
  margin: 0 0 4px 0;
}

.senier-login-header p {
  font-size: 14px;
  color: #64748B;
  margin: 0;
}

.senier-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.senier-form-label {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}

.senier-form-input {
  padding: 10px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.senier-form-input:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.senier-login-button {
  background: #3B82F6;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.senier-login-button:hover {
  background: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

/* User Info (Authenticated State) */
.senier-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
}

.senier-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.senier-user-details {
  flex: 1;
  min-width: 0;
}

.senier-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #1E293B;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.senier-user-role {
  font-size: 12px;
  color: #64748B;
  margin: 0;
}

.senier-signout-link {
  font-size: 12px;
  color: #3B82F6;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

.senier-signout-link:hover {
  color: #2563EB;
  text-decoration: underline;
}

/* Verification Control Section */
.senier-verification-control {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
}

.senier-run-verification-button {
  background: #3B82F6;
  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;
  width: 100%;
}

.senier-run-verification-button:hover:not(:disabled) {
  background: #2563EB;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.senier-run-verification-button:active:not(:disabled) {
  transform: translateY(0);
}

.senier-run-verification-button:disabled {
  background: #CBD5E1;
  cursor: not-allowed;
  color: #94A3B8;
}

.senier-verification-hint {
  text-align: center;
  font-size: 13px;
  color: #64748B;
  line-height: 1.5;
}

.senier-patient-context {
  padding: 12px;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: 6px;
  font-size: 13px;
  color: #0369A1;
}

.senier-patient-context strong {
  color: #075985;
  font-weight: 600;
}

/* Dashboard Links Section */
.senier-dashboard-section {
  padding: 20px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  margin-top: auto; /* Push to bottom of scrollable area */
}

.senier-dashboard-header {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

.senier-dashboard-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Subtle pulse animation for Admin Portal */
@keyframes subtle-pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  }
  50% {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  }
}

.senier-dashboard-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 2px solid #3B82F6;
  border-radius: 8px;
  text-decoration: none;
  color: #1E293B;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  animation: subtle-pulse 3s ease-in-out infinite;
}

.senier-dashboard-link:hover {
  background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
  border-color: #2563EB;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  animation: none; /* Stop pulse on hover */
}

.senier-dashboard-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.senier-dashboard-link-content {
  flex: 1;
  min-width: 0;
}

.senier-dashboard-link-title {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.senier-dashboard-link-description {
  font-size: 11px;
  color: #64748B;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Loading Animation in Panel */
.senier-panel-loading {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  max-height: 100%;
  background: #FFFFFF;
}

.senier-panel-loading .senier-scroll-wrapper {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.senier-panel-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #E2E8F0;
  border-top-color: #3B82F6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.senier-panel-loading-stages {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.senier-panel-loading-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #94A3B8;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.3s;
}

.senier-panel-loading-stage.active {
  background: #EFF6FF;
  color: #3B82F6;
  font-weight: 600;
}

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

.senier-panel-loading-stage-icon {
  font-size: 14px;
  width: 16px;
  text-align: center;
}

/* Back to Verification Button */
.senier-back-button {
  background: white;
  color: #64748B;
  border: 1px solid #CBD5E1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  margin-bottom: 12px;
}

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