/* landscape.css - Tabbed Strategic Dashboard (Charter Compliant) */

:root {
  --bg: #f6efe3;
  --surface: #fffaf2;
  --ink: #1d1a17;
  --muted: #5b544b;
  --accent: #b6542e;
  --accent-2: #1f6f68;
  --ring: #eadcc8;
  --header-height: 70px;
  --tab-height: 60px;
}

body.landscape-dashboard {
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 20% 0%, #f9f0e1 0, transparent 45%),
    radial-gradient(circle at 90% 20%, #ead7bd 0, transparent 45%),
    linear-gradient(130deg, #f4e6d3, #f7f2ea 50%, #efe4d5);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Grain Effect */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.07;
  background-image: radial-gradient(#000 0.6px, transparent 0.6px);
  background-size: 5px 5px;
  z-index: 2000;
}

/* Header */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: rgba(255, 250, 242, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ring);
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.15s;
}
.nav-back:hover { color: var(--ink); }

.nav-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* Tab Navigation */
.tab-bar {
  display: flex;
  justify-content: center;
  background: var(--surface);
  border-bottom: 1px solid var(--ring);
  height: var(--tab-height);
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 24px;
  font-family: "Syne", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover { color: var(--accent); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: rgba(182, 84, 46, 0.05); }

/* Main Content Area */
.main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.tab-content {
  position: absolute;
  inset: 0;
  display: none;
  padding: 32px;
  overflow-y: auto;
  overflow-x: hidden;
  animation: fadeIn 0.4s ease-out;
  box-sizing: border-box;
}

.tab-content.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Grid Layouts inside tabs */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--ring);
  padding: 24px;
  border-radius: 8px;
  transition: transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover { transform: translateY(-2px); border-color: var(--accent); }

.card-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 12px;
  display: inline-block;
  background: rgba(31, 111, 104, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}

.card h4 { font-family: "Syne", sans-serif; font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.card p { font-family: "Junicode", serif; font-size: 1rem; color: var(--ink); line-height: 1.5; }

/* Mini-Graphs inside cards */
.viz-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(29, 26, 23, 0.05);
  border-radius: 4px;
  margin: 15px 0;
  overflow: hidden;
  position: relative;
}

.viz-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 1s ease-out;
}

.viz-donut {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}

.viz-donut-circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 100 100;
  transition: stroke-dashoffset 1s ease-out;
}

.mini-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  width: 60px;
  color: var(--muted);
}

.chart-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(29, 26, 23, 0.05);
  border-radius: 3px;
}

.chart-bar-val {
  height: 100%;
  background: var(--accent-2);
  border-radius: 3px;
}
.radar-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  background: var(--surface);
  border: 1px solid var(--ring);
  padding: 40px;
  border-radius: 12px;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  box-sizing: border-box;
}

.radar-viz { 
  flex: 0 0 auto;
  width: 300px; 
  height: 300px; 
}

.overview-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.card-viz {
  margin-top: auto;
  padding-top: 16px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: auto;
  padding-top: 12px;
  text-transform: uppercase;
  opacity: 0.7;
  align-self: flex-start;
}

.card-viz + .source-link { margin-top: 0; }

.source-link:hover { opacity: 1; }

/* Risks List */
.risk-section { margin-bottom: 40px; }
.risk-section h3 { 
  font-family: "Syne", sans-serif; 
  font-size: 0.8rem; 
  text-transform: uppercase; 
  border-bottom: 1px solid var(--ring); 
  padding-bottom: 8px; 
  margin-bottom: 24px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.risk-item {
  background: var(--surface);
  border: 1px solid var(--ring);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.risk-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(182, 84, 46, 0.05);
}

.risk-content { width: 100%; }

.risk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.risk-header h5 { margin: 0; }

.risk-impact-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.impact-critical { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.impact-high { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.impact-medium { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }

.risk-content h5 { font-family: "Junicode", serif; font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.risk-content p { font-size: 0.95rem; color: var(--muted); line-height: 1.5; margin: 0; }

/* Responsive */
@media (max-width: 900px) {
  .top-nav {
    padding: 0 16px;
  }

  .tab-bar {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px;
    scrollbar-width: none;
  }
  
  .tab-bar::-webkit-scrollbar { display: none; }
  
  .tab-btn {
    padding: 0 16px;
    font-size: 0.65rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .tab-content {
    padding: 20px 16px;
  }

  .radar-panel {
    flex-direction: column;
    text-align: center;
    gap: 24px;
    padding: 24px 16px;
    margin: 0 auto;
    width: 100%;
  }

  .radar-viz {
    width: 240px;
    height: 240px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .risk-item {
    flex-direction: column;
    gap: 12px;
  }

  .risk-impact-badge {
    flex: none;
    width: 100%;
  }

  .card h4 {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .radar-viz {
    width: 200px;
    height: 200px;
  }
  
  .card {
    padding: 16px;
  }
}
