/* ==========================================================================
   AWS Lab - Design System & Stylesheet
   ========================================================================== */

/* Variables */
:root {
  --bg-app: #07090e;
  --bg-sidebar: #0b0f19;
  --bg-card: rgba(16, 22, 37, 0.7);
  --bg-canvas: #090c15;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #00f2fe;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;
  
  --primary: #00f2fe;
  --primary-glow: rgba(0, 242, 254, 0.4);
  --secondary: #4f46e5;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;

  /* AWS Specific Colors */
  --aws-region: #5a6b82;
  --aws-vpc: #ff9900;
  --aws-vpc-bg: rgba(255, 153, 0, 0.03);
  --aws-subnet-pub: #149c54;
  --aws-subnet-pub-bg: rgba(20, 156, 84, 0.03);
  --aws-subnet-priv: #0073bb;
  --aws-subnet-priv-bg: rgba(0, 115, 187, 0.03);
  --aws-ec2: #ec7211;
  --aws-rds: #3b82f6;
  --aws-alb: #a855f7;
  --aws-igw: #f43f5e;
  --aws-nat: #10b981;
  --aws-users: #06b6d4;
  --aws-admin: #64748b;
  --aws-rt: #0d9488;

  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 15px rgba(0, 242, 254, 0.15);
  --glass-blur: blur(12px);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

input, textarea, button {
  font-family: inherit;
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Header Bar */
.app-header {
  height: 70px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aws-logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #07090e;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.header-titles h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-titles p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Template Selector */
.template-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.template-buttons {
  display: flex;
  gap: 6px;
}

/* Workspace Frame */
.app-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Sidebars Base */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
  overflow-y: auto;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-normal);
}

.right-sidebar {
  width: 300px;
  border-right: none;
  border-left: 1px solid var(--border-color);
}

.sidebar.collapsed {
  display: none !important;
}

.panel-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.panel-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Buttons System */
.btn {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  color: var(--text-main);
  background: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #07090e;
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 242, 254, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

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

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-template {
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
}

.btn-template:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.btn-template.active {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.3);
  color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.05);
}

.btn-toggle {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  gap: 12px;
}

.btn-toggle:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.btn-toggle.active {
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid var(--primary);
  box-shadow: var(--shadow-glow);
}

.btn-toggle.active .toggle-icon {
  color: var(--primary);
  filter: drop-shadow(0 0 5px var(--primary-glow));
}

.btn-block {
  width: 100%;
}

.text-left {
  justify-content: flex-start;
}

.toggle-details strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.toggle-details span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.tool-toggle-section {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

/* Toolbox Styles */
.toolbox-groups {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.toolbox-group h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-left: 4px;
}

.toolbox-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.toolbox-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-main);
  text-align: center;
}

.toolbox-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.toolbox-item span {
  font-size: 0.75rem;
  font-weight: 500;
}

.item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
}

/* Component Theming Colors */
.color-region { background: rgba(90, 107, 130, 0.1); color: var(--aws-region); }
.color-vpc { background: rgba(255, 153, 0, 0.1); color: var(--aws-vpc); }
.color-subnet-pub { background: rgba(20, 156, 84, 0.1); color: var(--aws-subnet-pub); }
.color-subnet-priv { background: rgba(0, 115, 187, 0.1); color: var(--aws-subnet-priv); }
.color-ec2 { background: rgba(236, 114, 17, 0.1); color: var(--aws-ec2); }
.color-rds { background: rgba(59, 130, 246, 0.1); color: var(--aws-rds); }
.color-alb { background: rgba(168, 85, 247, 0.1); color: var(--aws-alb); }
.color-igw { background: rgba(244, 63, 94, 0.1); color: var(--aws-igw); }
.color-nat { background: rgba(16, 185, 129, 0.1); color: var(--aws-nat); }
.color-users { background: rgba(6, 182, 212, 0.1); color: var(--aws-users); }
.color-admin { background: rgba(100, 116, 139, 0.1); color: var(--aws-admin); }
.color-rt { background: rgba(13, 148, 136, 0.1); color: var(--aws-rt); }

