/* ==========================================================================
   VS Code Mobile - Modern Dark Theme & Mobile-Optimized CSS
   ========================================================================== */

:root {
  --vscode-bg: #1e1e1e;
  --vscode-sidebar: #252526;
  --vscode-activity-bar: #333333;
  --vscode-tab-active: #1e1e1e;
  --vscode-tab-inactive: #2d2d2d;
  --vscode-tab-border: #1e1e1e;
  --vscode-status-bar: #007acc;
  --vscode-accent: #007acc;
  --vscode-accent-hover: #1f8ad2;
  --vscode-border: #3c3c3c;
  --vscode-border-light: #2d2d2d;
  --vscode-text: #cccccc;
  --vscode-text-muted: #858585;
  --vscode-text-light: #ffffff;
  --vscode-selection: #264f78;
  --vscode-list-hover: #2a2d2e;
  --vscode-list-active: #04395e;
  --vscode-input-bg: #3c3c3c;
  --vscode-font-mono: 'Consolas', 'Courier New', 'Fira Code', monospace;
  --vscode-font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--vscode-bg);
  color: var(--vscode-text);
  font-family: var(--vscode-font-ui);
  font-size: 13px;
  user-select: none;
  -webkit-user-select: none;
}

/* App Container Layout */
#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

/* ==========================================================================
   Top Title Bar & Header
   ========================================================================== */
.vscode-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  background-color: #323233;
  border-bottom: 1px solid var(--vscode-border-light);
  padding: 0 10px;
  z-index: 50;
  flex-shrink: 0;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-toggle-btn {
  background: none;
  border: none;
  color: var(--vscode-text);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
}

.menu-toggle-btn:active {
  background-color: rgba(255, 255, 255, 0.1);
}

.vscode-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
}

.vscode-icon-svg {
  width: 18px;
  height: 18px;
}

.breadcrumb-trail {
  display: none;
  color: var(--vscode-text-muted);
  font-size: 12px;
}

@media (min-width: 600px) {
  .breadcrumb-trail {
    display: inline-block;
  }
}

/* ==========================================================================
   Desktop Menu Bar (Visual Studio PC Menus)
   ========================================================================== */
.desktop-menubar {
  display: none;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

@media (min-width: 900px) {
  .desktop-menubar {
    display: flex;
  }
}

.menubar-item {
  position: relative;
  padding: 4px 8px;
  border-radius: 4px;
  color: #cccccc;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.menubar-item:hover, .menubar-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background-color: #252526;
  border: 1px solid #454545;
  border-radius: 5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  padding: 4px 0;
  z-index: 10000;
}

.menubar-item:hover .menu-dropdown,
.menubar-item.active .menu-dropdown {
  display: flex;
  flex-direction: column;
}

.menu-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 12px;
  color: #cccccc;
  cursor: pointer;
}

.menu-action:hover {
  background-color: #04395e;
  color: #ffffff;
}

.menu-key {
  color: #858585;
  font-size: 11px;
  margin-left: 16px;
  font-family: var(--vscode-font-mono);
}

.menu-divider {
  height: 1px;
  background-color: #383838;
  margin: 4px 0;
}

/* ==========================================================================
   Center Command Palette Bar (Modern VS Code Title Bar)
   ========================================================================== */
.titlebar-center-search {
  display: none;
  align-items: center;
  gap: 8px;
  background-color: #1e1e1e;
  border: 1px solid #3c3c3c;
  color: #858585;
  padding: 4px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  max-width: 440px;
  width: 100%;
  margin: 0 12px;
  transition: all 0.2s ease;
}

@media (min-width: 640px) {
  .titlebar-center-search {
    display: flex;
  }
}

.titlebar-center-search:hover {
  border-color: #007acc;
  color: #cccccc;
  background-color: #252526;
}

.center-search-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--vscode-text);
  padding: 5px 9px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn.btn-run {
  background-color: #0e639c;
  color: #ffffff;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.action-btn.btn-run:hover {
  background-color: #1177bb;
}

.action-btn.btn-run svg {
  fill: currentColor;
}

.icon-btn {
  padding: 6px;
}

.badge-counter {
  background: #f14c4c;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 2px;
}

/* ==========================================================================
   Main Workspace Body: Activity Bar + Sidebar + Editor
   ========================================================================== */
