/* 
================================================================================
GRAPHITE AURORA DESIGN SYSTEM
Main Shell Stylesheet - QuantumDesk Workstation
================================================================================
*/

:root {
  /* Color Tokens - Graphite Aurora */
  --canvas-base: #0e1117;
  --surface-rail: #010409;
  --surface-drawer: #0d1117;
  --surface-topbar: #161b22;
  --surface-stage: #0e1117;
  
  --surface-card: #161b22;
  --surface-card-hover: #1c2128;
  --surface-elevated: #21262d;
  --surface-input: #0d1117;
  
  --border-default: rgba(240, 246, 252, 0.1);
  --border-muted: rgba(240, 246, 252, 0.06);
  --border-focus: #58a6ff;
  
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-amber: #d29922;
  --accent-red: #f85149;
  --accent-purple: #bc8cff;
  --accent-pink: #f778ba;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;
}

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

body {
  background-color: var(--canvas-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-y: auto; overflow-x: hidden; /* Allow scrolling in modules */
}

/* 
================================================================================
LAYOUT COMPONENTS
================================================================================
*/

.workstation-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  background-color: var(--canvas-base);
}

/* Activity Rail (Left side icon dock) */
.activity-rail {
  width: 52px;
  background-color: var(--surface-rail);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  z-index: 100;
  flex-shrink: 0;
}

.rail-item {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  position: relative;
  background: transparent;
  border: none;
}

.rail-item:hover {
  color: var(--text-primary);
  background-color: rgba(240, 246, 252, 0.05);
}

.rail-item.active {
  color: var(--accent-blue);
  background-color: rgba(88, 166, 255, 0.1);
}

.rail-item.active::before {
  content: '';
  position: absolute;
  left: -8px; /* Assuming padded container or margin */
  top: 50%;
  transform: translateY(-50%);
  height: 20px;
  width: 3px;
  background-color: var(--accent-blue);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px rgba(88, 166, 255, 0.5);
}

/* Suite Drawer (Collapsible Nav) */
.suite-drawer {
  width: 270px;
  background-color: var(--surface-drawer);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  flex-shrink: 0;
}

.suite-drawer.collapsed {
  width: 0;
  border-right-color: transparent;
}

.drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-muted);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-tool-item {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.drawer-tool-item:hover {
  background-color: var(--surface-card);
  color: var(--text-primary);
}

.drawer-tool-item.active {
  background-color: var(--surface-card-hover);
  color: var(--text-primary);
  border-left-color: var(--accent-blue);
}

/* Workstation Stage (Main Content) */
.workstation-stage {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-stage);
  position: relative;
  overflow: hidden;
}

.stage-topbar {
  height: 46px;
  background-color: var(--surface-topbar);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 16px;
  justify-content: space-between;
  flex-shrink: 0;
}

.stage-viewport,
.stage-content {
  flex-grow: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

.simulator-stage-frame {
  width: 100%;
  height: 100%;
  border: none;
  background-color: var(--surface-stage);
}

/* Split Notes Drawer */
.split-notes-drawer {
  position: absolute;
  top: 0;
  right: -360px;
  width: 360px;
  height: 100%;
  background-color: var(--surface-drawer);
  border-left: 1px solid var(--border-default);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.split-notes-drawer.open {
  right: 0;
}

/* 
================================================================================
UI COMPONENTS & SURFACES
================================================================================
*/

/* Buttons */
.btn-pro {
  background: linear-gradient(180deg, #21262d 0%, #161b22 100%);
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-top-color: rgba(240, 246, 252, 0.2); /* Specular highlight */
  color: var(--text-primary);
  padding: 6px 16px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.1s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-pro:hover {
  background: linear-gradient(180deg, #282e36 0%, #1c2128 100%);
  border-color: rgba(240, 246, 252, 0.2);
}

.btn-pro:active {
  background: #161b22;
  border-top-color: rgba(240, 246, 252, 0.1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  transform: translateY(1px);
}

.btn-accent {
  background: linear-gradient(180deg, #318bf0 0%, #238636 0%, #1f6feb 100%); /* Warm sky blue base */
  background: linear-gradient(180deg, #58a6ff 0%, #318bf0 100%);
  border: 1px solid #1f6feb;
  border-top-color: #79c0ff; /* Specular highlight */
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.1s ease;
  box-shadow: 0 0 8px rgba(88, 166, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-accent:hover {
  background: linear-gradient(180deg, #79c0ff 0%, #58a6ff 100%);
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.3), 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-accent:active {
  background: #318bf0;
  border-top-color: #1f6feb;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  transform: translateY(1px);
}

.btn-danger {
  background: linear-gradient(180deg, #f85149 0%, #da3633 100%);
  border: 1px solid #da3633;
  border-top-color: #ff7b72;
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.1s ease;
}

.btn-danger:hover {
  background: linear-gradient(180deg, #ff7b72 0%, #f85149 100%);
}

.btn-danger:active {
  background: #da3633;
  transform: translateY(1px);
}

/* Backwards compatibility aliases */
.btn-primary, .btn-cyber { @extend .btn-accent; }
.btn-secondary, .btn-cyber-outline { @extend .btn-pro; }
/* Adding concrete classes for alias since @extend isn't native CSS */
.btn-primary, .btn-cyber {
  background: linear-gradient(180deg, #58a6ff 0%, #318bf0 100%);
  border: 1px solid #1f6feb;
  border-top-color: #79c0ff;
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(88, 166, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.btn-secondary, .btn-cyber-outline {
  background: linear-gradient(180deg, #21262d 0%, #161b22 100%);
  border: 1px solid rgba(240, 246, 252, 0.1);
  border-top-color: rgba(240, 246, 252, 0.2);
  color: var(--text-primary);
  padding: 6px 16px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* Inputs */
.input-pro {
  background-color: var(--surface-input);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.input-pro:focus {
  border-color: var(--border-focus);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(88, 166, 255, 0.2);
}

/* Badges */
.pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.pill-badge.blue { background-color: rgba(88, 166, 255, 0.15); color: var(--accent-blue); border: 1px solid rgba(88, 166, 255, 0.3); }
.pill-badge.green { background-color: rgba(63, 185, 80, 0.15); color: var(--accent-green); border: 1px solid rgba(63, 185, 80, 0.3); }
.pill-badge.amber { background-color: rgba(210, 153, 34, 0.15); color: var(--accent-amber); border: 1px solid rgba(210, 153, 34, 0.3); }
.pill-badge.red { background-color: rgba(248, 81, 73, 0.15); color: var(--accent-red); border: 1px solid rgba(248, 81, 73, 0.3); }
.pill-badge.purple { background-color: rgba(188, 140, 255, 0.15); color: var(--accent-purple); border: 1px solid rgba(188, 140, 255, 0.3); }

.badge-status { /* Alias */
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  background-color: rgba(88, 166, 255, 0.15); 
  color: var(--accent-blue); 
  border: 1px solid rgba(88, 166, 255, 0.3);
}

/* Telemetry Widgets */
.telemetry-capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background-color: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.telemetry-capsule span {
  color: var(--text-primary);
  font-weight: 600;
}

/* Cards & Surfaces */
.card-pro, .pro-card, .glass-panel {
  background-color: var(--surface-card);
  border: 1px solid var(--border-default);
  border-top-color: rgba(240, 246, 252, 0.15); /* Specular highlight */
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(1, 4, 9, 0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Range Slider */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
  border: 2px solid var(--surface-card);
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: var(--border-default);
  border-radius: 2px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
