/**
 * EcoMine - Layer Health Report Styles (v2 - Clean)
 * ==================================================
 */

/* ============================================
   HEALTH STATUS PANEL (Global)
   ============================================ */

.health-status-panel {
  margin: 0 0 12px 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.health-status-panel.status-green {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.health-status-panel.status-yellow {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.health-status-panel.status-red {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.health-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.health-status-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.health-status-info {
  flex: 1;
  min-width: 0;
}

.health-status-title {
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health-status-title.text-green { color: #10b981; }
.health-status-title.text-yellow { color: #f59e0b; }
.health-status-title.text-red { color: #ef4444; }
.health-status-title.text-muted { color: var(--text-muted); }

.health-status-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health-score-box {
  text-align: center;
  flex-shrink: 0;
  min-width: 45px;
}

.health-score-number {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.health-score-number.text-green { color: #10b981; }
.health-score-number.text-yellow { color: #f59e0b; }
.health-score-number.text-red { color: #ef4444; }

.health-score-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ============================================
   LAYER CARDS WITH HEALTH
   ============================================ */

.layer-card-health {
  position: relative;
  padding-left: 6px !important;
}

.layer-health-indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

.layer-health-indicator.status-green { background: #10b981; }
.layer-health-indicator.status-yellow { background: #f59e0b; }
.layer-health-indicator.status-red { background: #ef4444; }

/* Layer Header Layout */
.layer-card-health .layer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 10px 4px;
}

.layer-card-health .layer-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.layer-card-health .layer-name {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-bottom: 2px;
}

.layer-card-health .layer-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* Badges */
.layer-health-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
}

.layer-health-badge.badge-green {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.layer-health-badge.badge-yellow {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.layer-health-badge.badge-red {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.layer-health-badge.badge-type {
  background: rgba(59, 130, 246, 0.2);
  color: #6b7280;
}

.layer-health-badge.badge-restriction {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

/* Coverage Bar */
.layer-coverage-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.layer-coverage-fill {
  height: 100%;
  transition: width 0.3s;
}

.layer-coverage-fill.fill-green { background: #10b981; }
.layer-coverage-fill.fill-yellow { background: #f59e0b; }
.layer-coverage-fill.fill-red { background: #ef4444; }

/* Score Display */
.layer-score-display {
  text-align: right;
  flex-shrink: 0;
  min-width: 35px;
}

.layer-score-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.layer-score-value.text-green { color: #10b981; }
.layer-score-value.text-yellow { color: #f59e0b; }
.layer-score-value.text-red { color: #ef4444; }

/* ============================================
   AOI STATUS
   ============================================ */

.aoi-status-panel {
  margin: 0 0 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.aoi-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.aoi-status-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.aoi-status-title i {
  color: #10b981;
}

/* ============================================
   HEALTH DETAIL MODAL
   ============================================ */

.health-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.health-detail-icon {
  font-size: 1.5rem;
}

.health-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.health-metric-card {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.health-metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.health-metric-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.health-metric-value.text-green { color: #10b981; }
.health-metric-value.text-yellow { color: #f59e0b; }
.health-metric-value.text-red { color: #ef4444; }

/* Small Metrics Grid */
.health-small-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.health-small-metric {
  padding: 10px 6px;
  border-radius: 6px;
  background: var(--bg-card);
  text-align: center;
}

.health-small-metric-value {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health-small-metric-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Flags Section */
.health-flags-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.health-flag-card {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid;
  margin-bottom: 8px;
}

.health-flag-card.flag-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.health-flag-card.flag-yellow {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.health-flag-card.flag-red {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.health-flag-card.flag-green {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.health-flag-row {
  display: flex;
  gap: 10px;
}

.health-flag-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.health-flag-content {
  flex: 1;
  min-width: 0;
}

.health-flag-message {
  font-size: 0.85rem;
  font-weight: 500;
}

.health-flag-message.text-info { color: #6b7280; }
.health-flag-message.text-yellow { color: #f59e0b; }
.health-flag-message.text-red { color: #ef4444; }
.health-flag-message.text-green { color: #10b981; }

.health-flag-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.health-flag-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Success Box */
.health-success-box {
  padding: 24px;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
  text-align: center;
}

.health-success-icon {
  font-size: 2rem;
  color: #10b981;
}

.health-success-text {
  color: #10b981;
  font-weight: 600;
  margin-top: 8px;
}

.health-success-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Progress Bar */
.health-progress-section {
  margin-top: 16px;
}

.health-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.health-progress-track {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.health-progress-fill {
  height: 100%;
  transition: width 0.3s;
}

.health-progress-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   AOI MODAL OPTIONS
   ============================================ */

.aoi-option {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.aoi-option:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.aoi-option-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.aoi-option-title {
  font-weight: 500;
  font-size: 0.9rem;
}

.aoi-option-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================
   TYPE SELECTOR
   ============================================ */

.layer-type-selector {
  margin-top: 8px;
}

.layer-type-selector select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
}

.layer-type-change-btn {
  margin-top: 6px;
  font-size: 0.7rem;
  color: #10b981;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.layer-type-change-btn:hover {
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
  .health-metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .health-small-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}
