/* CSS Design System - SQL Cheat Sheet Hub & Interactive Playground */

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

:root {
  /* Color Tokens - Material Minimalist (Comfort Dark) */
  --bg-main: hsl(220, 13%, 10%); /* Very comfortable soft dark slate */
  --bg-sidebar: hsla(220, 13%, 8%, 0.9); /* Slightly darker slate for sidebar */
  --bg-card: hsla(220, 12%, 14%, 0.7); /* Slightly lighter soft gray-slate for cards */
  --bg-code: hsla(220, 15%, 7%, 0.9); /* Dark cozy code block background */
  
  --border-glass: hsla(220, 12%, 22%, 0.55); /* Gentle minimalist border */
  --border-glass-hover: hsla(174, 62%, 50%, 0.35); /* Subtle pastel teal hover indicator */
  
  --accent-cyan: hsl(174, 62%, 50%); /* Gentle Material Pastel Teal */
  --accent-cyan-rgb: 38, 166, 154;
  --accent-blue: hsl(207, 90%, 61%); /* Gentle Pastel Material Blue */
  --accent-blue-rgb: 66, 165, 245;
  --accent-purple: hsl(262, 52%, 67%); /* Soft pastel lavender */
  --accent-pink: hsl(354, 70%, 65%); /* Cozy coral pink instead of hot neon pink */
  --accent-pink-rgb: 239, 108, 108;
  
  --success: hsl(150, 43%, 52%); /* Sage green */
  --error: hsl(4, 69%, 58%); /* Soft warm red */
  
  --text-primary: hsl(220, 15%, 95%); /* Soft off-white, very comfortable */
  --text-secondary: hsl(220, 10%, 75%); /* Calm silver gray */
  --text-muted: hsl(220, 8%, 55%); /* Muted soft charcoal gray */
  
  /* Layout Constants */
  --sidebar-width: 280px;
  --header-height: 80px;
  
  /* Shadows & Filters - Softened for Minimalist look */
  --glow-cyan: 0 0 10px hsla(174, 62%, 50%, 0.12);
  --glow-pink: 0 0 10px hsla(354, 70%, 65%, 0.12);
  --glass-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.25);
  --glass-blur: blur(10px);
}

/* Global resets & scrollbar */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-glass) transparent;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 10% 20%, hsla(262, 52%, 67%, 0.04) 0px, transparent 50%),
    radial-gradient(at 90% 80%, hsla(174, 62%, 50%, 0.03) 0px, transparent 50%),
    radial-gradient(at 50% 50%, hsla(207, 90%, 61%, 0.03) 0px, transparent 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-glass-hover);
}

/* App Shell Layout */
#app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  padding: 2rem 1.5rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#app-container {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

#app-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-glass);
  background: hsla(224, 25%, 8%, 0.7);
  backdrop-filter: var(--glass-blur);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
}

#app-main {
  flex: 1;
  padding: 3rem 3rem 8rem 3rem; /* Menambahkan padding bawah ekstra agar konten tidak terhalang oleh tombol navigasi melayang */
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Sidebar Styling */
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-main);
  box-shadow: 0 4px 16px hsla(174, 62%, 50%, 0.35);
  flex-shrink: 0;
}

.logo-icon svg {
  stroke: var(--bg-main);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.logo-text h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: hsla(220, 20%, 20%, 0.4);
  color: var(--text-primary);
  border-color: var(--border-glass);
}

.nav-item.active {
  background: linear-gradient(135deg, hsla(174, 62%, 50%, 0.1), hsla(207, 90%, 61%, 0.05));
  color: var(--accent-cyan);
  border-color: hsla(174, 62%, 50%, 0.25);
  box-shadow: var(--glow-cyan);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-glass);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reset-db-btn {
  background: transparent;
  border: 1px dashed var(--accent-pink);
  color: var(--accent-pink);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.reset-db-btn:hover {
  background: hsla(322, 100%, 60%, 0.1);
  box-shadow: var(--glow-pink);
  border-style: solid;
}

.logo-author {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  display: block;
  margin-top: 0.25rem;
  transition: color 0.2s ease;
}

.logo-author:hover {
  color: var(--accent-cyan);
}

.author-credits {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
  font-weight: 500;
}

.author-credits a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.author-credits a:hover {
  color: var(--text-primary);
  text-shadow: var(--glow-cyan);
}

/* Header Styling */
.search-wrapper {
  position: relative;
  width: 400px;
  max-width: 100%;
}

.search-wrapper svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s ease;
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  background: hsla(223, 20%, 16%, 0.8);
}

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

.badge-db {
  background: linear-gradient(135deg, hsla(150, 43%, 52%, 0.12), hsla(174, 62%, 50%, 0.03));
  border: 1px solid hsla(150, 43%, 52%, 0.25);
  color: var(--success);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-db span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
  display: inline-block;
}

/* Language Switcher */
.lang-selector-wrapper {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  transition: all 0.3s ease;
}

.lang-selector-wrapper:hover {
  border-color: var(--border-glass-hover);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.lang-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: var(--bg-main);
  box-shadow: 0 2px 8px rgba(38, 166, 154, 0.3);
}

/* Glass Cards and Content Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--glass-shadow);
  margin-bottom: 2rem;
}

.page-title-section {
  margin-bottom: 2.5rem;
}

.page-title-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.page-title-section p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Views Management */
.view-content {
  display: none;
  animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

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

/* Cheat Sheet Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.concept-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

.concept-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.concept-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glass-hover);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.concept-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-badge {
  background: hsla(217, 91%, 60%, 0.15);
  color: var(--accent-blue);
  border: 1px solid hsla(217, 91%, 60%, 0.3);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.code-block-wrapper {
  position: relative;
  margin-bottom: 1.25rem;
  border-radius: 8px;
  overflow: hidden;
}

.code-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background-color: hsla(225, 25%, 4%, 0.9);
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border-glass);
}

.code-block {
  background: var(--bg-code);
  padding: 0.85rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent-cyan);
  white-space: pre-wrap;
  overflow-x: auto;
  border: 1px solid hsla(220, 20%, 25%, 0.1);
}

/* Multi-DBMS Syntax Badges & Grid */
.db-syntax-container {
  margin-bottom: 1.25rem;
}

.db-syntax-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.db-syntax-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.db-code-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.db-code-wrapper .code-block {
  border: none;
}

.db-code-wrapper.postgres {
  border-color: hsla(210, 80%, 55%, 0.4);
}

.db-code-wrapper.mysql {
  border-color: hsla(35, 90%, 55%, 0.4);
}

.db-code-wrapper.universal {
  border-color: hsla(174, 62%, 50%, 0.4);
}

.db-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-glass);
}

