/* ========================================
   AB PROPORTION TOOL - CUSTOM STYLES
   Inherits shared patterns from main.css:
   - .info-icon (tooltips)
   - .quick-start-card (onboarding)
   - .pulse-success (animations)
   Note: .hero-header and .professor-mode-banner
   inherit max-width: 1200px from main.css to match app-main
   ======================================== */

/* ========================================
   SLIDER LAYOUT & VALUE DISPLAYS
   ======================================== */

/* Side-by-side slider grid for proportion and sample size */
.slider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 0.75rem;
}

.slider-group {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
}

.slider-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #334155;
}

.slider-group .value-display {
  color: #3b82f6;
  font-weight: 700;
  font-size: 1.05rem;
}

.group-name-input {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  padding: 0.6rem !important;
  border: 2px solid #3b82f6 !important;
  background: #f0f9ff !important;
}

.group-name-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.group-label-text {
  font-size: 1rem;
  font-weight: 600;
  color: #1e40af;
}

@media (max-width: 768px) {
  .slider-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ========================================
   BASE LAYOUT & APP WRAPPER
   ======================================== */

.app-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem 2rem 1rem;
}

.app-main section {
  margin: 2.5rem 0;
}

.app-main h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.app-main .card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
}

.app-main .card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ========================================
   VISUAL OUTPUT SECTION
   ======================================== */

.visual-output {
  margin: 2.5rem 0;
}

.visual-output h2 {
  margin-bottom: 1.25rem;
}

.visual-output .card {
  background: #fafbfc;
}

.chart-card {
  background: white;
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid #e5e7eb;
}

.chart-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin: 0 0 1rem 0;
}

.chart-note {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* Base chart styles */
#propChart,
#diffChart {
  width: 100%;
  height: 420px;
  margin-top: 18px;
}

.summary-wrap {
  margin-top: 22px;
}

.summary-warning {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--app-danger);
}

/* ========================================
   DATA ENTRY & INPUTS
   ======================================== */

.inputs-panel {
  margin: 2.5rem 0;
}

.inputs-panel h2 {
  margin-bottom: 1.25rem;
}

.data-entry-card {
  background: #fafbfc;
}

.data-entry-card .input-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #334155;
  margin: 0 0 1rem 0;
}

.data-entry-card .manual-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
  background: white;
  margin-top: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.data-entry-card .manual-card:first-child {
  margin-top: 0;
}

.data-entry-card .manual-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.data-entry-card label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  display: block;
  margin-bottom: 0.5rem;
}

.data-entry-card .hint {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ========================================
   SCENARIO SELECTOR (MODERN STYLE)
   ======================================== */

.scenario-selector-panel {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.full-width-select {
  width: 100%;
  padding: 0.75rem;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  font-size: 1rem;
  background: white;
  transition: all 0.2s ease;
  cursor: pointer;
}

.full-width-select:hover {
  border-color: #94a3b8;
}

.full-width-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ========================================
   DECISION INDICATOR (TRAFFIC LIGHT SYSTEM)
   ======================================== */

.decision-section {
  margin: 2.5rem 0;
}

.decision-section h2 {
  margin-bottom: 1.25rem;
}

.decision-card {
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid transparent;
  background: white;
}

/* Pending state (neutral) */
.decision-pending {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Success state (Green - Winner detected) */
.decision-success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-color: #10b981;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
  animation: pulse-success 2s ease-in-out infinite;
}

/* Warning state (Yellow - Borderline) */
.decision-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
}

/* Danger state (Red - No winner) */
.decision-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #ef4444;
}

.decision-indicator {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.decision-icon {
  font-size: 4rem;
  line-height: 1;
  flex-shrink: 0;
}

.decision-status h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
}

.decision-status p {
  margin: 0;
  font-size: 1.1rem;
  color: #475569;
  line-height: 1.5;
}

.decision-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  margin-top: 1rem;
}

.decision-metric {
  text-align: center;
}

.metric-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}

.decision-action-btn {
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.decision-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* ========================================
   ROI CALCULATOR (NEW - PHASE 1)
   ======================================== */

.roi-section {
  margin: 2.5rem 0;
}

.roi-section h2 {
}

.decision-success.pulse-success {
  margin-bottom: 1.25rem;
}

.roi-section .card {
  background: #fafbfc;
  border: 1px solid #e5e7eb;
}

/* ROI Details expandable section */
.roi-details {
  margin-top: 0.75rem;
}

.roi-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  color: #0f172a;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #3b82f6;
  border-radius: 8px;
  list-style: none;
  transition: all 0.2s ease;
  user-select: none;
}

