/**
 * WEZ Analysis Styling
 * Extends cockpit-theme.css with WEZ-specific styles
 * Follows KNOMAD button/input/panel class system
 *
 * Structure:
 * 1. MEASURED section (read-only display cells)
 * 2. SKILL section (radio button groups)
 * 3. QUERY section (range input, target select, calculate button)
 * 4. RESULTS section (Ph display, breakdown)
 */

/* ============================================================================
   WEZ ANALYSIS SECTION - Integrated into MV SD + WEZ Tab
   ============================================================================ */

.wez-analysis-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid rgba(0, 230, 118, 0.3);
}

/* Section Header */
.wez-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.wez-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #00e676;
}

.wez-icon {
  font-size: 18px;
}

.wez-methodology {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================================
   MEASURED DATA SECTION (Read-Only Display)
   ============================================================================ */

.wez-measured-section {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.08), rgba(0, 200, 255, 0.05));
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.wez-measured-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.wez-measured-icon {
  font-size: 14px;
}

.wez-measured-tag {
  margin-left: auto;
  background: rgba(0, 230, 118, 0.2);
  color: #00e676;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wez-measured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wez-measured-cell {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  transition: all 0.2s;
}

.wez-measured-cell.wez-cell-measured {
  border-color: rgba(0, 230, 118, 0.4);
  background: rgba(0, 230, 118, 0.05);
}

.wez-measured-cell.wez-cell-default {
  border-color: rgba(255, 152, 0, 0.3);
  background: rgba(255, 152, 0, 0.05);
}

.wez-cell-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.wez-cell-value {
  font-size: 20px;
  font-weight: 700;
  color: #00e676;
  text-shadow: 0 0 6px rgba(0, 230, 118, 0.3);
}

.wez-cell-measured .wez-cell-value {
  color: #00e676;
}

.wez-cell-default .wez-cell-value {
  color: rgba(255, 152, 0, 0.8);
}

.wez-cell-source {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

.wez-measured-help {
  text-align: center;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.4);
}

.wez-measured-help small {
  font-size: 10px;
}

/* ============================================================================
   SKILL ASSESSMENT SECTION (Radio Buttons)
   ============================================================================ */

.wez-skill-section {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.wez-skill-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.wez-skill-icon {
  font-size: 14px;
}

.wez-skill-group {
  margin-bottom: 12px;
}

.wez-skill-group:last-child {
  margin-bottom: 0;
}

.wez-skill-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Radio Button Group - Horizontal */
.wez-radio-group {
  display: flex;
  gap: 8px;
}

.wez-radio-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.wez-radio-option:hover {
  border-color: rgba(0, 230, 118, 0.4);
  background: rgba(0, 230, 118, 0.05);
}

.wez-radio-option input[type='radio'] {
  display: none;
}

.wez-radio-option input[type='radio']:checked + .wez-radio-mark {
  background: #00e676;
  border-color: #00e676;
}

.wez-radio-option input[type='radio']:checked + .wez-radio-mark::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #000;
  border-radius: 50%;
}

.wez-radio-option input[type='radio']:checked ~ .wez-radio-text {
  color: #00e676;
}

.wez-radio-mark {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.wez-radio-text {
  display: flex;
  flex-direction: column;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s;
}

.wez-radio-text strong {
  font-size: 11px;
  font-weight: 600;
}

.wez-radio-text small {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================================================
   QUERY SECTION (Range, Target, Calculate Button)
   ============================================================================ */

.wez-query-section {
  margin-bottom: 16px;
}

.wez-query-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.wez-query-field {
  flex: 1;
}

.wez-query-label {
  display: block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.wez-query-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wez-query-input {
  width: 80px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  color: #00e676;
  text-align: center;
}

.wez-query-input:focus {
  outline: none;
  border-color: #00e676;
  box-shadow: 0 0 6px rgba(0, 230, 118, 0.3);
}

.wez-query-unit {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.wez-query-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: 4px;
  padding: 8px;
  font-size: 12px;
  color: #00e676;
  cursor: pointer;
}

.wez-query-select:focus {
  outline: none;
  border-color: #00e676;
}

/* Calculate Button - Adjacent to inputs */
.wez-calc-btn {
  background: linear-gradient(135deg, #00e676, #00c853);
  color: #000;
  border: 1px solid rgba(0, 230, 118, 0.4);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.wez-calc-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 230, 118, 0.4);
  border-color: rgba(0, 230, 118, 0.7);
}

.wez-calc-btn:active:not(:disabled) {
  transform: translateY(0);
}

.wez-calc-btn:focus-visible {
  outline: 2px solid rgba(0, 230, 118, 0.8);
  outline-offset: 2px;
}

.wez-calc-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.5);
}

/* ============================================================================
   RESULTS SECTION
   ============================================================================ */

.wez-results-section {
  background: linear-gradient(180deg, rgba(0, 230, 118, 0.1), rgba(0, 0, 0, 0.3));
  border: 1px solid rgba(0, 230, 118, 0.4);
  border-radius: 8px;
  padding: 16px;
}

.wez-result-main {
  text-align: center;
  margin-bottom: 16px;
}

.wez-ph-display {
  margin-bottom: 8px;
}

.wez-ph-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wez-ph-value {
  font-size: 56px;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 0 20px currentColor;
}

.wez-ph-excellent {
  color: #00e676;
}
.wez-ph-good {
  color: #00c8ff;
}
.wez-ph-fair {
  color: #ffb300;
}
.wez-ph-poor {
  color: #ff5252;
}

/* Sigma Display Row */
.wez-sigma-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.wez-sigma-cell {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}

.wez-sigma-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wez-sigma-value {
  font-size: 16px;
  font-weight: 700;
  color: #00ffff;
}

/* Breakdown Columns */
.wez-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

.wez-breakdown-col {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 10px;
}

.wez-breakdown-title {
  font-size: 10px;
  font-weight: 600;
  color: rgba(0, 230, 118, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-align: center;
}

.wez-breakdown-item {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  padding: 2px 0;
}

.wez-breakdown-item span:last-child {
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Courier New', monospace;
}

/* Limiting Factor */
.wez-limiting {
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.wez-limiting-label {
  font-size: 10px;
  color: rgba(255, 152, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.wez-limiting-value {
  font-size: 13px;
  font-weight: 600;
  color: #ffb300;
  margin-bottom: 4px;
}

.wez-limiting-tip {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}