.db-badge.postgres {
  background: hsla(210, 80%, 15%, 0.75);
  color: #64B5F6;
}

.db-badge.mysql {
  background: hsla(35, 90%, 15%, 0.75);
  color: #FFB74D;
}

.db-badge.universal {
  background: hsla(174, 62%, 15%, 0.75);
  color: var(--accent-cyan);
}

.db-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.db-badge.postgres .db-dot { background: #64B5F6; box-shadow: 0 0 6px #64B5F6; }
.db-badge.mysql .db-dot { background: #FFB74D; box-shadow: 0 0 6px #FFB74D; }
.db-badge.universal .db-dot { background: var(--accent-cyan); box-shadow: 0 0 6px var(--accent-cyan); }

/* Synthwave Code Colors */
.code-sql-keyword { color: var(--accent-pink); font-weight: 600; }
.code-sql-table { color: var(--text-primary); }
.code-sql-column { color: var(--accent-cyan); }
.code-sql-string { color: hsl(95, 60%, 65%); }
.code-sql-operator { color: var(--accent-pink); }
.code-sql-number { color: hsl(35, 90%, 60%); }
.code-sql-comment { color: var(--text-muted); font-style: italic; opacity: 0.85; }

.card-actions {
  display: flex;
  gap: 0.75rem;
  border-top: 1px solid var(--border-glass);
  padding-top: 1rem;
  margin-top: auto;
}

.btn-card {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-card:hover {
  background: hsla(220, 20%, 20%, 0.4);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

.btn-card-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: var(--bg-main);
  font-weight: 600;
  box-shadow: 0 4px 12px hsla(174, 62%, 50%, 0.15);
}

.btn-card-primary:hover {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue)) !important;
  color: var(--bg-main) !important;
  box-shadow: 0 4px 16px hsla(174, 62%, 50%, 0.3);
  transform: scale(1.02);
}

/* Interactive JOIN Visualizer View */
.join-visualizer-container {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
}

.join-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.join-option-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: all 0.2s ease;
}

.join-option-card:hover {
  border-color: var(--border-glass-hover);
  background: hsla(223, 20%, 16%, 0.5);
}

.join-option-card.active {
  border-color: var(--accent-cyan);
  background: linear-gradient(135deg, hsla(174, 62%, 50%, 0.05), hsla(207, 90%, 61%, 0.02));
  box-shadow: var(--glow-cyan);
}

.join-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.join-option-card.active .join-radio {
  border-color: var(--accent-cyan);
}

.join-option-card.active .join-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
}

.join-option-details h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.join-option-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Venn Diagram SVG */
.join-diagram-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.venn-svg-wrapper {
  background: hsla(225, 25%, 5%, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  width: 100%;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.venn-svg-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, hsla(174, 62%, 50%, 0.03) 0%, transparent 70%);
}

.venn-svg {
  width: 420px;
  height: 220px;
}

.venn-circle {
  fill: hsla(220, 20%, 30%, 0.15);
  stroke: var(--border-glass);
  stroke-width: 2px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.venn-text {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  fill: var(--text-secondary);
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Venn diagram dynamic highlights */
.join-venn-left { fill: var(--venn-left-fill, hsla(220, 20%, 30%, 0.15)); }
.join-venn-right { fill: var(--venn-right-fill, hsla(220, 20%, 30%, 0.15)); }
.join-venn-intersect { fill: var(--venn-intersect-fill, hsla(220, 20%, 30%, 0.15)); }

/* SQL Sandbox / Playground Layout */
.playground-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Schema Browser Panel */
.schema-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: var(--glass-shadow);
}

.schema-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.schema-table-item {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  overflow: hidden;
}

.schema-table-header {
  background: hsla(220, 20%, 20%, 0.3);
  padding: 0.65rem 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.schema-table-header:hover {
  background: hsla(220, 20%, 20%, 0.6);
}

.schema-table-header span.toggle-icon {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.schema-table-item.expanded .schema-table-header span.toggle-icon {
  transform: rotate(90deg);
}

.schema-table-columns {
  display: none;
  background: hsla(225, 25%, 5%, 0.4);
  border-top: 1px solid var(--border-glass);
  padding: 0.5rem 0.85rem;
}

.schema-table-item.expanded .schema-table-columns {
  display: block;
}

.schema-column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.4rem 0;
  border-bottom: 1px solid hsla(220, 20%, 25%, 0.2);
}

.schema-column:last-child {
  border-bottom: none;
}

.schema-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.schema-column-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.25s ease;
  padding-top: 0;
}

.schema-column:hover .schema-column-details {
  max-height: 150px;
  opacity: 1;
  padding-top: 0.35rem;
}

.schema-column-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 0.3rem;
}