.vscode-main {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Activity Bar (Left icon strip) */
.activity-bar {
  width: 48px;
  background-color: var(--vscode-activity-bar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-right: 1px solid var(--vscode-border-light);
  flex-shrink: 0;
  z-index: 40;
}

.activity-bar-top, .activity-bar-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.activity-btn {
  background: none;
  border: none;
  color: #858585;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  position: relative;
  transition: color 0.15s ease;
}

.activity-btn:hover, .activity-btn.active {
  color: #ffffff;
}

.activity-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background-color: #ffffff;
  border-radius: 0 2px 2px 0;
}

/* Sidebar Drawer (File Explorer & Search) */
.sidebar {
  width: 260px;
  background-color: var(--vscode-sidebar);
  border-right: 1px solid var(--vscode-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 35;
}

.sidebar-view {
  display: none;
  flex-direction: column;
  height: 100%;
}

.sidebar-view.active {
  display: flex;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #bbbbbb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.sidebar-icon-btn {
  background: none;
  border: none;
  color: var(--vscode-text-muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
}

.sidebar-icon-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.explorer-section-title {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: bold;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.explorer-file-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.explorer-file {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  cursor: pointer;
  color: #cccccc;
  font-size: 13px;
  gap: 8px;
  position: relative;
}

.explorer-file:hover {
  background-color: var(--vscode-list-hover);
}

.explorer-file.active {
  background-color: #37373d;
  color: #ffffff;
}

.file-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-actions {
  display: none;
}

.explorer-file:hover .file-actions,
.explorer-file.active .file-actions {
  display: flex;
  align-items: center;
}

.file-action-btn {
  background: none;
  border: none;
  color: #858585;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}

.file-action-btn:hover {
  color: #f14c4c;
}

/* File Icons */
.file-icon {
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  flex-shrink: 0;
}

.icon-html {
  background-color: rgba(228, 77, 38, 0.2);
  color: #e44d26;
  font-size: 9px;
}

.icon-css {
  background-color: rgba(38, 77, 228, 0.2);
  color: #264de4;
}

.icon-js {
  background-color: rgba(247, 223, 30, 0.2);
  color: #f7df1e;
  font-size: 10px;
}

.icon-json {
  background-color: rgba(203, 166, 247, 0.2);
  color: #cba6f7;
  font-size: 10px;
}

/* Search View */
.search-container {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
}

.search-input-box {
  width: 100%;
  background-color: var(--vscode-input-bg);
  border: 1px solid var(--vscode-border);
  color: #ffffff;
  padding: 7px 10px;
  border-radius: 3px;
  font-size: 13px;
  outline: none;
}

.search-input-box:focus {
  border-color: var(--vscode-accent);
}

.search-results {
  flex: 1;
  overflow-y: auto;
}

.search-empty {
  color: var(--vscode-text-muted);
  font-size: 12px;
  padding: 12px;
  text-align: center;
}

.search-file-result {
  margin-bottom: 8px;
}

.search-file-header {
  font-weight: bold;
  padding: 4px 6px;
  background-color: rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.search-match-line {
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--vscode-font-mono);
  font-size: 12px;
  display: flex;
  gap: 8px;
  color: #cccccc;
}

.search-match-line:hover {
  background-color: var(--vscode-list-hover);
}

.match-lineno {
  color: #858585;
}

/* Mobile Overlay for Sidebar */
.sidebar-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 30;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  display: block;
}

/* Responsive Sidebar Drawer on Mobile Phones */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 48px;
    width: 250px;
    transform: translateX(-120%);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.5);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }
}

/* ==========================================================================
   Editor Area: Tabs + CodeMirror + Suggestion Widget
   ========================================================================== */
.editor-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background-color: var(--vscode-bg);
}

/* Editor Tabs Container */
.editor-tabs-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--vscode-sidebar);
  border-bottom: 1px solid var(--vscode-border-light);
  flex-shrink: 0;
  height: 36px;
}

.editor-tabs-bar {
  display: flex;
  align-items: center;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  flex: 1;
}

.tabs-right-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
}

