/* Help Modal Styles */
.help-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(3px);
}

.help-content {
  background: var(--info-box-bg);
  color: var(--text-strong);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--info-box-border);
  backdrop-filter: blur(18px) saturate(1.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-muted);
}

.help-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 500;
}

.close-help {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  padding: 0.5rem;
}

.close-help i {
  width: 24px;
  height: 24px;
}

.help-body {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  max-height: calc(85vh - 80px);
}

.help-body h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-strong);
}

.help-body h3:first-child {
  margin-top: 0;
}

.help-body p {
  margin: 0.75rem 0;
  line-height: 1.6;
  color: var(--text-medium);
  font-size: 0.95rem;
}

.help-body ol,
.help-body ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.help-body li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
  color: var(--text-medium);
}

/* Code snippets */
.code-snippet {
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  margin: 0.75rem 0 0 -1.5rem;
  padding: 1rem;
  width: 100%;
  overflow: visible;
}

.code-snippet pre {
  margin: 0;
  padding-right: 2.5rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-medium);
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-strong);
}

.copy-btn i {
  width: 16px;
  height: 16px;
}

/* Copy tooltip */
.copy-tooltip {
  position: absolute;
  top: -30px;
  right: 0;
  background-color: var(--accent-color);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  transition: opacity 0.3s;
  opacity: 1;
  white-space: nowrap;
  pointer-events: none;
}

.copy-tooltip:after {
  content: "";
  position: absolute;
  top: 100%;
  right: 5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--accent-color) transparent transparent transparent;
}

.copy-tooltip.error {
  background-color: var(--high-risk);
}

.copy-tooltip.error:after {
  border-color: var(--high-risk) transparent transparent transparent;
}

/* Light theme adjustments */
:root.light-theme .code-snippet {
  background: rgba(0, 0, 0, 0.05);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.feature {
  background: var(--vitals-bg);
  padding: 1.25rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.feature i {
  color: var(--accent-color);
  width: 24px;
  height: 24px;
  margin-bottom: 0.75rem;
}

.feature span {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-strong);
}

.feature p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.color-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.color-legend li {
  display: flex;
  align-items: center;
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.75rem;
}

.color-dot.high {
  background-color: var(--high-risk);
  box-shadow: 0 0 5px var(--high-risk);
}

.color-dot.medium {
  background-color: var(--medium-risk);
  box-shadow: 0 0 5px var(--medium-risk);
}

.color-dot.low {
  background-color: var(--low-risk);
  box-shadow: 0 0 5px var(--low-risk);
}

.help-note {
  background: rgba(100, 108, 255, 0.1);
  border-left: 3px solid var(--accent-color);
  padding: 1rem;
  border-radius: 4px;
  margin: 1.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.help-note i {
  color: var(--accent-color);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.help-note p {
  margin: 0;
}

/* Light theme adjustments */
:root.light-theme .help-note {
  background: rgba(100, 108, 255, 0.05);
}

/* Discharge Summary Modal Styles */
.discharge-summary-content {
  max-width: 1000px;
  width: 95%;
}

.discharge-summary-body {
  max-height: 75vh;
  overflow-y: auto;
  padding: 1.5rem 2rem;
}

.patient-info-section {
  background: var(--accent-light);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--accent);
}

.patient-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.patient-info-grid .info-item {
  font-size: 0.9rem;
  line-height: 1.5;
}

.discharge-section {
  margin-bottom: 2rem;
}

.discharge-section .section-title {
  color: var(--text-strong);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.discharge-section p {
  margin-bottom: 1rem;
  line-height: 1.6;
  text-align: justify;
}

.discharge-section ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.discharge-section li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.vital-signs-section {
  background: var(--info-box-bg);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  border-left: 4px solid var(--accent-light);
}

.vital-signs-section h4 {
  color: var(--text-strong);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.vital-signs-section ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-left: 0;
}

.vital-signs-section li {
  background: var(--accent-light);
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  list-style: none;
  text-align: center;
}

.examination-systems {
  background: var(--info-box-bg);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
}

.examination-systems p {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.lab-subsection {
  background: var(--info-box-bg);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  border-left: 3px solid var(--accent-light);
}

.lab-subsection h4 {
  color: var(--text-strong);
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.lab-subsection ul {
  margin-left: 1rem;
}

.lab-subsection li {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.signature-section {
  background: var(--accent-light);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-top: 2rem;
  border-top: 3px solid var(--accent);
}

.signature-line p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* Mobile responsiveness for discharge summary */
@media (max-width: 768px) {
  .discharge-summary-content {
    width: 98%;
    max-width: none;
  }
  
  .discharge-summary-body {
    padding: 1rem;
    max-height: 70vh;
  }
  
  .patient-info-grid {
    grid-template-columns: 1fr;
  }
  
  .vital-signs-section ul {
    grid-template-columns: 1fr;
  }
  
  .discharge-section .section-title {
    font-size: 1.1rem;
  }
  
  .help-header {
    padding: 1rem;
  }
  
  .help-header h2 {
    font-size: 1.2rem;
  }
}