.schema-column-samples {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.schema-sample-pill {
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  background: hsla(174, 62%, 50%, 0.08);
  border: 1px solid hsla(174, 62%, 50%, 0.2);
  padding: 1px 4px;
  border-radius: 4px;
}

.schema-col-name {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.schema-col-name.pk {
  color: hsl(45, 100%, 60%);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.schema-col-name.fk {
  color: var(--accent-pink);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.schema-col-type {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* SQL Console Area */
.console-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.editor-wrapper {
  background: var(--bg-code);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
}

.editor-header {
  background: hsla(225, 25%, 4%, 0.9);
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.editor-title span.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.sql-editor-textarea {
  width: 100%;
  min-height: 140px;
  background: transparent;
  border: none;
  padding: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  line-height: 1.6;
}

.editor-actions {
  background: hsla(225, 25%, 4%, 0.7);
  border-top: 1px solid var(--border-glass);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.btn-editor {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-editor:hover {
  background: hsla(220, 20%, 20%, 0.4);
  color: var(--text-primary);
  border-color: var(--border-glass-hover);
}

.btn-editor-run {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: var(--bg-main);
  box-shadow: 0 4px 15px rgba(0, 245, 245, 0.25);
}

.btn-editor-run:hover {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue)) !important;
  color: var(--bg-main) !important;
  box-shadow: 0 4px 20px rgba(0, 245, 245, 0.45);
  transform: scale(1.02);
}

/* Results Display Panel */
.results-panel {
  min-height: 120px;
}

.results-header {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
}

.result-status-msg {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.result-status-msg.success {
  background: hsla(145, 80%, 45%, 0.1);
  border: 1px solid hsla(145, 80%, 45%, 0.25);
  color: var(--success);
}

.result-status-msg.error {
  background: hsla(355, 80%, 60%, 0.1);
  border: 1px solid hsla(355, 80%, 60%, 0.25);
  color: var(--error);
}

.results-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  background: hsla(223, 20%, 10%, 0.4);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.results-table th {
  background: hsla(220, 20%, 16%, 0.7);
  color: var(--text-primary);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}

.results-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsla(220, 20%, 20%, 0.3);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  white-space: nowrap;
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table tr:hover td {
  background: hsla(220, 20%, 20%, 0.25);
  color: var(--text-primary);
}

.empty-results {
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-results svg {
  color: hsla(220, 20%, 30%, 0.4);
  width: 48px;
  height: 48px;
}

/* Data Types Visual Grid */
.datatypes-section {
  margin-bottom: 2rem;
}

.datatype-group-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.datatype-group-title::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(to right, hsla(174, 62%, 50%, 0.3), transparent);
}

.datatypes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.datatype-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.datatype-card:hover {
  border-color: var(--border-glass-hover);
  background: hsla(223, 20%, 15%, 0.5);
  transform: translateY(-2px);
}

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

.datatype-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.datatype-size {
  background: hsla(322, 100%, 60%, 0.1);
  color: var(--accent-pink);
  border: 1px solid hsla(322, 100%, 60%, 0.2);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.datatype-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.datatype-example {
  background: var(--bg-code);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid hsla(220, 20%, 20%, 0.3);
}

/* Category Headers in Reference */
.ref-category-header {
  grid-column: 1 / -1;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2rem 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ref-category-header::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-blue));
  border-radius: 20px;
  display: block;
}

/* Mobile & Responsive Adjustments */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: hsla(220, 20%, 20%, 0.4);
}

@media (max-width: 1024px) {
  #app-sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  }
  
  #app-sidebar.open {
    transform: translateX(0);
  }
  
  #app-container {
    margin-left: 0;
  }
  
  #app-header {
    padding: 0 1.5rem;
  }
  
  #app-main {
    padding: 1.5rem;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .search-wrapper {
    width: 240px;
  }
  
  .join-visualizer-container {
    grid-template-columns: 1fr;
  }
  
  .playground-container {
    grid-template-columns: 1fr;
  }
  
  .console-area {
    order: 1;
  }
  
  .schema-panel {
    order: 2;
    max-height: 450px;
  }
}

@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
  }
  
  .venn-svg {
    max-width: 100%;
    height: auto;
  }
  
  .venn-svg-wrapper {
    height: auto;
    padding: 2rem 1rem;
  }
  
  .search-wrapper {
    width: 180px;
  }

  .badge-db {
    font-size: 0;
    padding: 0.5rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid hsla(145, 80%, 45%, 0.4);
  }
  
  .badge-db span {
    margin: 0;
  }

  /* PK-FK Relational Bridge responsiveness (Side-by-side compact on mobile) */
  .tables-bridge-container {
    flex-direction: row;
    gap: 0.25rem;
    align-items: stretch;
    min-height: auto;
  }
  .visual-table-box {
    width: 44%;
    max-width: none;
  }
  .visual-svg-bridge {
    display: block;
    width: 12%;
  }
  .vtable-title {
    font-size: 0.65rem;
    padding: 0.35rem 0.5rem;
    letter-spacing: -0.2px;
  }
  .vtable-row {
    font-size: 0.62rem;
    padding: 0.35rem 0.5rem;
  }
  .pk-cell, .fk-cell {
    font-size: 0.62rem;
  }

  /* Normalization Tables horizontal scroll */
  .norm-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Dashboard Custom Bar Chart scale */
  .chart-bar-col {
    width: auto;
    flex: 1;
  }
  .chart-bar {
    width: 24px;
  }
  .chart-bar-label {
    font-size: 0.65rem;
    max-width: 50px;
    bottom: -28px;
  }
  .sim-chart-wrapper {
    padding: 1.5rem 0.75rem 1rem 0.5rem;
  }
}

@media (max-width: 576px) {
  #app-header {
    padding: 0 1rem;
    height: 70px;
  }
  
  #app-main {
    padding: 1.25rem 1rem;
  }
  
  .page-title-section {
    margin-bottom: 1.5rem;
  }
  
  .page-title-section h2 {
    font-size: 1.4rem;
  }
  
  .page-title-section p {
    font-size: 0.85rem;
  }
  
  .glass-panel {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
  }
  
  .concept-card {
    padding: 1.25rem;
  }
  
  .card-actions {
    flex-direction: column;
    gap: 0.6rem;
  }
  
  .btn-card {
    width: 100%;
  }
  
  .search-wrapper {
    width: 140px;
  }
  
  .search-input {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem 0.6rem 2.2rem;
  }
  
  .search-wrapper svg {
    width: 14px;
    height: 14px;
    left: 0.8rem;
  }

  /* Normalization Tabs scrollable */
  .normalization-tabs {
    overflow-x: auto;
    max-width: 100%;
    display: flex;
  }
  .norm-tab-btn {
    flex-shrink: 0;
  }
  
  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  #join-try-playground-btn {
    width: 100%;
    text-align: center;
  }

  /* Editor Actions wrapping on very small screens */
  .editor-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .btn-editor {
    flex: 1 1 45%;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  .btn-editor-run {
    flex: 1 1 100%;
  }
}