/* Canvas Container & Viewport */
.canvas-container {
  flex: 1;
  background-color: var(--bg-canvas);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.canvas-bar {
  height: 44px;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

.canvas-status {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.canvas-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
}

.canvas-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.zoom-level {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  width: 44px;
  text-align: center;
  color: var(--text-muted);
}

.canvas-viewport {
  flex: 1;
  overflow: auto;
  position: relative;
  cursor: grab;
}

.canvas-viewport:active {
  cursor: grabbing;
}

/* Grid Canvas Graphic */
.grid-canvas {
  width: 2800px;
  height: 2000px;
  position: relative;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  transform-origin: 0 0;
}

.svg-connections-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Draggable Canvas Components */
.canvas-element {
  position: absolute;
  border-radius: 12px;
  transition: box-shadow var(--transition-fast);
  z-index: 2;
}

/* Containers (Region, VPC, Subnets) */
.canvas-container-el {
  border-width: 2px;
  min-width: 150px;
  min-height: 120px;
  padding: 44px 16px 16px 16px; /* Top padding leaves space for title */
  cursor: move;
}

.canvas-container-el .container-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  pointer-events: none;
}

.container-header h5 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.container-header .cidr-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* Specific Containers */
.type-region {
  border: 2px dashed var(--aws-region);
  background-color: rgba(90, 107, 130, 0.02);
}
.type-region .container-header {
  color: var(--aws-region);
}

.type-vpc {
  border: 2px solid var(--aws-vpc);
  background-color: var(--aws-vpc-bg);
}
.type-vpc .container-header {
  color: var(--aws-vpc);
  border-bottom-color: rgba(255, 153, 0, 0.1);
}

.type-subnet-public {
  border: 2px solid var(--aws-subnet-pub);
  background-color: var(--aws-subnet-pub-bg);
}
.type-subnet-public .container-header {
  color: var(--aws-subnet-pub);
  border-bottom-color: rgba(20, 156, 84, 0.1);
}

.type-subnet-private {
  border: 2px solid var(--aws-subnet-priv);
  background-color: var(--aws-subnet-priv-bg);
}
.type-subnet-private .container-header {
  color: var(--aws-subnet-priv);
  border-bottom-color: rgba(0, 115, 187, 0.1);
}

.type-rt-public {
  border: 2px solid var(--aws-rt);
  background-color: rgba(13, 148, 136, 0.03);
}
.type-rt-public .container-header {
  color: var(--aws-rt);
  border-bottom-color: rgba(13, 148, 136, 0.15);
}

.type-rt-private {
  border: 2px dashed var(--aws-rt);
  background-color: rgba(13, 148, 136, 0.015);
}
.type-rt-private .container-header {
  color: var(--aws-rt);
  border-bottom-color: rgba(13, 148, 136, 0.10);
}

/* Node Elements (EC2, DB, IGW, etc.) */
.canvas-node-el {
  width: 90px;
  height: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: move;
  padding: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.canvas-node-el:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.canvas-node-el .node-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-node-el .node-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  color: var(--text-main);
}

/* Active Selected Element Border */
.canvas-element.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: var(--shadow-glow);
}

/* Drop hover target indicator */
.canvas-element.drop-hover {
  background-color: rgba(0, 242, 254, 0.06) !important;
  border-color: var(--primary) !important;
}

/* Resize handle on containers */
.resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--border-color);
  bottom: 0;
  right: 0;
  cursor: se-resize;
  border-radius: 0 0 10px 0;
  border-left: 2px solid var(--bg-sidebar);
  border-top: 2px solid var(--bg-sidebar);
}

.canvas-element.selected .resize-handle {
  background: var(--primary);
}

/* Connector Dots for Connection Mode */
.connector-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #ffffff;
  border: 2px solid var(--primary);
  border-radius: 50%;
  z-index: 50;
  cursor: crosshair;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.canvas-node-el:hover .connector-dot,
.app-workspace.connecting-mode .connector-dot {
  opacity: 1;
}

.connector-dot:hover {
  background-color: var(--primary);
  transform: scale(1.3);
}

.conn-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Connection Overlay States */
.app-workspace.connecting-mode .canvas-viewport {
  cursor: crosshair;
}

/* Dynamic Connector lines */
.conn-line {
  stroke-linecap: round;
  transition: stroke var(--transition-fast);
}

.conn-line.active-route {
  stroke: rgba(0, 242, 254, 0.4);
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 3px rgba(0, 242, 254, 0.2));
}

.conn-line.current-step-route {
  stroke: #ff9900;
  stroke-width: 4px;
  filter: drop-shadow(0 0 6px rgba(255, 153, 0, 0.6));
}