.tab-action-icon {
  background: none;
  border: none;
  color: #858585;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-action-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Breadcrumbs Bar */
.editor-breadcrumbs {
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 14px;
  font-size: 11px;
  color: #858585;
  gap: 6px;
  background-color: var(--vscode-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  user-select: none;
}

.crumb-icon {
  font-size: 12px;
}

.crumb-sep {
  color: #555555;
  font-size: 10px;
}

.crumb-active {
  color: #cccccc;
  font-weight: 500;
}

/* Split Area: Code Editor + Side-by-Side Preview */
.editor-split-area {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.editor-pane {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.split-divider {
  display: none;
  width: 4px;
  background-color: #2b2b2b;
  cursor: col-resize;
  transition: background-color 0.2s ease;
}

.split-divider:hover {
  background-color: #007acc;
}

.split-preview-pane {
  display: none;
  flex-direction: column;
  width: 50%;
  background-color: #111111;
  border-left: 1px solid var(--vscode-border);
  overflow: hidden;
}

/* When Side-by-Side Split View is Active */
.editor-wrapper.split-active .split-divider {
  display: block;
}

.editor-wrapper.split-active .split-preview-pane {
  display: flex;
}

.editor-wrapper.split-active .editor-pane {
  flex: 1;
  width: 50%;
}

.split-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  background-color: #252526;
  padding: 0 10px;
  border-bottom: 1px solid var(--vscode-border-light);
}

.split-preview-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #858585;
}

.split-preview-title svg {
  fill: #89d185;
  color: #89d185;
}

.split-preview-controls {
  display: flex;
  gap: 4px;
}

.split-control-btn {
  background: none;
  border: none;
  color: #858585;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
}

.split-control-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

#splitPreviewIframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background-color: #ffffff;
}

.editor-tabs-bar::-webkit-scrollbar {
  display: none;
}

.editor-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 100%;
  background-color: var(--vscode-tab-inactive);
  border-right: 1px solid var(--vscode-border-light);
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  color: #969696;
  position: relative;
  user-select: none;
}

.editor-tab.active {
  background-color: var(--vscode-tab-active);
  color: #ffffff;
  border-top: 2px solid var(--vscode-accent);
}

.tab-title {
  font-family: var(--vscode-font-mono);
}

.tab-close-btn {
  background: none;
  border: none;
  color: #858585;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-left: 2px;
}

.tab-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.tab-new-btn {
  background: none;
  border: none;
  color: #858585;
  font-size: 18px;
  width: 32px;
  height: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tab-new-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}

/* CodeMirror Container */
#editorContainer {
  flex: 1;
  position: relative;
  overflow: hidden;
  font-size: 14px;
}

.CodeMirror {
  width: 100%;
  height: 100% !important;
  font-family: var(--vscode-font-mono);
  background-color: var(--vscode-bg);
  color: #d4d4d4;
  line-height: 1.5;
}