/* ==========================================================================
   DATATYPE EDUCATION PANEL & '1' VS 1 COMPARISON STYLES
   ========================================================================== */
.datatype-education-panel {
  background: linear-gradient(135deg, var(--bg-card), hsla(223, 20%, 9%, 0.8));
  border: 1px solid var(--border-glass);
  position: relative;
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: 0 16px 40px 0 rgba(0, 0, 0, 0.45);
}

.datatype-education-panel::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, hsla(272, 85%, 65%, 0.1) 0%, transparent 70%);
  z-index: 1;
  pointer-events: none;
}

.edu-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 2;
}

.edu-panel-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.edu-panel-title h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(to right, var(--text-primary), hsl(174, 62%, 75%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.edu-pulse-icon {
  font-size: 1.25rem;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px hsla(174, 62%, 50%, 0.2)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 8px hsla(174, 62%, 50%, 0.65)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px hsla(174, 62%, 50%, 0.2)); }
}

.edu-badge {
  background: hsla(355, 80%, 60%, 0.12);
  color: var(--error);
  border: 1px solid hsla(355, 80%, 60%, 0.25);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 10px hsla(355, 80%, 60%, 0.05);
}

.edu-intro-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 2;
}

.comparison-cards-wrapper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.75rem;
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  .comparison-cards-wrapper {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .comp-vs-divider {
    margin: 0.5rem auto;
  }
}

.comp-card {
  background: hsla(223, 20%, 6%, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.comp-card:hover {
  transform: translateY(-3px);
  background: hsla(223, 20%, 12%, 0.55);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.text-comp-card {
  border-left: 3px solid var(--accent-pink);
}

.text-comp-card:hover {
  border-color: var(--accent-pink);
  box-shadow: 0 0 20px hsla(322, 100%, 60%, 0.15);
}

.num-comp-card {
  border-left: 3px solid var(--accent-cyan);
}

.num-comp-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px hsla(174, 62%, 50%, 0.12);
}

.comp-card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.text-comp-card .comp-card-badge {
  background: hsla(322, 100%, 60%, 0.1);
  color: var(--accent-pink);
  border: 1px solid hsla(322, 100%, 60%, 0.2);
}

.num-comp-card .comp-card-badge {
  background: hsla(174, 62%, 50%, 0.1);
  color: var(--accent-cyan);
  border: 1px solid hsla(174, 62%, 50%, 0.2);
}

.comp-card-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -2px;
  line-height: 1;
}

.text-comp-card .comp-card-val {
  color: var(--accent-pink);
  text-shadow: 0 0 15px hsla(322, 100%, 60%, 0.35);
}

.num-comp-card .comp-card-val {
  color: var(--accent-cyan);
  text-shadow: 0 0 15px hsla(174, 62%, 50%, 0.25);
}

.comp-features {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-top: 1px dashed var(--border-glass);
  padding-top: 1rem;
}

.comp-features li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comp-features li code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-code);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-primary);
  border: 1px solid hsla(220, 20%, 25%, 0.25);
}

.text-comp-card .comp-features li code {
  color: hsl(322, 100%, 80%);
}

.num-comp-card .comp-features li code {
  color: hsl(180, 100%, 80%);
}

.comp-vs-divider {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-cyan));
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--bg-main);
  box-shadow: 0 0 12px rgba(255, 51, 170, 0.45);
  border: 2px solid var(--bg-main);
  user-select: none;
  z-index: 10;
}

.edu-alert-box {
  background: hsla(355, 80%, 60%, 0.05);
  border: 1px solid hsla(355, 80%, 60%, 0.2);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}

.edu-alert-icon {
  color: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: hsla(355, 80%, 60%, 0.1);
  padding: 0.4rem;
  border-radius: 8px;
  border: 1px solid hsla(355, 80%, 60%, 0.15);
}

.edu-alert-content {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.edu-alert-content strong {
  color: var(--text-primary);
}

/* Extra Styling for Data Type Cards Literal Display */
.datatype-literal-box {
  background: hsla(225, 25%, 3%, 0.75);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(272, 85%, 75%);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  margin-top: 0.65rem;
  border: 1px solid hsla(272, 85%, 65%, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.datatype-literal-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-purple);
}

.datatype-literal-value {
  color: var(--text-primary);
  word-break: break-all;
}


/* ==========================================================================
   THEORY VIEW (DESAIN & LOGIKA DB) STYLING SYSTEM
   ========================================================================== */

.theory-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
}

.theory-section-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.theory-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: hsla(174, 62%, 50%, 0.12);
  color: var(--accent-cyan);
  border: 1px solid hsla(174, 62%, 50%, 0.25);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.theory-badge.pink-badge {
  background: hsla(354, 70%, 65%, 0.12);
  color: var(--accent-pink);
  border: 1px solid hsla(354, 70%, 65%, 0.25);
}

.theory-badge.purple-badge {
  background: hsla(262, 52%, 67%, 0.12);
  color: var(--accent-purple);
  border: 1px solid hsla(262, 52%, 67%, 0.25);
}

.theory-badge.blue-badge {
  background: hsla(207, 90%, 61%, 0.12);
  color: var(--accent-blue);
  border: 1px solid hsla(207, 90%, 61%, 0.25);
}