.conn-label {
  fill: var(--text-main);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--bg-canvas);
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* SVG Packet Flow Simulation */
.sim-packet {
  filter: drop-shadow(0 0 5px var(--primary));
}

/* Right Sidebar Tabs */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(0, 242, 254, 0.02);
}

.sidebar-tab-content {
  flex: 1;
  position: relative;
}

.tab-panel {
  display: none;
  padding: 20px;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Inspector Dynamic Panel */
.empty-inspector-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-inspector-state h4 {
  font-size: 0.95rem;
  color: var(--text-main);
  margin: 16px 0 8px 0;
}

.empty-inspector-state p {
  font-size: 0.75rem;
  line-height: 1.5;
}

.empty-icon {
  color: rgba(255, 255, 255, 0.15);
  display: flex;
  justify-content: center;
}

.inspector-header {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.comp-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.comp-title-container h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.comp-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(0, 242, 254, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 242, 254, 0.2);
  display: inline-block;
  margin-top: 4px;
}

/* Forms styling */
.property-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.property-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.prop-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.prop-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

.input-helper {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.port-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.port-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 6px;
  transition: background var(--transition-fast);
}

.port-chip:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nested-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nested-list li {
  font-size: 0.8rem;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nested-list li span {
  font-weight: 500;
}

.nested-list li em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.selected-education-card {
  background: rgba(255, 153, 0, 0.03);
  border: 1px dashed rgba(255, 153, 0, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-top: 24px;
}

.selected-education-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--aws-vpc);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.selected-education-card p {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.selected-education-card blockquote {
  border-left: 2px solid var(--aws-vpc);
  padding-left: 10px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-main);
}

/* Learning Accoridon */
.edu-module h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.edu-module p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.edu-accordion {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.accordion-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.accordion-header svg {
  transition: transform var(--transition-normal);
  color: var(--text-muted);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
  transition: all var(--transition-normal);
}

.accordion-item.active {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.accordion-item.active .accordion-header {
  color: var(--primary);
}

.accordion-item.active .accordion-header svg {
  transform: rotate(180deg);
  color: var(--primary);
}

.accordion-item.active .accordion-content {
  max-height: 500px;
  padding-bottom: 16px;
}

.accordion-content blockquote {
  border-left: 2px solid var(--primary);
  padding-left: 8px;
  margin: 10px 0;
  color: var(--text-main);
}

.accordion-content ul {
  padding-left: 16px;
  margin: 8px 0;
}

/* Simulation Lab Walks box */
.simulation-selector-box {
  background: rgba(0, 242, 254, 0.02);
  border: 1px solid rgba(0, 242, 254, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-top: 24px;
}

.simulation-selector-box h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.sim-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.sim-list .btn {
  font-size: 0.75rem;
  padding: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.sim-list .btn:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.3);
  color: var(--primary);
}

/* Simulation Stepper Box */
.simulation-progress-box {
  border-top: 1px solid var(--border-color);
  background: #0f1422;
  padding: 20px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
}

.sim-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sim-box-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}

.close-sim-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.close-sim-btn:hover {
  color: var(--danger);
}

.sim-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-step {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  padding: 10px;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  opacity: 0.5;
  transition: all var(--transition-fast);
}

.sim-step.active {
  opacity: 1;
  border-color: var(--primary);
  background: rgba(0, 242, 254, 0.04);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.05);
}

.sim-step-num {
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 242, 254, 0.1);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sim-step-desc {
  flex: 1;
  color: var(--text-main);
  line-height: 1.4;
}

.sim-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.sim-controls .btn-small {
  padding: 6px 12px;
  font-size: 0.75rem;
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 5, 8, 0.85);
  backdrop-filter: var(--glass-blur);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-fast);
}

