/* ==========================================================================
   UBI Statistical Analysis Toolkit - Layout CSS
   ========================================================================== */

.app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 100;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main Workspace */
.app-main {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height));
  position: relative;
  overflow: hidden;
}

/* Left Wizard & Parameter Input Panel */
.wizard-sidebar {
  width: var(--sidebar-width);
  min-width: 360px;
  max-width: 480px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 16px;
  gap: 16px;
}

/* Right Dashboard / Results Panel */
.results-dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 16px 20px;
  gap: 16px;
  background: var(--bg-primary);
}

/* Top Result Executive Verdict Banner */
.verdict-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.verdict-banner.verdict-success {
  border-left: 4px solid var(--accent-success);
}

.verdict-banner.verdict-neutral {
  border-left: 4px solid var(--accent-warning);
}

.verdict-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.verdict-headline {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.verdict-test-badge {
  background: rgba(0, 101, 189, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, 0.3);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.verdict-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Assumptions Row */
.assumptions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.assumption-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.assumption-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.assumption-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.assumption-badge.passed {
  background: var(--accent-success-bg);
  color: var(--accent-success);
  border: 1px solid rgba(46, 160, 67, 0.3);
}

.assumption-badge.violated {
  background: var(--accent-warning-bg);
  color: var(--accent-warning);
  border: 1px solid rgba(210, 153, 34, 0.3);
}

.assumption-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Chart Canvas Section in Dashboard */
.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.chart-header {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-nav-tabs {
  display: flex;
  gap: 4px;
}

.chart-nav-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chart-nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.chart-nav-btn.active {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
}

.chart-body {
  height: 420px;
  width: 100%;
  position: relative;
  background: var(--bg-secondary);
}

#stat-plot-area {
  width: 100%;
  height: 100%;
}

/* Sidebar Source Actions Box */
.sidebar-source-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.sidebar-source-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-source-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sidebar-source-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Full-height Data Display Section */
.data-display-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.data-display-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.data-display-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-display-badge {
  font-size: 11px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.data-display-table-wrapper {
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}

/* Head-to-Head Comparison Card & Table */
.head-to-head-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid #818cf8;
}

.head-to-head-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.head-to-head-table th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  text-align: left;
  padding: 9px 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.head-to-head-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.head-to-head-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.head-to-head-table td.col-aspect {
  font-weight: 600;
  color: var(--text-secondary);
  width: 25%;
}

.head-to-head-table td.col-param {
  width: 37.5%;
}

.head-to-head-table td.col-nonparam {
  width: 37.5%;
}