.theory-intro {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* 2 Column Theory Grid */
.theory-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

@media (max-width: 992px) {
  .theory-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Concept Cards on Left Column */
.concept-explanation-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.logic-op-card {
  background: hsla(223, 20%, 12%, 0.45);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.logic-op-card:hover {
  background: hsla(223, 20%, 15%, 0.6);
  border-color: var(--border-glass-hover);
}

.logic-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.65rem;
}

.logic-badge.and-badge {
  background: hsla(174, 62%, 50%, 0.15);
  color: var(--accent-cyan);
  border: 1px solid hsla(174, 62%, 50%, 0.3);
}

.logic-badge.or-badge {
  background: hsla(207, 90%, 61%, 0.15);
  color: var(--accent-blue);
  border: 1px solid hsla(207, 90%, 61%, 0.3);
}

.logic-badge.not-badge {
  background: hsla(354, 70%, 65%, 0.15);
  color: var(--accent-pink);
  border: 1px solid hsla(354, 70%, 65%, 0.3);
}

.logic-badge.unknown-badge {
  background: hsla(262, 52%, 67%, 0.15);
  color: var(--accent-purple);
  border: 1px solid hsla(262, 52%, 67%, 0.3);
}

.logic-op-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.null-logic-card {
  border-left: 3px solid var(--accent-purple);
}

/* 3VL Interactive Panel */
.logic-interactive-panel {
  background: hsla(225, 25%, 5%, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
}

.interactive-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  border-bottom: 1px dashed var(--border-glass);
  padding-bottom: 0.5rem;
}

.calc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.calc-input-group label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.theory-select {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.6rem;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theory-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px hsla(174, 62%, 50%, 0.2);
}

.calc-outputs {
  background: hsla(225, 25%, 3%, 0.7);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid hsla(220, 20%, 15%, 0.85);
}

.calc-output-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.calc-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.val-true {
  background: hsla(145, 80%, 45%, 0.15);
  color: var(--success);
  border: 1px solid hsla(145, 80%, 45%, 0.25);
  text-shadow: 0 0 5px hsla(145, 80%, 45%, 0.35);
}

.val-false {
  background: hsla(355, 80%, 60%, 0.15);
  color: var(--error);
  border: 1px solid hsla(355, 80%, 60%, 0.25);
  text-shadow: 0 0 5px hsla(355, 80%, 60%, 0.35);
}

.val-unknown {
  background: hsla(262, 52%, 67%, 0.15);
  color: var(--accent-purple);
  border: 1px solid hsla(262, 52%, 67%, 0.25);
  text-shadow: 0 0 5px hsla(262, 52%, 67%, 0.35);
}

.matrix-table-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1rem;
}

/* 3VL Truth Table */
.truth-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}

.truth-table th, .truth-table td {
  padding: 0.45rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid hsla(220, 20%, 25%, 0.15);
}

.truth-table th {
  color: var(--text-muted);
  font-weight: 600;
  background: hsla(220, 20%, 20%, 0.25);
}

.truth-table td.t-true { color: var(--success); font-weight: 600; }
.truth-table td.t-false { color: var(--error); font-weight: 600; }
.truth-table td.t-unknown { color: var(--accent-purple); font-weight: 600; }

.truth-table tr.interactive-tr {
  transition: all 0.2s ease;
}

.truth-table tr.interactive-tr.active-tr-highlight {
  background: linear-gradient(90deg, hsla(174, 62%, 50%, 0.15), transparent) !important;
  border-left: 2px solid var(--accent-cyan);
}

.truth-table tr.interactive-tr.active-tr-highlight td {
  color: var(--text-primary);
}


/* ==========================================================================
   2. PRIMARY KEY & FOREIGN KEY RELATOR STYLES
   ========================================================================== */

.key-card {
  background: hsla(223, 20%, 12%, 0.45);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.25rem;
}

.key-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.key-card ul {
  padding-left: 1.25rem;
}

.key-card li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.4rem;
}

.pk-info-card { border-left: 3px solid hsl(45, 100%, 60%); }
.fk-info-card { border-left: 3px solid var(--accent-pink); }

/* Interactive PK-FK Relational Bridge UI */
.relational-visualizer-pane {
  background: hsla(225, 25%, 5%, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.tables-bridge-container {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  margin-top: 1rem;
  position: relative;
  min-height: 180px;
}

.visual-table-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  width: 42%;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.vtable-title {
  background: hsla(220, 20%, 20%, 0.45);
  padding: 0.5rem 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--border-glass);
}

.vtable-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.45rem 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  border-bottom: 1px solid hsla(220, 20%, 25%, 0.15);
  align-items: center;
  transition: all 0.2s ease;
}

.vtable-row.header-row {
  color: var(--text-muted);
  font-weight: 600;
  background: hsla(220, 20%, 15%, 0.25);
}

.vtable-row:last-child {
  border-bottom: none;
}

.parent-pk-row {
  cursor: default;
}

.child-fk-row {
  cursor: pointer;
}

.pk-cell {
  color: hsl(45, 100%, 60%);
  font-weight: 700;
}

.fk-cell {
  color: var(--accent-pink);
  font-weight: 700;
}

/* SVG Bridge Vector Lines */
.visual-svg-bridge {
  flex: 1;
  width: 16%;
  position: relative;
  pointer-events: none;
}

.rel-connector-line {
  fill: none;
  stroke: var(--border-glass);
  stroke-width: 1.5px;
  transition: all 0.25s ease;
}

/* PK-FK Active Highlights & Neon Glows */
.active-fk-highlight {
  background: linear-gradient(135deg, hsla(354, 70%, 65%, 0.15), transparent) !important;
  border-left: 2px solid var(--accent-pink);
  transform: translateX(-2px);
}

.active-pk-highlight {
  background: linear-gradient(135deg, hsla(45, 100%, 60%, 0.18), transparent) !important;
  border-left: 2px solid hsl(45, 100%, 60%);
  transform: translateX(2px);
}

.active-connector-glow {
  stroke: var(--accent-cyan);
  stroke-width: 3px;
  filter: drop-shadow(0 0 6px hsla(174, 62%, 50%, 0.45));
  stroke-dasharray: 6;
  animation: strokeDashMove 0.8s linear infinite;
}

@keyframes strokeDashMove {
  to {
    stroke-dashoffset: -12;
  }
}


