:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2128;
  --bg-tertiarywithshade: 28, 33, 40, 0.2; 
  --bg-elevated: #21262d;
  --border: #30363d;
  --border-hover: #484f58;
  --text: #c9d1d9;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --success: #3fb950;
  --warning: #d29922;
  --error: #f85149;
  --purple: #bc8cff;
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-lg: rgba(0, 0, 0, 0.6);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --Sidebar: 220px;
  --terminal-background: #1b1c1d;
  --terminal-secondary: #2e2e2e;
  --terminal-text: #ffffff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  overflow: hidden;
  line-height: 1.5;
}

/* Loading Screen */
.loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

.loading-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Welcome Screen */
.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  display: none;  
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.welcome-content {
  text-align: center;
  max-width: 600px;
  padding: 40px;
}

.welcome-logo {
  font-size: 72px;
  color: var(--accent);
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out;
}

.welcome-title {
  font-size: 42px;
  font-weight: 600;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.welcome-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.welcome-btn {
  padding: 12px 32px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.welcome-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.3);
}

.welcome-btn.secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.welcome-btn.secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  box-shadow: 0 8px 24px var(--shadow);
}

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

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

/* Header */
.app-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  z-index: 100;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.app-title i {
  color: var(--accent);
  font-size: 20px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.header-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-hover);
}

/* Top Tabs */
.top-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.top-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.top-tab:hover {
  color: var(--text);
  background: var(--bg-tertiary);
}

.top-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-primary);
}

.top-tab i {
  font-size: 14px;
}

/* Content Area */
.content-area {
  flex: 1;
  position: relative;
  background: var(--bg-primary);
  height: 100%; 
}

.tab-content {
  display: none;
  height: 100%;
  overflow: hidden;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.custom-tab {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background-color: #f0f0f0; /* light gray tab CAN CHANGE*/
  border-radius: 8px;
  margin-right: 6px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: background-color 0.2s;
}

.custom-tab:hover {
  background-color: #e0e0e0; /* slightly darker on hover CAN CHANGE*/
}

.tab-name {
  margin-right: 8px;
  font-weight: 500;
  color: #333;
}

.close-tab-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  transition: color 0.2s;
}

.close-tab-btn:hover {
  color: #4d68ff; /* red/blue maybe on hover */
}

.close-tab-btn i {
  font-size: 12px;
}


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

/* Main IDE Layout */
.main-ide-layout {
  display: flex;
  height: 100%;
}

/* Sidebar */
.sidebar, .notes-sidebar, .dictionary-sidebar, .ports-sidebar {
  width: var(--Sidebar);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  height: 100%;
}

.sidebar-header {
  padding: 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.sidebar-actions {
  display: flex;
  gap: 6px;
}

.sidebar-btn {
  padding: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 14px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.sidebar-btn.primary {
  color: var(--accent);
}

.sidebar-btn.primary:hover {
  background: rgba(88, 166, 255, 0.15);
}

/* Search Container */
.search-container {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Sidebar Content */
.sidebar-content {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  height: 0;
}

/* File Tree */
.file-tree {
  padding: 8px;
  list-style: none;
  margin: 0;
  padding: 8px;
}

.file-tree-item {
  list-style-type: none;
  user-select: none;
}

.file-tree-name {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
}

.file-tree-name:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.expand-icon {
  width: 16px;
  margin-right: 4px;
  font-size: 10px;
  color: #555;
}

.file-icon, .folder-icon {
  margin-right: 8px;
  color: #555;
}

.folder-icon {
  color: #ffc107;
}

.file-tree-children {
  margin-left: 24px;
  padding-left: 0;
}

.file-tree-item:hover {
  background: var(--bg-elevated);
}

.file-tree-item.selected {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
  font-weight: 500;
  border-left: 3px solid var(--accent);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.file-tree-item i {
  width: 16px;
  text-align: center;
}

/* Notes & Dictionary Lists */
.notes-list, .dictionary-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.note-item, .dict-item {
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-item:hover, .dict-item:hover {
  background: var(--bg-elevated);
}

.note-item.active, .dict-item.active {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
  font-weight: 500;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 13px;
}

/* Editor Area */
.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

#editor {
  width: 100vb;
  height: 100vh;
  border: 1px solid grey;
}

/* File Tabs */
.file-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
  min-height: 40px
}

.file-tab {
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.file-tab:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.file-tab.active {
  background: var(--bg-primary);
  color: var(--text);
  border-bottom-color: var(--bg-primary);
}

.file-tab-close {
  opacity: 0;
  transition: var(--transition);
  padding: 2px;
  border-radius: 3px;
}

.file-tab:hover .file-tab-close {
  opacity: 0.6;
}

.file-tab-close:hover {
  opacity: 1 !important;
  background: var(--bg-elevated);
}

/* Editor Container */
.editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.editor-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.editor-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.editor-title i {
  color: var(--accent);
}

.editor-actions {
  display: flex;
  gap: 8px;
}

.editor-btn {
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.editor-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text);
  border-color: var(--border-hover);
}

.editor-btn.primary {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.editor-btn.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

/* Monaco Editor */
#editor, #note-editor, #dictionary-editor {
  height: 100%;
  width: 100%;
}

/* Notes & Dictionary Layouts */
.notes-layout, .dictionary-layout {
  display: flex;
  height: 100%;
}

.note-editor-container, .dictionary-editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}




/* TERMINAL */ 
/* header stays on top */
.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  flex-shrink: 0;
}

/* output scrolls above input */
.output-area {
  height: 300px;
  overflow-y: auto;
  border: 1px solid #444;
  background: var(--terminal-background);
  padding: 10px;
  margin-bottom: 10px;
}

.Terminal-i-o{
  color: var(--terminal-text);
  -webkit-text-fill-color: var(--terminal-text);
}
#command-input, #sudo-password {
  width: 100%;
  padding: 8px;
  background: var(--terminal-secondary); 
  color: #c5c5c5;
  border: 1px solid #444;
}
.command-list li{
  font-size: 14px; 
}





