/* ==========================================================================
   ROOM-Acoustics Web - View Specific Layouts & Visualizations
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Home View Dashboard
   -------------------------------------------------------------------------- */
.dashboard-section {
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-lg);
  min-height: 140px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.module-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

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

.module-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
  transition: transform var(--transition-fast);
}

.module-card:hover .module-icon-wrap {
  transform: scale(1.08);
}

.module-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.module-desc {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.module-lock {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--color-warning);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   2. Two-Channel Placement View
   -------------------------------------------------------------------------- */
.two-channel-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.canvas-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 480px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  touch-action: none;
}

.canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.placement-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-sm);
}

.metric-pill {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  text-align: center;
}

.metric-pill .metric-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
}

.metric-pill .metric-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   3. Sound Pressure Meter View
   -------------------------------------------------------------------------- */
.spl-meter-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md);
}

.analog-gauge-wrap {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 16 / 11;
  position: relative;
}

.analog-gauge-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.spl-digital-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.spl-digital-val {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 800;
  color: var(--color-text-primary);
  line-height: 1;
  letter-spacing: -0.04em;
}

.spl-digital-unit {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.spl-stats-row {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  width: 100%;
  max-width: 460px;
}

.spl-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-surface);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  flex: 1;
}

.spl-stat-val {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
}

.spl-stat-lbl {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   4. Bolt Area & Room Modes
   -------------------------------------------------------------------------- */
.bolt-chart-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 400px;
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.bolt-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.ratio-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

.ratio-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.ratio-card.status-optimal { border-color: var(--color-success); background: rgba(52, 199, 89, 0.05); }
.ratio-card.status-near { border-color: var(--color-warning); background: rgba(255, 149, 0, 0.05); }
.ratio-card.status-poor { border-color: var(--color-danger); background: rgba(255, 59, 48, 0.05); }

.ratio-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.ratio-card-val {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   5. Acoustic Frequency Response Chart (Common Canvas)
   -------------------------------------------------------------------------- */
.acoustic-chart-wrap {
  width: 100%;
  height: 320px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
  margin: var(--space-sm) 0;
  touch-action: none;
}

.acoustic-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-cursor-tooltip {
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--color-surface-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--color-border-subtle);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   6. Camera / AR Measurement Overlay
   -------------------------------------------------------------------------- */
.camera-view-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 480px;
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.camera-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-full);
  pointer-events: none;
}

.camera-reticle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.camera-hud {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: #FFF;
}

/* --------------------------------------------------------------------------
   7. Reverb Time & Materials Table
   -------------------------------------------------------------------------- */
.materials-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: var(--space-sm);
}

.materials-table th, .materials-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-subtle);
}

.materials-table th {
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ratio-cards-row {
    grid-template-columns: 1fr;
  }
  .acoustic-chart-wrap {
    height: 250px;
  }
  .spl-digital-val {
    font-size: 3.2rem;
  }
}

/* --------------------------------------------------------------------------
   8. SEO & GEO Semantic Knowledge Card & Footer
   -------------------------------------------------------------------------- */
.seo-geo-knowledge-card {
  margin-top: 28px;
  padding: 20px 22px;
  border-radius: var(--radius-lg, 16px);
  background: var(--color-surface, rgba(255, 255, 255, 0.72));
  border: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.08));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.seo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.08));
}

.seo-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.seo-geo-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.12);
  color: var(--color-primary, #007AFF);
}

.seo-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.seo-info-block {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(128, 128, 128, 0.05);
  border: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.06));
}

.seo-info-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.seo-formula-box {
  display: block;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--color-primary, #007AFF);
  background: rgba(0, 122, 255, 0.06);
  padding: 8px 10px;
  border-radius: 8px;
  overflow-x: auto;
}

.seo-standards-text {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--color-text-primary);
}

.seo-faq-section {
  margin-top: 14px;
  margin-bottom: 14px;
}

.seo-faq-heading {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin: 0 0 8px 0;
}

.seo-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seo-faq-details {
  border-radius: 10px;
  background: rgba(128, 128, 128, 0.04);
  border: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.07));
  padding: 10px 14px;
  transition: background 0.2s ease;
}

.seo-faq-details[open] {
  background: rgba(0, 122, 255, 0.04);
  border-color: rgba(0, 122, 255, 0.22);
}

.seo-faq-summary {
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--color-text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.seo-faq-summary::after {
  content: '+';
  font-weight: 700;
  color: var(--color-primary, #007AFF);
  margin-left: 8px;
}

.seo-faq-details[open] .seo-faq-summary::after {
  content: '−';
}

.seo-faq-answer {
  margin: 8px 0 0 0;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border-subtle, rgba(0, 0, 0, 0.08));
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.seo-keyword-cloud,
.seo-related-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.06));
}

.seo-keyword-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-right: 4px;
}

.seo-keyword-tag {
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.08);
  color: var(--color-text-secondary);
}

.seo-related-link {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(0, 122, 255, 0.09);
  color: var(--color-primary, #007AFF);
  text-decoration: none;
  transition: background 0.15s ease;
}

.seo-related-link:hover {
  background: rgba(0, 122, 255, 0.18);
}

.app-seo-footer {
  margin-top: 36px;
  padding: 20px 16px 32px;
  border-top: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.08));
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.app-seo-footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}

.app-seo-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.app-seo-footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.app-seo-footer-links a:hover {
  color: var(--color-primary, #007AFF);
  text-decoration: underline;
}