/* ==========================================================================
   3. DATABASE NORMALIZATION VIEW STYLES
   ========================================================================== */

.normalization-tabs {
  display: flex;
  gap: 0.5rem;
  background: hsla(225, 25%, 3%, 0.4);
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  margin-bottom: 1.5rem;
  max-width: fit-content;
}

.norm-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.norm-tab-btn:hover {
  color: var(--text-primary);
  background: hsla(220, 20%, 20%, 0.45);
}

.norm-tab-btn.active {
  background: linear-gradient(135deg, hsla(262, 52%, 67%, 0.18), hsla(207, 90%, 61%, 0.08));
  color: var(--accent-purple);
  border: 1px solid hsla(262, 52%, 67%, 0.25);
  box-shadow: 0 0 8px hsla(262, 52%, 67%, 0.15);
}

.normalization-content-wrapper {
  position: relative;
  min-height: 280px;
}

.norm-pane {
  display: none;
  animation: paneFadeIn 0.35s ease forwards;
}

.norm-pane.active {
  display: block;
}

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

.norm-pane-desc {
  background: hsla(223, 20%, 12%, 0.4);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 3px solid var(--accent-purple);
}

.norm-pane-desc h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.norm-pane-desc p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Side-by-side normalisation tables grid */
.norm-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .norm-comparison-grid {
    grid-template-columns: 1fr;
  }
}

.norm-table-wrapper {
  background: hsla(225, 25%, 5%, 0.45);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.norm-table-header-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.bad-version .norm-table-header-title { color: var(--error); }
.good-version .norm-table-header-title { color: var(--accent-cyan); }

.norm-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  margin-bottom: 1rem;
}

.norm-table th, .norm-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid hsla(220, 20%, 25%, 0.2);
}

.norm-table th {
  color: var(--text-muted);
  background: hsla(220, 20%, 15%, 0.35);
  font-weight: 600;
}

.highlight-bad {
  background: hsla(355, 80%, 60%, 0.15) !important;
  color: var(--error);
  font-weight: 600;
  border-radius: 4px;
}

.highlight-good {
  background: hsla(174, 62%, 50%, 0.15) !important;
  color: var(--accent-cyan);
  font-weight: 600;
  border-radius: 4px;
}

.sub-table-title {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  margin-top: 0.5rem;
}

.norm-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: auto;
  border-top: 1px dashed var(--border-glass);
  padding-top: 0.75rem;
}


/* ==========================================================================
   4. INTERACTIVE ER DIAGRAM (ERD) CANVAS STYLES
   ========================================================================== */

.erd-container {
  background: hsla(225, 25%, 4%, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03);
  position: relative;
  overflow-x: auto;
}

.erd-canvas {
  width: 800px;
  height: 320px;
  margin: 0 auto;
  position: relative;
}

