/**
 * css/forage_rain_audit.css
 * Styling for Post-Rain Drill Hole Siltation Diagnostic Engine & Civil Delay Modal
 * Tata Solar PV Project — Milestone M-RAIN
 */

/* Post-Rain Diagnostic Banner */
#rain-audit-banner {
  display: none;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%);
  border-bottom: 2px solid #38bdf8;
  padding: 8px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 18;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

#rain-audit-banner.active {
  display: flex;
}

.audit-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.audit-banner-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #38bdf8;
  white-space: nowrap;
}

.audit-banner-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.audit-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.audit-chip:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(148, 163, 184, 0.8);
}

.audit-chip.active {
  background: rgba(30, 41, 59, 1);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.audit-chip-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.audit-chip-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.audit-chip-val {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  font-family: var(--font-mono, monospace);
}

.audit-chip-pct {
  font-size: 10px;
  color: #cbd5e1;
  opacity: 0.85;
}

/* Specific Chip Color Accents */
.chip-audit-all .audit-chip-indicator { background: #38bdf8; }
.chip-audit-all.active { border-color: #38bdf8; }

.chip-audit-tier1 .audit-chip-indicator { background: #ef4444; }
.chip-audit-tier1.active { border-color: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }

.chip-audit-tier2 .audit-chip-indicator { background: #f59e0b; }
.chip-audit-tier2.active { border-color: #f59e0b; box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }

.chip-audit-tier3 .audit-chip-indicator { background: #10b981; }
.chip-audit-tier3.active { border-color: #10b981; box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }

.audit-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.audit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.audit-btn-csv {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}
.audit-btn-csv:hover {
  background: rgba(16, 185, 129, 0.35);
  border-color: #10b981;
}

.audit-btn-schedule {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
}
.audit-btn-schedule:hover {
  background: rgba(56, 189, 248, 0.35);
  border-color: #38bdf8;
}

.audit-btn-close {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.audit-btn-close:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

/* Schedule Delay Modal Dialog */
#schedule-delay-modal .modal-content {
  width: 720px;
  max-width: 95vw;
  max-height: 85vh;
  background: #090e1a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

.schedule-grid-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.schedule-kpi-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.schedule-kpi-card .val {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  margin-top: 4px;
}

.schedule-kpi-card .lbl {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.schedule-kpi-card .sub {
  font-size: 9px;
  color: #64748b;
  margin-top: 2px;
}

.card-amber .val { color: #f59e0b; }
.card-red .val { color: #ef4444; }
.card-green .val { color: #10b981; }
.card-cyan .val { color: #38bdf8; }

.schedule-controls-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.schedule-slider-row label {
  color: #cbd5e1;
  flex: 1;
}

.schedule-slider-row input[type="range"] {
  flex: 1;
  cursor: pointer;
  accent-color: #38bdf8;
}

.schedule-slider-row .slider-val {
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: #38bdf8;
  width: 90px;
  text-align: right;
}

/* Timeline Comparison */
.schedule-comparison {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 8px;
  padding: 12px;
}

.timeline-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-bar-lbl {
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}

.timeline-bar-track {
  height: 14px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.timeline-bar-fill-red {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%);
  border-radius: 7px;
}

.timeline-bar-fill-phased {
  height: 100%;
  width: 100%;
  display: flex;
  border-radius: 7px;
  overflow: hidden;
}

.bar-segment-t3 {
  background: #10b981;
  width: 39%;
  height: 100%;
}

.bar-segment-t2 {
  background: #f59e0b;
  width: 42%;
  height: 100%;
}

.bar-segment-t1 {
  background: #ef4444;
  width: 19%;
  height: 100%;
}

/* Phased Strategy Cards */
.schedule-phases-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.phase-card {
  background: rgba(30, 41, 59, 0.45);
  border-left: 3px solid #38bdf8;
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phase-card.phase-t3 { border-left-color: #10b981; }
.phase-card.phase-t2 { border-left-color: #f59e0b; }
.phase-card.phase-t1 { border-left-color: #ef4444; }

.phase-title {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
}

.phase-desc {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.35;
}
