/* ============================================
   DEMO PAGE CSS
   ============================================
   Extracted from base.css PR 6/8 (2026-05-15).
   Contains: Demo (Prototype Browser) page + Demo Admin Panel.
   Consumed by: js/components/pages/Demo.js. */

/* ============================================
   DEMO PAGE - Prototype Browser
   ============================================ */

/* CODENOTE: Three-view mobile layout (browse, preview, feedback)
   - Admin panel modal for prototype management
   - Comment system for gathering feedback
   - Analytics tracking for engagement */

/* CODENOTE: Page container uses standard flex column + gap pattern */
.demo-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-base);
}

.demo-view {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
}

/* Header - extends .header-page with positioning and layout */
.demo-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: var(--space-lg) var(--space-xl);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  /* Match league-settings-header-nav for consistency */
}

.demo-menu-btn {
  padding: var(--space-sm);
  border-radius: var(--border-radius-default);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-admin-btn {
  padding: var(--space-sm);
  color: var(--text-inverse);
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-back-btn {
  padding: var(--space-sm);
  color: var(--text-inverse);
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Browse View */
.demo-browse-content {
  padding: var(--space-base);
  flex: 1;
  overflow-y: auto;
}

.demo-browse-hint {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-weight: var(--font-weight-semibold);
}

.demo-prototype-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.demo-prototype-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-base);
  background: var(--bg-card);
  border-radius: var(--border-radius-default);
  border: var(--border-width-medium) solid var(--border-default);
  border-left: var(--border-width-thickest) solid var(--border-aqua);
  box-shadow: var(--shadow-default);
  transition: all var(--transition-default);
}

.demo-prototype-card:active {
  transform: scale(0.98);
}

.demo-prototype-card.selected {
  border-color: var(--border-action);
  border-left-color: var(--border-action);
  box-shadow: var(--shadow-action);
}

.demo-prototype-name {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  color: var(--text-primary);
}

.demo-prototype-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* Preview View */
.demo-preview-title {
  font-family: var(--font-display);
  font-size: var(--font-size-display-sm);
  letter-spacing: var(--letter-spacing-display);
  text-transform: uppercase;
  font-weight: var(--font-weight-black);
  color: var(--text-inverse);
  flex: 1;
  text-align: center;
  padding: 0 var(--space-base);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}

.demo-preview-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.demo-action-btn {
  padding: var(--space-sm);
  color: var(--text-inverse);
  position: relative;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.demo-badge-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  padding: var(--space-xs);
  background: var(--color-danger-primary);
  color: var(--text-inverse);
  border-radius: 50%;
  font-weight: var(--font-weight-black);
}

.demo-iframe {
  width: 100%;
  flex: 1;
  border: 0;
}

.demo-no-selection {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  text-align: center;
  color: var(--text-secondary);
  padding: var(--space-base);
}

.demo-no-selection p {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  margin: var(--space-md) 0;
}

/* Feedback View */
.demo-feedback-title-row {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  color: var(--text-inverse);
}

.demo-feedback-title {
  font-family: var(--font-display);
  font-size: var(--font-size-display-sm);
  letter-spacing: var(--letter-spacing-display);
  text-transform: uppercase;
  font-weight: var(--font-weight-black);
  margin: 0;
}

.demo-feedback-count {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.demo-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-base);
  min-height: 0;
}

.demo-comments {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.demo-comments-empty {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: center;
  padding: var(--space-2xl);
}

.demo-comment-card {
  background: var(--bg-page);
  border-radius: var(--border-radius-default);
  padding: var(--space-base);
  border: var(--border-width-medium) solid var(--border-default);
}

.demo-comment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.demo-comment-author {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.demo-comment-time {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.demo-comment-text {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  white-space: pre-wrap;
  line-height: var(--line-height-normal);
  margin: 0;
}

.demo-comment-form {
  border-top: var(--border-width-medium) solid var(--border-default);
  padding: var(--space-base);
  background: var(--bg-card);
  flex-shrink: 0;
}

.demo-comment-input {
  width: 100%;
  padding: var(--space-md);
  border: var(--border-width-default) solid var(--border-medium);
  border-radius: var(--border-radius-default);
  font-size: var(--font-size-sm);
  resize: none;
  font-family: var(--font-primary);
  min-height: 80px;
}

.demo-comment-actions {
  margin-top: var(--space-md);
  display: flex;
  justify-content: flex-end;
}

.demo-submit-btn {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius-default);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all var(--transition-default);
  border: var(--border-width-thick) solid var(--color-action-primary);
  background: var(--color-action-primary);
  color: var(--color-white);
}

.demo-submit-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent;
  color: var(--color-action-primary);
}

.demo-cta-btn {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius-default);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  font-size: var(--font-size-base);
  cursor: pointer;
  border: var(--border-width-thick) solid var(--color-action-primary);
  background: var(--color-action-primary);
  color: var(--color-white);
  margin-top: var(--space-base);
}

