/* ==========================================================================
   Main Design System & Global Layout
   Case Study: 予算ゼロから2,000万円の稟議を通せ
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;900&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* Color Palette - Executive Sharp Dark */
  --bg-dark: #090d16;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --bg-card: rgba(26, 34, 52, 0.85);
  --bg-card-hover: rgba(36, 48, 74, 0.95);
  
  --border-subtle: #243048;
  --border-focus: #3b82f6;
  --border-accent: #f59e0b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dark: #0f172a;
  
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-gold-bg: rgba(245, 158, 11, 0.12);
  
  --accent-blue: #3b82f6;
  --accent-blue-light: #60a5fa;
  --accent-blue-bg: rgba(59, 130, 246, 0.12);
  
  --accent-emerald: #10b981;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  
  --accent-rose: #f43f5e;
  --accent-rose-bg: rgba(244, 63, 94, 0.15);
  
  --accent-amber: #f97316;
  
  /* Typography */
  --font-main: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
  
  /* Shadows & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.25);
  --shadow-blue-glow: 0 0 25px rgba(59, 130, 246, 0.25);
  
  /* Layout */
  --header-height: 68px;
  --footer-height: 64px;
}

/* Light / High-Contrast Mode for Bright Projector Rooms */
body.light-theme {
  --bg-dark: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  
  --border-subtle: #cbd5e1;
  --border-focus: #2563eb;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-gold: #d97706;
  --accent-gold-bg: rgba(217, 119, 6, 0.12);
  
  --accent-blue: #2563eb;
  --accent-blue-bg: rgba(37, 99, 235, 0.1);
  
  --accent-emerald: #059669;
  --accent-emerald-bg: rgba(5, 150, 105, 0.12);
  
  --accent-rose: #e11d48;
  --accent-rose-bg: rgba(225, 29, 72, 0.12);
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.16);
  --shadow-glow: 0 0 20px rgba(217, 119, 6, 0.2);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Screen Wrapper - 16:9 Optimized */
#app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, rgba(30, 41, 59, 0.45) 0%, var(--bg-dark) 80%);
}

/* Global Top Navigation Bar */
.top-header {
  height: var(--header-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

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

.case-badge {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: var(--accent-gold);
  color: #0f172a;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.case-title-block {
  display: flex;
  flex-direction: column;
}

.case-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.current-phase-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-gold-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.current-phase-name::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

/* Top Right Controls: Timer + View Switch + Fullscreen */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Timer Component */
.timer-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.timer-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.timer-digits {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 68px;
  text-align: center;
}

.timer-digits.warning {
  color: var(--accent-rose);
  animation: pulse-warn 1s infinite;
}

@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.timer-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.timer-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.timer-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.timer-preset-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.timer-preset-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* View Mode Toggles */
.mode-toggle-group {
  display: flex;
  background: var(--bg-surface-elevated);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

.mode-btn.facilitator-tab.active {
  background: #7c3aed;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
}

/* Action Icon Buttons */
.icon-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Sync Status Indicator */
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

/* Main Viewport Container */
.main-viewport {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Presentation Screen Section */
.presentation-container {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.presentation-container::-webkit-scrollbar {
  width: 6px;
}
.presentation-container::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

/* Bottom Progress Bar */
.bottom-footer {
  height: var(--footer-height);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 28px;
  justify-content: space-between;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.phase-progress-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 860px;
}

.phase-step-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  user-select: none;
}

.phase-step-item:hover {
  background: var(--bg-surface-elevated);
}

.phase-step-bar {
  height: 4px;
  width: 100%;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

.phase-step-item.active .phase-step-bar {
  background: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
}

.phase-step-item.completed .phase-step-bar {
  background: var(--accent-blue);
}

.phase-step-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.phase-step-item.active .phase-step-label {
  color: var(--accent-gold-light);
  font-weight: 700;
}

.phase-step-item.completed .phase-step-label {
  color: var(--text-secondary);
}

/* Footer Nav Buttons */
.footer-nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-nav:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-nav.primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-nav.primary:hover:not(:disabled) {
  background: #2563eb;
}

/* Common Modal / Dialog / Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