.modal-card {
  width: 90%;
  max-width: 520px;
  background: #0f1320;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateY(0);
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(to right, #ffffff, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-body {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.tour-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.feature-row {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.feat-icon {
  font-size: 1.5rem;
}

.feat-desc strong {
  color: var(--text-main);
  font-size: 0.85rem;
  margin-bottom: 2px;
  display: block;
}

.feat-desc p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.code-area {
  width: 100%;
  height: 160px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 12px;
  resize: none;
  margin-top: 10px;
}

.warning-text {
  color: var(--warning);
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.hidden {
  display: none !important;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.close-modal:hover {
  color: var(--text-main);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Utility styles */
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }

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

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Route Table rules table styling */
.rt-rules-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.rt-rules-table th, .rt-rules-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.rt-rules-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}
.rt-rules-table td {
  font-family: var(--font-mono);
  color: var(--text-main);
}
.rt-rules-table tr:last-child td {
  border-bottom: none;
}

.rt-canvas-routes {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 8px 12px;
  border-radius: 6px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.03);
}
.rt-canvas-route-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  gap: 12px;
}
.rt-canvas-route-row .dest {
  color: var(--text-main);
  font-weight: 500;
}
.rt-canvas-route-row .target {
  color: var(--primary);
  font-weight: 600;
}
.rt-canvas-route-row .arrow {
  color: var(--text-muted);
  opacity: 0.5;
}
.toolbox-item.active {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* User Session Header Info */
.user-session {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 6px 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  margin-left: 8px;
}

.user-email {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-main);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#btn-logout {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.7rem;
}

/* Auth Gate Styling */
.auth-card {
  max-width: 400px;
  background: rgba(15, 19, 32, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  position: relative;
  z-index: 10;
}

.auth-card .property-group {
  margin-bottom: 14px;
}

.auth-card .prop-input {
  width: 100%;
}

/* Watermark & Falling Icons Background */
.auth-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-size: 8vw;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.015);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  user-select: none;
  pointer-events: none;
  z-index: 1;
  white-space: nowrap;
}

.auth-falling-icons {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.falling-icon {
  position: absolute;
  top: -80px;
  color: rgba(255, 255, 255, 0.03);
  pointer-events: none;
  user-select: none;
  animation: fall linear infinite;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(115vh) rotate(360deg);
    opacity: 0;
  }
}

/* --- Lab Tabs & Layout --- */
.btn-toggle.active {
  background: var(--primary) !important;
  color: #07090e !important;
  box-shadow: 0 0 12px var(--primary-glow);
  font-weight: 700;
}

/* --- Simulated Linux Terminal --- */
.terminal-viewport {
  flex: 1;
  background: #05070a;
  border: 1px solid var(--border-color);
  border-top: none;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  cursor: text;
  position: relative;
}

.terminal-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terminal-line {
  white-space: pre-wrap;
  line-height: 1.5;
}

.terminal-line.cmd-input-line {
  color: #f8fafc;
}

.terminal-line.cmd-output-line {
  color: #38bdf8;
}

.terminal-line.system-msg {
  color: #94a3b8;
}

.terminal-line.error-msg {
  color: #f87171;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.terminal-prompt {
  color: #4ade80;
  font-weight: 700;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0;
}

/* --- Visual File Explorer --- */
.explorer-path-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 16px;
  font-size: 0.75rem;
}

.path-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.explorer-breadcrumbs {
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: 500;
}

.explorer-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  grid-auto-rows: max-content;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}

.explorer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  width: 100%;
}

.explorer-item:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-color);
}

.explorer-item.selected {
  background: rgba(0, 242, 254, 0.06);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.explorer-item-icon {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  transition: transform var(--transition-fast);
}

.explorer-item:hover .explorer-item-icon {
  transform: scale(1.1);
}

.explorer-item-name {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-main);
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
}

.file-inspector-card {
  background: rgba(0, 115, 187, 0.04);
  border: 1px dashed rgba(0, 115, 187, 0.3);
  border-radius: 12px;
  padding: 14px;
  margin: 16px;
  animation: fadeIn var(--transition-fast);
}

/* --- Guided Steps checkmarks --- */
.linux-task-item {
  transition: color var(--transition-fast);
}

.linux-task-item.completed {
  color: var(--success) !important;
}

.linux-task-item.completed .check-box {
  border-color: var(--success) !important;
  background: var(--success) !important;
  position: relative;
}

.linux-task-item.completed .check-box::after {
  content: "✓";
  color: #07090e;
  font-size: 8px;
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* --- Lab Selection Gate Card Styles --- */
.lab-choice-box:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  transform: translateY(-4px);
}
#choice-aws:hover {
  border-color: rgba(255, 153, 0, 0.4) !important;
  box-shadow: 0 0 25px rgba(255, 153, 0, 0.15);
}
#choice-linux:hover {
  border-color: rgba(0, 242, 254, 0.4) !important;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.15);
}

