/* PragCore Multi-Platform Demo System CSS */
:root {
  --bg-dark: #080c14;
  --bg-card: rgba(16, 24, 40, 0.75);
  --bg-card-hover: rgba(24, 34, 54, 0.85);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-glow: rgba(56, 189, 248, 0.15);
  
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.4);
  --accent-purple: #a855f7;
  --accent-green: #22c55e;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 15% 15%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
    radial-gradient(at 85% 85%, rgba(168, 85, 247, 0.08) 0px, transparent 50%);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Header & Controls */
header {
  padding: 1.25rem 2rem;
  background: rgba(8, 12, 20, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--glass-glow);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #7e22ce);
  border: none;
  font-weight: 600;
}

.btn-primary:hover {
  opacity: 0.95;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--accent-red);
}

/* Main Layout Grid */
main {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  height: calc(100vh - 75px);
}

.stage-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.view-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.view-tabs {
  display: flex;
  gap: 0.5rem;
}

.tab-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Multi-Platform Device Display Grid */
.device-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
  flex: 1;
  align-items: center;
  justify-items: center;
}

/* 1. Web Simulator Frame */
.web-frame {
  width: 100%;
  height: 580px;
  background: #0f172a;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.web-browser-bar {
  background: #1e293b;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.browser-address {
  flex: 1;
  background: #0f172a;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.web-body {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  position: relative;
}

/* 2. iOS iPhone 16 Pro Frame */
.ios-shell {
  width: 290px;
  height: 580px;
  background: #000;
  border-radius: 46px;
  border: 4px solid #334155;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ios-dynamic-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: #000;
  border-radius: 20px;
  z-index: 50;
}

.ios-screen {
  flex: 1;
  background: #090d16;
  margin: 4px;
  border-radius: 40px;
  padding: 2.5rem 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.ios-home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}

/* 3. Android Pixel 9 Pro Frame */
.android-shell {
  width: 290px;
  height: 580px;
  background: #111827;
  border-radius: 36px;
  border: 4px solid #475569;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.android-punchhole {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: #000;
  border-radius: 50%;
  z-index: 50;
}

.android-screen {
  flex: 1;
  background: #0d131f;
  margin: 4px;
  border-radius: 32px;
  padding: 2.2rem 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.android-nav-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

/* Common Interactive App UI Components inside Frame */
.app-header-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.app-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-badge {
  font-size: 0.7rem;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Interactive Component Blocks inside Device Screens */
.target-block {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.target-block:hover {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
}

.target-block.active-target {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.target-block .target-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.target-block .target-val {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
}

.target-badge-new {
  display: inline-block;
  background: var(--accent-green);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
}

/* Bottom Sheet / Popover Feedback Cards inside Devices */
.feedback-overlay-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e293b;
  border-top: 1px solid var(--primary);
  border-radius: 16px 16px 0 0;
  padding: 1rem;
  z-index: 80;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.6);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.feedback-overlay-sheet.sheet-open {
  transform: translateY(0);
}

.sheet-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-body {
  font-size: 0.75rem;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.sheet-actions {
  display: flex;
  gap: 0.5rem;
}

.sheet-btn {
  flex: 1;
  padding: 0.4rem;
  border-radius: 6px;
  border: none;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.sheet-btn-confirm {
  background: var(--primary);
  color: #000;
}

.sheet-btn-alt {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Control Plane & Live Compiler Panel */
.control-panel {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(16px);
  overflow-y: auto;
}

.panel-header {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.75rem;
}

.stage-tracker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stage-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  font-size: 0.75rem;
}

.stage-step.active {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--primary);
  font-weight: 600;
}

.stage-step.completed {
  color: var(--accent-green);
}

.stage-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
}

.stage-step.completed .stage-num {
  background: var(--accent-green);
  color: #000;
}

.stage-step.active .stage-num {
  background: var(--primary);
  color: #000;
}

.code-inspector {
  background: #090d16;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  max-height: 180px;
  overflow-y: auto;
  line-height: 1.4;
}

.json-key { color: var(--primary); }
.json-str { color: #a5f3fc; }
.json-bool { color: var(--accent-purple); }

.status-toast {
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--accent-green);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
