body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #fafbfc;
  color: #2d3748;
  line-height: 1.6;
}

/* Navigation Bar Styles - myScribe inspired */
.navbar {
  background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 50%, #3182ce 100%);
  color: white;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(26, 54, 93, 0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.file-input-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.file-input-wrapper input[type=file] {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.file-input-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.25);
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-input-label:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.file-icon {
  font-size: 18px;
  opacity: 0.9;
}

.file-text {
  white-space: nowrap;
  transition: all 0.3s ease;
}

.file-selected-info {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.15);
  padding: 10px 20px;
  border-radius: 25px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.selected-file-name {
  font-size: 14px;
  font-weight: 500;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.95;
}

.change-file-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.change-file-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Compact navbar when file is loaded */
.navbar.compact {
  padding: 12px 32px;
}

.navbar.compact .navbar-brand h1 {
  font-size: 22px;
}

/* Content spacing adjustment */
.bundle-info,
.filters,
.tabs-container {
  margin-top: 24px;
  margin-left: 24px;
  margin-right: 24px;
}

.bundle-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.info-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(26, 54, 93, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.info-card:hover {
  box-shadow: 0 4px 20px rgba(26, 54, 93, 0.12);
  transform: translateY(-1px);
}

.filters {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(26, 54, 93, 0.08);
  border: 1px solid #e2e8f0;
}

.search-box {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: #ffffff;
}

.search-box:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.search-box::placeholder {
  color: #a0aec0;
}

.tabs-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(26, 54, 93, 0.08);
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  background: #f8fafc;
}

.tab {
  padding: 16px 24px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.3s ease;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
  border-right: 1px solid #e2e8f0;
}

.tab:last-child {
  border-right: none;
}

.tab:hover {
  background: #edf2f7;
  color: #2d3748;
}

.tab.active {
  background: white;
  border-bottom-color: #3182ce;
  color: #3182ce;
  font-weight: 600;
  box-shadow: 0 -2px 8px rgba(49, 130, 206, 0.1);
}

.tab-content {
  display: none;
  padding: 24px;
}

.tab-content.active {
  display: block;
}

.resources-container {
  display: block;
  width: 100%;
}

.resource-list-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.resource-list-item:hover {
  border-color: #3182ce;
  box-shadow: 0 4px 16px rgba(49, 130, 206, 0.1);
  transform: translateY(-1px);
}

.resource-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  user-select: none;
  transition: all 0.3s ease;
}

.resource-list-header:hover {
  background: #edf2f7;
}

.resource-list-header.expanded {
  background: #ebf8ff;
  border-bottom-color: #3182ce;
}

.resource-list-title {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.resource-type-badge {
  background: #3182ce;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  min-width: 90px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Medical-themed color scheme for different resource types */
.resource-type-badge.Organization {
  background: #38a169;
  color: white;
}
.resource-type-badge.Patient {
  background: #ed8936;
  color: white;
}
.resource-type-badge.Encounter {
  background: #805ad5;
  color: white;
}
.resource-type-badge.Condition {
  background: #e53e3e;
  color: white;
}
.resource-type-badge.Medication {
  background: #319795;
  color: white;
}
.resource-type-badge.Observation {
  background: #718096;
  color: white;
}
.resource-type-badge.DiagnosticReport {
  background: #2d3748;
  color: white;
}
.resource-type-badge.Procedure {
  background: #d69e2e;
  color: white;
}
.resource-type-badge.Composition {
  background: #553c9a;
  color: white;
}

.resource-summary {
  flex: 1;
  font-size: 14px;
  color: #2d3748;
  font-weight: 500;
  line-height: 1.4;
}

.resource-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: #718096;
}

.resource-id-small {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: #edf2f7;
  color: #4a5568;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.expand-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #edf2f7;
  color: #4a5568;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.expand-icon.expanded {
  background: #3182ce;
  color: white;
  transform: rotate(180deg);
}

.resource-details {
  display: none;
  padding: 20px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.resource-details.expanded {
  display: block;
}

.resource-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.json-toggle-btn {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #4a5568;
  transition: all 0.3s ease;
  font-weight: 500;
}

.json-toggle-btn:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
  color: #2d3748;
}

.json-toggle-btn.active {
  background: #3182ce;
  color: white;
  border-color: #3182ce;
}

.json-content-expanded {
  display: none;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  padding: 16px;
  margin-top: 12px;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 11px;
  white-space: pre-wrap;
  max-height: 350px;
  overflow-y: auto;
  color: #2d3748;
  line-height: 1.5;
}

.json-content-expanded.visible {
  display: block;
}

.resources-stats {
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-size: 14px;
  color: #2c5282;
  font-weight: 500;
}

.resource-card.Organization {
  border-left: 4px solid #38a169;
}
.resource-card.Patient {
  border-left: 4px solid #ed8936;
}
.resource-card.Encounter {
  border-left: 4px solid #805ad5;
}
.resource-card.Condition {
  border-left: 4px solid #e53e3e;
}
.resource-card.Medication {
  border-left: 4px solid #319795;
}
.resource-card.Observation {
  border-left: 4px solid #718096;
}
.resource-card.DiagnosticReport {
  border-left: 4px solid #2d3748;
}
.resource-card.Procedure {
  border-left: 4px solid #d69e2e;
}
.resource-card.Composition {
  border-left: 4px solid #553c9a;
}

.resource-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.resource-type {
  background: #3182ce;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.resource-id {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  color: #718096;
  background: #edf2f7;
  padding: 4px 8px;
  border-radius: 4px;
}

.resource-content {
  line-height: 1.6;
}

.field {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f7fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.field:hover {
  border-color: #cbd5e0;
}

.field-label {
  font-weight: 600;
  color: #2d3748;
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.field-value {
  color: #4a5568;
  font-size: 14px;
  line-height: 1.5;
}

/* Compact inline field styles */
.field-inline {
  margin-bottom: 8px;
  padding: 8px 16px;
  background: #f7fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.field-inline:hover {
  border-color: #cbd5e0;
}

.field-inline .field-label {
  font-weight: 600;
  color: #2d3748;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin: 0;
  flex-shrink: 0;
}

.field-inline .field-value {
  color: #4a5568;
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  flex: 1;
  min-width: 0;
}

/* Compact resource content container */
.resource-content-compact {
  max-width: 100%;
  overflow: hidden;
}

.resource-content-compact .field {
  margin-bottom: 12px;
}

.resource-content-compact .field-inline {
  margin-bottom: 6px;
}

.code-display {
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  color: #2c5282;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 11px;
  display: inline-block;
  margin: 2px 4px 2px 0;
  font-weight: 500;
  transition: all 0.3s ease;
}

.code-display.kdl-code {
  background: #f0fff4;
  border: 1px solid #68d391;
  color: #22543d;
  position: relative;
}

.code-display.kdl-code::before {
  content: "KDL";
  background: #38a169;
  color: white;
  font-size: 8px;
  padding: 1px 3px;
  border-radius: 2px;
  position: absolute;
  top: -6px;
  right: -6px;
  font-weight: bold;
  line-height: 1;
}

.code-display.ihe-code {
  background: #fff5f5;
  border: 1px solid #fc8181;
  color: #742a2a;
  position: relative;
}

.code-display.ihe-code::before {
  content: "IHE";
  background: #e53e3e;
  color: white;
  font-size: 8px;
  padding: 1px 3px;
  border-radius: 2px;
  position: absolute;
  top: -6px;
  right: -6px;
  font-weight: bold;
  line-height: 1;
}

.code-display.section-code {
  background: #e6fffa;
  border: 1px solid #4fd1c7;
  color: #234e52;
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-display.section-code:hover {
  background: #b2f5ea;
  border-color: #38b2ac;
  transform: translateY(-1px);
}

.code-display.section-code::after {
  content: "📝";
  margin-left: 6px;
  font-size: 12px;
}

.code-display.atc-code {
  background: #f0f8ff;
  border: 1px solid #4299e1;
  color: #2b6cb0;
  position: relative;
}

.code-display.atc-code::before {
  content: "ATC";
  background: #3182ce;
  color: white;
  font-size: 8px;
  padding: 1px 3px;
  border-radius: 2px;
  position: absolute;
  top: -6px;
  right: -6px;
  font-weight: bold;
  line-height: 1;
}

.value-with-unit {
  font-weight: 600;
  color: #3182ce;
  font-size: 15px;
}

.reference-range {
  color: #38a169;
  font-size: 12px;
  font-style: italic;
  font-weight: 500;
}

.json-toggle {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  margin-top: 12px;
  color: #4a5568;
  font-weight: 500;
  transition: all 0.3s ease;
}

.json-toggle:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.json-content {
  display: none;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  padding: 12px;
  border-radius: 6px;
  margin-top: 12px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 11px;
  white-space: pre-wrap;
  max-height: 250px;
  overflow-y: auto;
  color: #2d3748;
}

.hidden {
  display: none !important;
}

.section-content {
  margin-left: 20px;
  border-left: 3px solid #cbd5e0;
  padding-left: 20px;
  margin-top: 12px;
}

.lab-values-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 12px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lab-values-table th,
.lab-values-table td {
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  text-align: left;
}

.lab-values-table th {
  background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
  color: white;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.lab-values-table tr:nth-child(even) {
  background: #f7fafc;
}

.lab-values-table tr:hover {
  background: #edf2f7;
}

.lab-value-normal {
  color: #38a169;
  font-weight: 500;
}

.lab-value-abnormal {
  color: #e53e3e;
  font-weight: 600;
  background: #fed7d7;
  padding: 4px 8px;
  border-radius: 4px;
}

.lab-code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  color: #2c5282;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
}

.clickable-code {
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.clickable-code:hover {
  background: #3182ce !important;
  color: white !important;
  border-color: #2c5282 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(49, 130, 206, 0.2);
}

.code-tooltip {
  position: absolute;
  background: #1a202c;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 1000;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(26, 32, 44, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  line-height: 1.4;
}

.code-tooltip.visible {
  opacity: 1;
}

.code-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #1a202c transparent transparent transparent;
}

/* Configuration Panel Styles */
.configuration-panel {
  position: fixed;
  top: 90px;
  right: 80px;
  width: 400px;
  max-width: calc(100vw - 120px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.configuration-panel.hidden {
  display: none;
}

.configuration-header {
  background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px 12px 0 0;
}

.configuration-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.configuration-controls {
  display: flex;
  gap: 8px;
}

.config-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.config-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.configuration-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.no-configurations {
  text-align: center;
  color: #718096;
  font-style: italic;
  padding: 40px 20px;
}

.no-configurations p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.config-item {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.config-item:hover {
  border-color: #cbd5e0;
  background: #edf2f7;
}

.config-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.config-name-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 500;
  background: white;
}

.config-name-input:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.1);
}

.config-name-input::placeholder {
  color: #a0aec0;
  font-style: italic;
}

.config-delete-btn {
  background: #fed7d7;
  border: 1px solid #fc8181;
  color: #c53030;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.config-delete-btn:hover {
  background: #feb2b2;
  transform: translateY(-1px);
}

.config-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-type-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.config-type-label {
  min-width: 80px;
  font-weight: 500;
  color: #4a5568;
}

.config-type-value {
  flex: 1;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: #edf2f7;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  color: #2d3748;
}

.config-type-value.empty {
  color: #a0aec0;
  font-style: italic;
  font-family: inherit;
}

.config-section-header {
  margin-top: 12px;
  margin-bottom: 8px;
}

.config-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 88px;
}

.config-section-item {
  background: #e6fffa;
  border: 1px solid #4fd1c7;
  color: #234e52;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.config-section-code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Configuration Toggle Button */
.config-toggle-floating {
  position: fixed;
  top: 90px;
  right: 20px;
  background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
  border: none;
  color: white;
  padding: 12px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1002;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  font-size: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.config-toggle-floating:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .configuration-panel {
    width: calc(100vw - 80px);
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .config-toggle-floating {
    right: 20px;
  }
}

/* For very small screens, move panel below the button */
@media (max-width: 500px) {
  .configuration-panel {
    top: 150px;
    right: 10px;
    left: 10px;
    width: calc(100vw - 20px);
    max-width: none;
  }
}