/* Ports Layout */
.ports-layout {
  display: flex;
  height: 100%;
}

.ports-sidebar {
  width: calc(var(--Sidebar) + 100px);
  height: 100vh;
  max-height: 1000px;
}

.ports-controls {
  padding: 16px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.checkbox-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
}

.ports-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Circuit Viewer */
.circuits-pcb-layout {
  height: 100%;
  padding: 20px;
  overflow-y: auto;
  overflow-x: auto;
}

.circuit-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.circuit-header {
  background: var(--bg-tertiary);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.circuit-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.circuit-controls {
  display: flex;
  gap: 8px;
}

.circuit-btn {
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.circuit-btn:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.circuit-content {
  padding: 20px;
}

.circuit-preview-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.port-output {
  font-family: monospace; /* FONT */
  background: #111;
  color: #0f0;
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  white-space: pre-wrap;
}

.preview-header {
  background: var(--bg-tertiary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.preview-actions {
  display: flex;
  gap: 6px;
}

.preview-btn {
  padding: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
}

.preview-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.preview-content {
  width: 100%;
  height: 400px;
  overflow: auto; /* enable scrolling */
  background: var(--bg-secondary);
  position: relative;
}


.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ccc;
  height: 100%;
}

.preview-content img {
  display: block;
  max-width: none;
  max-height: none;
}



#image-preview {
  max-height: 80vh;
  width: 100%;
  overflow: auto; 
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}


#image-preview img {
  display: block;
  max-width: none; 
  max-height: none;
  justify-content: center;
}



.preview-placeholder i {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.preview-placeholder h3 {
  margin-bottom: 8px;
  color: var(--text-secondary);
}




/* Settings Layout */
.settings-layout {
  display: flex;
  height: 100%;
}

.settings-sidebar {
  width: var(--Sidebar);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 16px 0;
}

.settings-categories {
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 2px;
}

.settings-category {
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
}

.settings-category:hover {
  background: var(--bg-elevated);
}

.settings-category:active {
  background: rgba(88, 166, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}


.settings-main {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}


.settings-panel {
  display: none;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  margin-left: 10px;
}

.settings-panel.active {
  display: block;
}


.settings-header {
  margin-bottom: 32px;
}

.settings-header h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

.settings-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.settings-section {
  margin-bottom: 32px;
}

.settings-section h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.settings-option {
  margin-bottom: 20px;
}

.settings-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.settings-select {
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  min-width: 200px;
}

.settings-select:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.settings-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  outline: none;
  cursor: pointer;
  accent-color: var(--accent);
}

.slider-value {
  min-width: 60px;
  padding: 4px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  color: var(--text-secondary);
}

.theme-options {
  display: flex;
  margin-left: 10px;
  gap: 16px;
}

.theme-option {
  cursor: pointer;
  text-align: center;
  border: none;      /* remove default button border */
  background: none;    /* remove default button background */
  padding: 0;        /* remove default button padding */
  font: inherit;       /* inherit font styles */
}

.theme-option:focus {
  transform: scale(1.05);
}

.key-row {
  transition: all 0.3s ease
}
.key-row:hover{
  background-color: rgba(var(--bg-tertiarywithshade)); 
  outline: 2px solid var(--bg-tertiary); 
  cursor: pointer;
}

.theme-preview {
  width: 120px;
  height: 80px;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  margin-bottom: 8px;
}

.theme-preview {
  border-color: var(--accent);
  transform: scale(1.05);
}

.theme-preview.dark-theme {
  background: #0d1117;
}

.theme-preview.light-theme {
  background: #ffffff;
}

.settings-btn {
  padding: 10px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-btn:hover {
  background: var(--bg-tertiary);
}

.settings-btn.danger {
  color: var(--error);
  border-color: var(--error);
}

.settings-btn.danger:hover {
  background: rgba(248, 81, 73, 0.1);
}

.settings-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Keybindings Table */

.keybindings-search {
  padding: 10px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.keybindings-table-container {
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.keybindings-table {
  width: 100%;
  border-collapse: collapse;
}

.keybindings-table th {
  background: var(--bg-tertiary);
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.keybindings-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}

.settings-input{
  background-color: #24252500; /* dark blue background */
  color: white;          /* white text */
  padding: 8px 12px;       /* some padding */
  border-radius: 4px;      /* rounded corners */
  font-size: 16px; 
}

.settings-input:focus{
  outline: none;         /* remove default outline */
  border-color: #ffffff;   /* highlight border when focused */
  box-shadow: 0 0 5px #000000;
}

/* Status Bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 4px 16px;
  font-size: 12px;
  height: 28px;
  z-index: 100;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
}

.status-left, .status-right {
  display: flex;
  gap: 16px;
  align-items: center;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.status-item i {
  font-size: 11px;
}

/* Notification Box */
.notification-box {
  position: fixed;
  top: 70px;
  right: 20px;
  min-width: 320px;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow-lg);
  padding: 16px 20px;
  z-index: 10000;
  display: none;
  opacity: 0;
  transform: translateX(450px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notification-box.show {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.notification-box.success {
  border-left: 4px solid var(--success);
}

.notification-box.error {
  border-left: 4px solid var(--error);
}

.notification-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  transition: var(--transition);
  border-radius: 4px;
}

.notification-close:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.notification-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.notification-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-right: 20px;
}

/* Context Menu */
#context-menu {
  position: fixed;
  z-index: 1000;
  background-color: white;
  border: 1px solid #ccc;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  border-radius: 4px;
  padding: 4px 0;
  min-width: 180px;
  display: none;
}

/* Your existing CSS for menu items */
.context-menu-item-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.context-menu-item-btn:hover {
  background: #e0e0e0;
}

.context-menu-divider {
  height: 1px;
  background: #ccc;
  margin: 5px 0;
}

.context-menu-notes {
  position: fixed;
  z-index: 1200;
  background-color: white;
  border: 1px solid #ccc;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  border-radius: 4px;
  padding: 4px 0;
  min-width: 180px;
  display: none;
}

.context-menu-dict {
  position: fixed;
  z-index: 1300;
  background-color: white;
  border: 1px solid #ccc;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  border-radius: 4px;
  padding: 4px 0;
  min-width: 180px;
  display: none;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(4px);
  opacity: 0; 
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

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



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

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header span {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  border-radius: 4px;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Dictionary Popup */
.dictionary-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: rgba(255,255,255,0.95);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  width: 90%;
  max-width: 420px;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000000;
}

.dictionary-popup.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.popup-header {
  padding: 16px;
  display: flex;
  align-items: center;
}

.popup-search-container {
  flex: 1;
  position: relative;
}

.popup-search {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.popup-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
}

.popup-content {
  flex: 1;
  overflow-y: auto;
}

.popup-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.popup-list li {
  padding: 14px 20px;
  border-bottom: 1px solid #dee2e6;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: background 0.2s ease; /* Gotta check this */
}

.popup-list li:hover, .popup-list li.selected {
  background: rgba(67, 97, 238, 0.1);
}

.popup-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.popup-description {
  font-size: 13px;
  color: #6c757d;
}

.popup-tag {
  background: #4361ee;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999999;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-content::-webkit-scrollbar {
  width: 6px;
}

.popup-content::-webkit-scrollbar-thumb {
  background: #adb5bd;
  border-radius: 3px;
}


/* Notes Info Popup */
.notes-info-popup {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.6;
}

.notes-info-popup table {
  width: 100%;
}

/* File Tab Modified Indicator */
.file-tab.modified::after {
  content: '●';
  margin-left: 6px;
  color: var(--success);
  font-size: 10px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
  border: 3px solid var(--bg-primary);
}

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

::-webkit-scrollbar-corner {
  background: var(--bg-primary);
}

/* Selection */
::selection {
  background: rgba(88, 166, 255, 0.3);
  color: var(--text);
}

/* Focus Visible */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar, .notes-sidebar, .dictionary-sidebar {
  width: var(--Sidebar);
  }
  
  .settings-main {
  padding: 20px;
  }
  
  .welcome-content {
  padding: 20px;
  }
}


.popup {
  display: none; /* start hidden */
  flex-direction: column;
  gap: 15px;
  justify-content: center; /* optional */
  align-items: center;   /* optional */
  position: fixed;       /* to appear above content */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background-color: #1C2128;
  color: #E1E4E8;
  width: 350px;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  display: flex;
}


.popup-header .title {
  display: inherit;
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
}

.block {
  display: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.block label {  
  display: inherit;
  font-weight: 600;
}

.form-input, .wide-input {  
  display: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  outline: none;
  font-size: 0.95rem;
}

.form-input:focus, .wide-input:focus {
  display: inherit;
  box-shadow: 0 0 5px #4CAF50;
  background-color: rgba(255,255,255,0.05);
}

.display-keybind {
  display: inherit;
  padding: 10px;
  border: 1px solid #555;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  background-color: #2a2f38;
  transition: background-color 0.2s ease;
}

.display-keybind:hover {
  display: inherit;
  background-color: #3a3f48;
}

.popup-footer {
  display: inherit;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.key-btn {
  diplay: inherit;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}