.CodeMirror-gutters {
  background-color: var(--vscode-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding-right: 4px;
}

.CodeMirror-linenumber {
  color: #858585;
  font-size: 12px;
}

.CodeMirror-cursor {
  border-left: 2px solid #528bff !important;
}

.CodeMirror-selected {
  background-color: var(--vscode-selection) !important;
}

/* Authentic VS Code Dark+ Syntax Colors */
.cm-tag { color: #569cd6 !important; }
.cm-bracket { color: #808080 !important; }
.cm-attribute { color: #9cdcfe !important; }
.cm-string { color: #ce9178 !important; }
.cm-string-2 { color: #ce9178 !important; }
.cm-keyword { color: #c586c0 !important; }
.cm-def { color: #dcdcaa !important; }
.cm-variable { color: #9cdcfe !important; }
.cm-variable-2 { color: #9cdcfe !important; }
.cm-variable-3 { color: #4ec9b0 !important; }
.cm-property { color: #9cdcfe !important; }
.cm-number { color: #b5cea8 !important; }
.cm-atom { color: #569cd6 !important; }
.cm-comment { color: #6a9955 !important; font-style: italic; }
.cm-operator { color: #d4d4d4 !important; }
.cm-qualifier { color: #d7ba7d !important; }
.cm-builtin { color: #4ec9b0 !important; }

/* ==========================================================================
   IntelliSense Floating Suggestion Widget
   ========================================================================== */
.suggestion-widget {
  position: fixed;
  display: none;
  flex-direction: column;
  width: 280px;
  max-width: calc(100vw - 20px);
  max-height: 220px;
  background-color: #252526;
  border: 1px solid #454545;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 1000;
  overflow: hidden;
  font-family: var(--vscode-font-ui);
}

.suggestion-list {
  flex: 1;
  overflow-y: auto;
  max-height: 160px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 12px;
  color: #cccccc;
  line-height: 1.2;
}

.suggestion-item:hover {
  background-color: var(--vscode-list-hover);
}

.suggestion-item.selected {
  background-color: var(--vscode-list-active);
  color: #ffffff;
}

.kind-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 11px;
  font-weight: bold;
  border-radius: 2px;
}

.kind-emmet { color: #e5a50a; }
.kind-snippet { color: #c586c0; }
.kind-prop { color: #9cdcfe; }
.kind-kw { color: #569cd6; }
.kind-fn { color: #dcdcaa; }
.kind-var { color: #4ec9b0; }

.suggestion-label {
  font-weight: 600;
  color: #ffffff;
}

.suggestion-detail {
  color: #858585;
  font-size: 11px;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.suggestion-doc {
  border-top: 1px solid #383838;
  padding: 6px 8px;
  background-color: #1e1e1e;
  font-size: 11px;
  color: #9d9d9d;
  white-space: pre-line;
  max-height: 60px;
  overflow-y: auto;
}

/* ==========================================================================
   Mobile Quick-Suggestion Bar (Thumb Pills above keyboard)
   ========================================================================== */
.mobile-chips-bar {
  display: none;
  background-color: #252526;
  border-top: 1px solid var(--vscode-border);
  padding: 6px 8px;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  z-index: 30;
  flex-shrink: 0;
}

.mobile-chips-bar::-webkit-scrollbar {
  display: none;
}

.mobile-chips-bar.visible {
  display: flex;
}

.mobile-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #333333;
  border: 1px solid #444444;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.mobile-chip:active {
  background-color: var(--vscode-accent);
  transform: scale(0.94);
}

.mobile-chip.primary {
  background-color: #0e639c;
  border-color: #1177bb;
}

.chip-text {
  font-weight: 600;
}

.chip-detail {
  color: #aaaaaa;
  font-size: 11px;
}

/* ==========================================================================
   Mobile Symbol Toolbar
   ========================================================================== */
.mobile-toolbar {
  display: flex;
  align-items: center;
  background-color: #252526;
  border-top: 1px solid var(--vscode-border-light);
  padding: 4px 6px;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  z-index: 25;
  flex-shrink: 0;
}

.mobile-toolbar::-webkit-scrollbar {
  display: none;
}

.symbol-key {
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  background-color: #2e2e2e;
  border: 1px solid #3c3c3c;
  color: #cccccc;
  font-family: var(--vscode-font-mono);
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

.symbol-key:active {
  background-color: var(--vscode-accent);
  color: #ffffff;
  transform: scale(0.92);
}

.symbol-key.action-key {
  background-color: #383838;
  font-size: 12px;
  color: #ffffff;
}

/* ==========================================================================
   Status Bar (VS Code Bottom Blue Bar)
   ========================================================================== */
.vscode-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  background-color: var(--vscode-status-bar);
  color: #ffffff;
  font-size: 11px;
  padding: 0 10px;
  flex-shrink: 0;
  z-index: 30;
  padding-bottom: var(--safe-bottom);
}

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

.statusbar-item {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* ==========================================================================
   Integrated Console Drawer (VS Code Terminal / Output)
   ========================================================================== */
.console-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  height: 260px;
  max-height: 60vh;
  background-color: #181818;
  border-top: 1px solid var(--vscode-border);
  display: none;
  flex-direction: column;
  z-index: 100;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
}

.console-drawer.open {
  display: flex;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background-color: #222222;
  border-bottom: 1px solid var(--vscode-border-light);
}

.console-title {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #cccccc;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.console-btn {
  background: none;
  border: none;
  color: #858585;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
}

.console-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.console-logs {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  font-family: var(--vscode-font-mono);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.console-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
  word-break: break-all;
}

.console-entry.console-log { color: #cccccc; }
.console-entry.console-info { color: #38bdf8; }
.console-entry.console-warn { color: #f59e0b; background-color: rgba(245, 158, 11, 0.08); }
.console-entry.console-error { color: #f87171; background-color: rgba(248, 113, 113, 0.1); }
.console-entry.console-input { color: #a78bfa; font-weight: 600; }

.console-time {
  color: #64748b;
  font-size: 10px;
}

.console-input-row {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background-color: #1e1e1e;
  border-top: 1px solid var(--vscode-border-light);
  gap: 8px;
}

.console-prompt {
  color: #38bdf8;
  font-family: var(--vscode-font-mono);
  font-weight: bold;
}

.console-input {
  flex: 1;
  background: none;
  border: none;
  color: #ffffff;
  font-family: var(--vscode-font-mono);
  font-size: 12px;
  outline: none;
}

/* ==========================================================================
   Live Preview Modal & Device Frames
   ========================================================================== */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.preview-modal.open {
  display: flex;
}

.preview-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: #222222;
  border-bottom: 1px solid var(--vscode-border);
  gap: 10px;
}

.preview-url-bar {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  background-color: #181818;
  border: 1px solid #333333;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: #94a3b8;
  gap: 8px;
}

.preview-devices {
  display: flex;
  gap: 4px;
}

.preview-device-btn {
  background: none;
  border: 1px solid transparent;
  color: #858585;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.preview-device-btn.active, .preview-device-btn:hover {
  background-color: #333333;
  color: #ffffff;
}

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

.preview-body {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #111111;
  overflow: hidden;
  padding: 10px;
}

.preview-viewport {
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
}

.preview-viewport.size-mobile {
  width: 375px;
  height: 667px;
  max-height: 90vh;
  border: 8px solid #2d2d2d;
  border-radius: 24px;
}

.preview-viewport.size-tablet {
  width: 768px;
  height: 90vh;
  border: 8px solid #2d2d2d;
  border-radius: 16px;
}

.preview-viewport.size-full {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

#previewIframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   Settings Modal & Cheat Sheet Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background-color: #252526;
  border: 1px solid var(--vscode-border);
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: #2d2d2d;
  border-bottom: 1px solid var(--vscode-border-light);
}

.modal-header h3 {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #858585;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-content {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-label {
  font-weight: 600;
  color: #e2e8f0;
  font-size: 13px;
}

.setting-desc {
  font-size: 12px;
  color: #94a3b8;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.setting-input-range {
  flex: 1;
}

.setting-select {
  background-color: #3c3c3c;
  color: #fff;
  border: 1px solid #444;
  padding: 6px 10px;
  border-radius: 4px;
  outline: none;
}

/* Snippets Cheat Sheet Table */
.cheat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.cheat-table th, .cheat-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #333333;
  text-align: left;
}

.cheat-table th {
  color: #38bdf8;
  font-size: 11px;
  text-transform: uppercase;
}

.cheat-code {
  font-family: var(--vscode-font-mono);
  background-color: #1e1e1e;
  color: #e5a50a;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.cheat-desc {
  color: #cccccc;
}

/* ==========================================================================
   Explorer Import Box & Buttons
   ========================================================================== */
.explorer-footer {
  padding: 10px;
  border-top: 1px solid var(--vscode-border-light);
  background-color: var(--vscode-sidebar);
}

.explorer-import-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #2d2d2d;
  border: 1px solid #444444;
  color: #cccccc;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.explorer-import-btn:hover {
  background-color: #383838;
  color: #ffffff;
  border-color: #007acc;
}

.explorer-import-btn:active {
  transform: scale(0.97);
  background-color: #007acc;
  color: #ffffff;
}

/* ==========================================================================
   Drag & Drop File Overlay
   ========================================================================== */
.drag-drop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(30, 30, 30, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.drag-drop-overlay.active {
  display: flex;
}

.drag-drop-box {
  border: 2px dashed #007acc;
  border-radius: 12px;
  padding: 36px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background-color: rgba(0, 122, 204, 0.08);
  max-width: 320px;
}

.drag-drop-box h3 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.drag-drop-box p {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

/* ==========================================================================
   VS Code Toast Notification
   ========================================================================== */
.vscode-toast {
  position: fixed;
  bottom: 32px;
  right: 16px;
  max-width: calc(100vw - 32px);
  background-color: #252526;
  border: 1px solid #454545;
  border-left: 4px solid #007acc;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.vscode-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.vscode-toast.toast-error {
  border-left-color: #f14c4c;
}

.vscode-toast.toast-success {
  border-left-color: #89d185;
}

.toast-icon {
  font-weight: bold;
  font-size: 14px;
  color: #007acc;
}

.vscode-toast.toast-success .toast-icon {
  color: #89d185;
}

.vscode-toast.toast-error .toast-icon {
  color: #f14c4c;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

/* ==========================================================================
   Visual Studio Code Command Palette (Ctrl+P / F1)
   ========================================================================== */
.palette-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  display: none;
  justify-content: center;
  align-items: flex-start;
  z-index: 10000;
  padding-top: 36px;
  backdrop-filter: blur(2px);
}

.palette-overlay.open {
  display: flex;
}

.palette-container {
  width: 90%;
  max-width: 580px;
  background-color: #252526;
  border: 1px solid #454545;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideDown 0.15s ease-out;
}

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

.palette-search-box {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background-color: #1e1e1e;
  border-bottom: 1px solid #3c3c3c;
  gap: 10px;
}

.palette-prompt {
  color: #007acc;
  font-family: var(--vscode-font-mono);
  font-weight: bold;
  font-size: 14px;
}

.palette-input {
  flex: 1;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  font-family: var(--vscode-font-ui);
}

.palette-results {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #cccccc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.palette-item:hover, .palette-item.active {
  background-color: #04395e;
  color: #ffffff;
}

.palette-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.palette-item-icon {
  font-size: 12px;
  color: #858585;
}

.palette-item.active .palette-item-icon {
  color: #38bdf8;
}

.palette-item-key {
  font-size: 11px;
  color: #858585;
  font-family: var(--vscode-font-mono);
}

.palette-item.active .palette-item-key {
  color: #d1d5db;
}

/* ==========================================================================
   Find & Replace Floating Widget (Ctrl+F / Ctrl+H)
   ========================================================================== */
.find-replace-widget {
  position: absolute;
  top: 6px;
  right: 18px;
  background-color: #252526;
  border: 1px solid #454545;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
  flex-direction: column;
  padding: 4px;
  gap: 4px;
  font-family: var(--vscode-font-ui);
  max-width: calc(100vw - 32px);
}

.find-replace-widget.open {
  display: flex;
}

.find-row, .replace-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.find-btn-toggle {
  background: none;
  border: none;
  color: #858585;
  width: 20px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.find-btn-toggle.open {
  transform: rotate(90deg);
}

.find-input-box {
  display: flex;
  align-items: center;
  background-color: #3c3c3c;
  border: 1px solid #3c3c3c;
  border-radius: 3px;
  padding: 0 6px;
  height: 26px;
}

.find-input-box:focus-within {
  border-color: #007acc;
}

.find-text-input {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 12px;
  width: 140px;
  outline: none;
  font-family: var(--vscode-font-mono);
}

.find-counter {
  color: #858585;
  font-size: 11px;
  white-space: nowrap;
  margin: 0 4px;
}

.find-btn-icon {
  background: none;
  border: none;
  color: #cccccc;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 3px;
  font-size: 12px;
}

.find-btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.find-btn-icon.active {
  background-color: #04395e;
  color: #ffffff;
  border: 1px solid #007acc;
}

.find-btn-text {
  background-color: #383838;
  border: 1px solid #444444;
  color: #cccccc;
  font-size: 11px;
  padding: 2px 8px;
  height: 24px;
  border-radius: 3px;
  cursor: pointer;
}

.find-btn-text:hover {
  background-color: #007acc;
  color: #ffffff;
}

/* ==========================================================================
   Export / Download Modal Cards
   ========================================================================== */
.export-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.export-option-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background-color: #1e1e1e;
  border: 1px solid #383838;
  border-radius: 6px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-option-card:hover {
  border-color: #007acc;
  background-color: rgba(0, 122, 204, 0.08);
  transform: translateY(-1px);
}

.export-option-card:active {
  transform: scale(0.98);
}

.export-card-icon {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}

.export-card-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.export-card-info p {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

/* Explorer File Action Buttons */
.file-action-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.file-action-btn.download-btn:hover {
  color: #38bdf8;
}

.file-action-btn.rename-btn:hover {
  color: #fde047;
}

.file-action-btn.delete-btn:hover {
  color: #f87171;
}