/* Loading States */
.demo-loading {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
}

.demo-loading-content {
  text-align: center;
}

.demo-loading-content p {
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

.demo-spinner-lg {
  border: var(--border-width-thick) solid var(--border-aqua);
  border-top-color: transparent;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-base);
  animation: spin 0.8s linear infinite;
}

.demo-loading-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-2xl);
}

.demo-spinner {
  border: var(--border-width-medium) solid var(--border-aqua);
  border-top-color: transparent;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 0.8s linear infinite;
}

/* Empty State */
.demo-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  background: var(--bg-page);
}

.demo-empty-content {
  text-align: center;
  max-width: 28rem;
}

.demo-empty-icon {
  color: var(--color-structure-light);
  margin: 0 auto var(--space-base);
  opacity: 0.5;
  display: block;
}

.demo-empty-content p {
  color: var(--text-secondary);
  margin-bottom: var(--space-base);
  font-size: var(--font-size-base);
}

/* ============================================
   DEMO ADMIN PANEL
   ============================================ */

.demo-admin-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-modal-backdrop, 90);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-base);
}

.demo-admin-panel {
  background: var(--bg-card);
  border-radius: var(--border-radius-default);
  border: 3px solid var(--border-accent-body);
  box-shadow: var(--shadow-md);
  max-width: 80rem;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.demo-admin-header {
  background: var(--color-structure-primary);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
}

.demo-admin-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.demo-admin-close {
  background: transparent;
  border: none;
  color: var(--text-inverse);
  cursor: pointer;
  padding: var(--space-sm);
}

.demo-admin-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

.demo-admin-section {
  margin-bottom: var(--space-2xl);
}

.demo-admin-section-header {
  margin-bottom: var(--space-base);
}

.demo-section-title {
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-black);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-width-medium) solid var(--border-action);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.demo-section-desc {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

.demo-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  cursor: pointer;
}

.demo-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.demo-prototype-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-base);
  border-radius: var(--border-radius-default);
  border: var(--border-width-medium) solid var(--border-default);
  border-left: var(--border-width-thickest) solid var(--border-aqua);
  margin-bottom: var(--space-sm);
}

.demo-prototype-admin-row.active {
  background: var(--bg-card);
}

.demo-prototype-admin-row.inactive {
  background: var(--bg-page);
  opacity: 0.7;
}

.demo-prototype-admin-info {
  flex: 1;
}

.demo-prototype-admin-name {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.demo-prototype-admin-meta {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.demo-toggle-btn {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  border-radius: var(--border-radius-default);
  cursor: pointer;
  transition: all var(--transition-default);
  border: var(--border-width-thick) solid var(--color-action-primary);
}

.demo-toggle-btn.active {
  background: transparent;
  color: var(--color-action-primary);
}

.demo-toggle-btn:not(.active) {
  background: var(--color-action-primary);
  color: var(--color-white);
}

/* Analytics Table */
.demo-analytics-table-wrap {
  background: var(--bg-page);
  border-radius: var(--border-radius-default);
  overflow-x: auto;
  border: var(--border-width-medium) solid var(--border-default);
}

.demo-analytics-table {
  width: 100%;
  border-collapse: collapse;
}

.demo-analytics-table th {
  text-align: left;
  padding: var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-black);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  border-bottom: var(--border-width-medium) solid var(--border-default);
}

.demo-analytics-table th:nth-child(2),
.demo-analytics-table th:nth-child(3),
.demo-analytics-table th:nth-child(4) {
  text-align: center;
}

.demo-analytics-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-default);
}

.demo-analytics-name {
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
}

.demo-analytics-table td:nth-child(2),
.demo-analytics-table td:nth-child(3),
.demo-analytics-table td:nth-child(4) {
  text-align: center;
}

.demo-analytics-num {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.demo-analytics-time {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.demo-status-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
}

.demo-status-badge.active {
  background: var(--color-accent-aqua);
  color: var(--text-inverse);
}

.demo-status-badge.inactive {
  background: var(--color-structure-bg);
  color: var(--text-primary);
  border: var(--border-width-default) solid var(--border-default);
}

/* ============================================
