/* Modal Component Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none; /* Controlled via JS */
  justify-content: center;
  align-items: center;
  padding: 16px;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.show {
  display: flex;
  opacity: 1;
}

.modal-content-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color-muted);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.modal-backdrop.show .modal-content-container {
  transform: scale(1);
}

/* Close Button */
.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color-muted);
  z-index: 10;
}

.modal-close-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* Modal Sections */
.modal-header-section {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color-muted);
}

.modal-title-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 0;
}

.modal-body-section {
  flex-grow: 1;
}

/* Details Page styling inside modal */
.modal-chart-container {
  width: 100%;
  height: 250px;
  margin: 16px 0;
  position: relative;
}

.modal-timeframes {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  background-color: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color-muted);
}

.timeframe-btn {
  flex: 1;
  padding: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  text-align: center;
}

.timeframe-btn.active {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color-muted);
  font-weight: 500;
}

.modal-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.detail-metric-card {
  background-color: var(--bg-tertiary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color-muted);
}

.detail-metric-card .label {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.detail-metric-card .value {
  font-size: 16px;
  font-weight: 600;
}

.risk-progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--bg-primary);
  border-radius: var(--radius-full);
  margin-top: 8px;
  overflow: hidden;
}

.risk-progress-fill {
  height: 100%;
  background: linear-gradient(to right, #9ef01a, #ef4444);
  border-radius: var(--radius-full);
}