.erd-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.erd-link-line {
  fill: none;
  stroke: var(--border-glass);
  stroke-width: 2px;
  transition: all 0.3s ease;
  marker-start: url(#arrow-start);
  marker-end: url(#arrow-end);
}

.erd-card {
  position: absolute;
  width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Horizontal positioning */
#erd-card-customers { top: 30px; left: 30px; }
#erd-card-orders { top: 30px; left: 300px; }
#erd-card-products { top: 30px; left: 570px; }

.erd-card-header {
  padding: 0.6rem 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  background: hsla(220, 20%, 18%, 0.6);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.text-cyan { color: var(--accent-cyan); }
.text-pink { color: var(--accent-pink); }
.text-blue { color: var(--accent-blue); }

.erd-card-role {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.erd-card-body {
  padding: 0.4rem 0.6rem;
  display: flex;
  flex-direction: column;
}

.erd-col {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  align-items: center;
  transition: all 0.2s ease;
}

.erd-key {
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
}

.pk-col {
  color: hsl(45, 100%, 60%);
  background: hsla(45, 100%, 60%, 0.04);
}

.pk-col .erd-key {
  color: hsl(45, 100%, 60%);
}

.fk-col {
  color: var(--accent-pink);
  background: hsla(354, 70%, 65%, 0.04);
  cursor: pointer;
}

.fk-col .erd-key {
  color: var(--accent-pink);
}

.erd-name {
  color: var(--text-secondary);
}

.erd-type {
  font-size: 0.64rem;
  color: var(--text-muted);
}

.cardinality-indicator {
  position: absolute;
  background: hsla(225, 25%, 3%, 0.85);
  border: 1px solid var(--border-glass);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  cursor: help;
  transition: all 0.25s ease;
}

/* Hover highlights for ERD Schema */
.active-erd-glow {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 36px 0 hsla(174, 62%, 50%, 0.15);
}

#erd-card-orders.active-erd-glow {
  border-color: var(--accent-pink);
  box-shadow: 0 12px 36px 0 hsla(354, 70%, 65%, 0.15);
}

#erd-card-products.active-erd-glow {
  border-color: var(--accent-blue);
  box-shadow: 0 12px 36px 0 hsla(207, 90%, 61%, 0.15);
}

.active-line-glow {
  stroke: var(--accent-cyan);
  stroke-width: 3.5px;
  filter: drop-shadow(0 0 8px hsla(174, 62%, 50%, 0.45));
  stroke-dasharray: 8;
  animation: strokeDashMove 0.8s linear infinite;
}

.active-col-highlight {
  background: hsla(174, 62%, 50%, 0.15) !important;
  color: var(--accent-cyan);
}

.active-col-highlight .erd-name {
  color: var(--text-primary);
}

/* How to Read/Logika Query Box - Cozy glassmorphic & dotted design */
.how-to-read-box {
  background: hsla(220, 15%, 7%, 0.55);
  border: 1px dashed var(--border-glass);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  position: relative;
  transition: all 0.25s ease;
  animation: slideDownIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.how-to-read-box:hover {
  background: hsla(220, 15%, 5%, 0.75);
  border-color: var(--border-glass-hover);
}

.how-to-read-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  font-family: 'Outfit', sans-serif;
}

.how-to-read-content {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-secondary);
  font-style: italic;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.2px;
}

@keyframes slideDownIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Styling for Data Type Cards Best Used For (Usecase) Box */
.datatype-usecase-box {
  background: hsla(174, 62%, 50%, 0.05);
  border: 1px dashed hsla(174, 62%, 50%, 0.25);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.datatype-usecase-box:hover {
  background: hsla(174, 62%, 50%, 0.08);
  border-color: hsla(174, 62%, 50%, 0.45);
}

.datatype-usecase-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
}

.datatype-usecase-value {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* Floating Scroll Navigator */
.scroll-navigator {
  position: fixed;
  right: 0.75rem; /* Lebih mepet ke pojok kanan dekat scrollbar browser */
  bottom: 1.5rem; /* Diturunkan sedikit agar tidak menghalangi zona cards */
  display: flex;
  flex-direction: column;
  background: hsla(220, 12%, 14%, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 30px;
  padding: 0.25rem; /* Mengecilkan padding luar kapsul */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 0 hsla(0, 0%, 100%, 0.05);
  z-index: 999;
  opacity: 0;
  transform: translateY(15px) scale(0.9);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.3s ease, 
              box-shadow 0.3s ease;
  pointer-events: none;
}

.scroll-navigator.visible {
  opacity: 0.35; /* Transparan secara bawaan agar tulisan di belakang tidak terhalang */
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-navigator.visible:hover {
  opacity: 1; /* Menjadi solid dan terang ketika kursor diarahkan ke kapsul */
  border-color: var(--border-glass-hover);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 15px hsla(174, 62%, 50%, 0.15);
}

.scroll-btn {
  width: 34px; /* Mengecilkan ukuran tombol dari 44px ke 34px */
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
  position: relative;
}

.scroll-btn.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.scroll-btn:hover {
  color: var(--accent-cyan);
  background: hsla(174, 62%, 50%, 0.12);
  box-shadow: 0 0 12px hsla(174, 62%, 50%, 0.25);
}

.scroll-btn:active {
  transform: scale(0.92);
}

/* Micro-animations for arrows */
.scroll-btn svg {
  width: 15px; /* Mengecilkan ukuran ikon di dalam tombol */
  height: 15px;
  transition: transform 0.3s ease;
}

.scroll-to-top:hover svg {
  transform: translateY(-2px);
}

.scroll-to-bottom:hover svg {
  transform: translateY(2px);
}

.scroll-divider {
  height: 1px;
  background: var(--border-glass);
  width: 16px; /* Mengecilkan ukuran divider pembatas */
  margin: 0.15rem auto;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Show divider only when both buttons are visible */
.scroll-navigator.dual-visible .scroll-divider {
  opacity: 1;
}

/* Responsive adjustment */
@media (max-width: 768px) {
  .scroll-navigator {
    right: 0.5rem; /* Lebih mepet di pojok kanan layar mobile */
    bottom: 1rem;
    padding: 0.2rem;
  }
  
  .scroll-btn {
    width: 30px; /* Sangat kecil & ringkas di mobile */
    height: 30px;
  }
  
  .scroll-btn svg {
    width: 13px;
    height: 13px;
  }
  
  .scroll-divider {
    width: 14px;
  }
}

/* Long press feedback pulse ring animation */
@keyframes longPressPulse {
  0% {
    box-shadow: 0 0 0 0 hsla(174, 62%, 50%, 0.6);
    transform: scale(0.92);
  }
  100% {
    box-shadow: 0 0 0 15px hsla(174, 62%, 50%, 0);
    transform: scale(1.05);
  }
}

.scroll-btn.long-press-activated {
  animation: longPressPulse 0.4s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  color: var(--accent-cyan) !important;
  background: hsla(174, 62%, 50%, 0.25) !important;
}

/* ==========================================================================
   6. DASHBOARD SIMULATOR (DIMENSION VS METRIC) STYLES
   ========================================================================== */
.dashboard-simulator-container {
  width: 100%;
  margin: 0.5rem 0;
}

.sim-chart-wrapper {
  display: flex;
  background: hsla(225, 25%, 5%, 0.45);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.5rem 1.5rem 1rem 1rem;
  height: 250px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.sim-chart-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, hsla(262, 52%, 67%, 0.02) 0%, transparent 80%);
  pointer-events: none;
}

.chart-y-axis-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding-right: 0.75rem;
  width: 45px;
  height: 180px; /* height of inner chart area */
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  user-select: none;
}

.chart-area-inner {
  flex: 1;
  height: 180px; /* height of inner chart area */
  position: relative;
  border-left: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
}

.chart-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: hsla(220, 10%, 60%, 0.08);
}

.chart-grid-line.line-top { top: 0; }
.chart-grid-line.line-middle { top: 50%; }
.chart-grid-line.line-bottom { bottom: 0; }

.chart-bars-container {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 1rem;
}

.chart-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.chart-bar {
  width: 32px;
  background: linear-gradient(to top, var(--accent-cyan), var(--accent-blue));
  border-radius: 6px 6px 0 0;
  height: 0; /* start at 0 and animate up */
  transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  position: relative;
  box-shadow: 0 0 15px hsla(174, 62%, 50%, 0.15);
  display: flex;
  justify-content: center;
}

.chart-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: hsla(174, 62%, 80%, 0.5);
  border-radius: 6px 6px 0 0;
  filter: blur(1px);
}

.chart-bar-value {
  position: absolute;
  top: -22px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  animation: barValueFadeIn 0.4s 0.4s forwards ease;
}

@keyframes barValueFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chart-bar-label {
  position: absolute;
  bottom: -32px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: none;
}

/* responsive adjustment */
@media (max-width: 1024px) {
  .dashboard-simulator-container {
    margin-top: 1rem;
  }
}

/* Visual feedback query run flash glow */
@keyframes run-flash-glow {
  0% {
    box-shadow: 0 0 15px hsla(174, 62%, 50%, 0.4);
    border-color: var(--accent-cyan);
  }
  100% {
    box-shadow: none;
    border-color: var(--border-glass);
  }
}
.run-flash {
  animation: run-flash-glow 0.6s ease-out;
}

/* Search Highlight style */
mark.search-highlight {
  background: hsla(174, 62%, 50%, 0.25);
  color: var(--accent-cyan);
  border-radius: 4px;
  padding: 0 2px;
  border-bottom: 2px solid var(--accent-cyan);
  box-shadow: 0 0 8px hsla(174, 62%, 50%, 0.2);
  font-weight: 600;
  display: inline;
  animation: highlight-pop 0.2s ease-out forwards;
}

@keyframes highlight-pop {
  0% {
    background: hsla(174, 62%, 50%, 0.50);
    box-shadow: 0 0 12px hsla(174, 62%, 50%, 0.4);
  }
  100% {
    background: hsla(174, 62%, 50%, 0.25);
    box-shadow: 0 0 8px hsla(174, 62%, 50%, 0.2);
  }
}

/* ==========================================================================
   QUIZ COMPONENT STYLING SYSTEM
   ========================================================================== */

.quiz-progress-bar-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.quiz-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

#quiz-current-q-num {
  color: var(--accent-cyan);
  font-weight: 700;
}

.quiz-progress-track {
  height: 6px;
  background: hsla(220, 10%, 60%, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

#quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 10px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-question-box {
  margin-bottom: 1.5rem;
}

.quiz-question-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.quiz-options-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: hsla(223, 20%, 12%, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.quiz-option-btn:hover:not(:disabled) {
  background: hsla(223, 20%, 16%, 0.6);
  border-color: var(--border-glass-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.quiz-option-btn:active:not(:disabled) {
  transform: translateY(0);
}

.quiz-option-btn:disabled {
  cursor: not-allowed;
}

.quiz-option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: hsla(220, 10%, 60%, 0.15);
  color: var(--text-light);
  font-weight: 700;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.quiz-option-btn:hover:not(:disabled) .quiz-option-letter {
  background: hsla(174, 62%, 50%, 0.15);
  color: var(--accent-cyan);
}

/* Correct state */
.quiz-option-btn.correct {
  background: hsla(142, 60%, 45%, 0.12) !important;
  border-color: hsl(142, 60%, 45%) !important;
  color: hsl(142, 60%, 80%) !important;
}

.quiz-option-btn.correct .quiz-option-letter {
  background: hsl(142, 60%, 45%) !important;
  color: #fff !important;
}

/* Incorrect state */
.quiz-option-btn.incorrect {
  background: hsla(354, 70%, 65%, 0.12) !important;
  border-color: hsl(354, 70%, 65%) !important;
  color: hsl(354, 70%, 80%) !important;
}

.quiz-option-btn.incorrect .quiz-option-letter {
  background: hsl(354, 70%, 65%) !important;
  color: #fff !important;
}

/* Muted non-selected state when answered */
.quiz-option-btn.dimmed {
  opacity: 0.35;
}

.quiz-explanation-box {
  margin-top: 0.5rem;
  padding: 1.25rem;
  background: hsla(223, 20%, 15%, 0.4);
  border-radius: 12px;
  border-left: 4px solid var(--accent-cyan);
  animation: quizSlideDownFadeIn 0.35s ease forwards;
}

.quiz-explanation-box .explanation-title {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent-cyan);
  margin-bottom: 0.4rem;
}

.quiz-explanation-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

@keyframes quizSlideDownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-score-circle-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.quiz-score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(174, 62%, 50%, 0.1) 0%, hsla(223, 20%, 8%, 0.6) 100%);
  border: 4px solid var(--accent-cyan);
  box-shadow: 0 0 25px hsla(174, 62%, 50%, 0.25), inset 0 0 15px hsla(174, 62%, 50%, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: quizPulseGlow 3s infinite ease-in-out;
}

#quiz-score-number {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
}

.score-denominator {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.2rem;
}

@keyframes quizPulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px hsla(174, 62%, 50%, 0.2);
  }
  50% {
    box-shadow: 0 0 35px hsla(174, 62%, 50%, 0.4);
  }
}