.roi-details summary::-webkit-details-marker {
  display: none;
}

.roi-details summary:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.roi-details[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  margin-bottom: 0;
}

.roi-explanation {
  padding: 1.25rem;
  background: #f8fafc;
  border: 2px solid #3b82f6;
  border-top: none;
  margin-top: 0;
  margin-bottom: 1rem;
}

.roi-explanation p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.roi-explanation strong {
  color: #0f172a;
}

.roi-explanation ul {
  margin: 0.5rem 0 1rem 1.5rem;
  padding: 0;
}

.roi-explanation li {
  margin: 0.35rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.roi-explanation .hint {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  font-style: italic;
  color: #78350f;
  font-size: 0.9rem;
}

.roi-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.roi-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.roi-input-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #475569;
}

.roi-input-group input {
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.roi-input-group input:focus {
  outline: none;
  border-color: #3b82f6;
}

#roi-calculate-btn {
  padding: 0.75rem 2rem;
  white-space: nowrap;
}

.roi-results {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #93c5fd;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.roi-results h3 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: #1e40af;
}

.roi-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.roi-metric-card {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e7ff;
  transition: all 0.2s ease;
}

.roi-metric-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.roi-metric-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.roi-metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
}

.roi-recommendation {
  margin: 1rem 0 0 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #334155;
}

.roi-recommendation strong {
  color: #0f172a;
}

/* ========================================
   DUAL PANELS & RESULT CARDS
   ======================================== */

.dual-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.dual-panel {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.dual-panel:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.dual-panel h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #334155;
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f1f5f9;
}

/* ========================================
   PROFESSOR MODE STYLES
   ======================================== */

.professor-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.professor-mode-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.professor-mode-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #fbbf24;
}

/* ========================================
   LEARNING RESOURCES (Collapsible)
   ======================================== */

.learning-section {
  margin: 2.5rem 0;
}

.learning-section h2 {
  margin-bottom: 1.5rem;
}

.learning-section .card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.learning-details {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  margin: 0.75rem 0;
  transition: all 0.2s ease;
}

.learning-details:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.learning-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #334155;
  user-select: none;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.learning-details summary:hover {
  color: #1e293b;
}

.learning-details[open] summary {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
  color: #3b82f6;
}

.learning-details ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.learning-details li {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* ========================================
   DETAILED STATS (Collapsible)
   ======================================== */

.test-results {
  margin: 2.5rem 0;
}

.detailed-stats-section {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.detailed-stats-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  color: #475569;
  user-select: none;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.detailed-stats-section summary:hover {
  color: #1e293b;
}

.detailed-stats-section[open] summary {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #cbd5e1;
  color: #3b82f6;
}

/* ========================================
   EXPORT CONTROLS
   ======================================== */

.export-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.export-controls button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
}

/* ========================================
   SAMPLE SIZE WARNING
   ======================================== */

#sample-size-warning-container.hidden {
  display: none;
}

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

@media (max-width: 768px) {
  .app-main {
    padding: 0 0.75rem 1.5rem 0.75rem;
  }
  
  .app-main section {
    margin: 2rem 0;
  }
  
  .roi-inputs {
    grid-template-columns: 1fr;
  }
  
  .quick-start-cards {
    grid-template-columns: 1fr;
  }
  
  .decision-indicator {
    flex-direction: column;
    text-align: center;
  }
  
  .decision-details {
    grid-template-columns: 1fr;
  }
  
  .dual-panels {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .chart-grid {
    grid-template-columns: 1fr;
  }
  
  .roi-metrics {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   SCENARIO & DIAGNOSTICS SECTIONS
   ======================================== */

.scenario-section {
  margin: 2.5rem 0;
}

.scenario-section h2 {
  margin-bottom: 1.25rem;
}

.diagnostics-section {
  margin: 2.5rem 0;
}

.diagnostics-section h2 {
  margin-bottom: 1.25rem;
}

.diagnostics-details {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.diagnostics-details:hover {
  border-color: #cbd5e1;
}

.diagnostics-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #475569;
  user-select: none;
  padding: 0.5rem;
  font-size: 0.95rem;
}

.diagnostics-details[open] summary {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

/* ========================================
   HIDDEN UTILITY
   ======================================== */

.hidden {
  display: none !important;
}
