@font-face {
  font-family: 'CodeFont';
  src: url('code.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
*:focus {
  outline: none !important;
  box-shadow: none !important;
}
html, body {
  margin: 0;
  height: 100%;
  font-family: 'CodeFont', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #121212;
  color: #ddd;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

#topbar {
  background: #1e1e1e;
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  color: #ddd;
  flex-shrink: 0;
  border-bottom: 1px solid #333;
}
#logo {
  height: 26px;
  width: auto;
  object-fit: contain;
}
#menu-toggle {
  display: none;
  margin-left: auto;
  font-size: 22px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  background: #2a2a2a;
  color: #ddd;
  transition: background-color 0.2s ease;
}
#menu-toggle:hover {
  background-color: #3a3a3a;
}

#main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#sidebar {
  width: 270px;
  background: #1e1e1e;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #333;
  transition: transform 0.3s ease;
}
#sidebar h2 {
  margin-top: 0;
  font-weight: 700;
  color: #ddd;
  letter-spacing: 1.1px;
}
#fileTree {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  background: #151515;
  border-radius: 6px;
  border: 1px solid #333;
}
#fileTree li {
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 4px;
  color: #ddd;
  font-weight: 500;
  transition: background-color 0.2s ease;
}
#fileTree li:hover,
#fileTree li.active {
  background: #2f2f2f;
  color: #fff;
  font-weight: 700;
}

/* Buttons */
button,
button:focus,
button:active {
  margin-top: 14px;
  background: #2a2a2a !important;
  border: none !important;
  color: #ddd;
  padding: 10px 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-focus-ring-color: transparent !important;
}
button:hover {
  background: #3a3a3a !important;
}

/* Tabs */
#tabs {
  height: 34px;
  background: #1e1e1e;
  display: flex;
  align-items: center;
  overflow-x: auto;
  border-bottom: 1px solid #333;
  padding-left: 10px;
}
.tab {
  padding: 6px 12px;
  cursor: pointer;
  color: #ddd;
  font-weight: 500;
  user-select: none;
  border-radius: 6px 6px 0 0;
  margin-right: 4px;
  display: flex;
  align-items: center;
  transition: background-color 0.2s ease;
}
.tab.active {
  background: #2f2f2f;
  color: #fff;
  font-weight: 700;
}
.tab .close-btn {
  margin-left: 8px;
  font-weight: bold;
  cursor: pointer;
  color: #ddd;
}
.tab .close-btn:hover {
  color: #fff;
}

/* Editor */
#editor {
  flex: 1;
  font-family: 'CodeFont', monospace;
  background: #121212;
  color: #eee;
  overflow: hidden;
  height: 100%;
}

/* Monaco Editor background override */
.monaco-editor, .monaco-editor-background, .monaco-editor .margin {
  background-color: #121212 !important;
  color: #eee !important;
}

/* Responsive */
@media (max-width: 768px) {
  #menu-toggle {
    display: inline-block;
  }

  #sidebar {
    position: absolute;
    top: 42px;
    left: 0;
    height: calc(100% - 42px);
    z-index: 999;
    transform: translateX(-100%);
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.4);
  }

  #sidebar.show {
    transform: translateX(0);
  }

  #main {
    flex-direction: column;
  }
}