.quiz-write-query-container {
  display: flex;
  flex-direction: column;
  background: hsla(223, 20%, 12%, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.quiz-query-textarea {
  width: 100%;
  min-height: 120px;
  background: hsla(223, 25%, 7%, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-light);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  padding: 1rem;
  resize: vertical;
  outline: none;
  transition: all 0.25s ease;
  line-height: 1.5;
}

.quiz-query-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px hsla(174, 62%, 50%, 0.15), inset 0 0 5px hsla(174, 62%, 50%, 0.05);
}

.quiz-query-feedback {
  transition: all 0.3s ease;
}

.quiz-query-feedback.success {
  background: hsla(142, 60%, 45%, 0.12);
  border: 1px solid hsl(142, 60%, 45%);
  color: hsl(142, 60%, 80%);
}

.quiz-query-feedback.error {
  background: hsla(354, 70%, 65%, 0.12);
  border: 1px solid hsl(354, 70%, 65%);
  color: hsl(354, 70%, 80%);
}

.quiz-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.quiz-mode-card {
  background: hsla(223, 20%, 12%, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 2.25rem 1.5rem;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.quiz-mode-card:hover {
  transform: translateY(-5px);
  background: hsla(223, 20%, 15%, 0.6);
}

#quiz-mode-mc-btn:hover {
  border-color: hsla(217, 89%, 61%, 0.5);
  box-shadow: 0 10px 30px hsla(217, 89%, 61%, 0.15);
}

#quiz-mode-query-btn:hover {
  border-color: hsla(174, 62%, 50%, 0.5);
  box-shadow: 0 10px 30px hsla(174, 62%, 50%, 0.15);
}

.quiz-mode-card .mode-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: hsla(0, 0%, 100%, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.quiz-mode-card:hover .mode-icon {
  transform: scale(1.1);
  background: hsla(0, 0%, 100%, 0.08);
}

