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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  height: 100vh;
  overflow: hidden;
  background: #1e1e1e;
  color: #d4d4d4;
}

.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 300px;
  background: #252526;
  border-right: 1px solid #3e3e42;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 15px;
  border-bottom: 1px solid #3e3e42;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #cccccc;
}

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

#refresh-btn,
#logout-btn {
  background: transparent;
  border: 1px solid #3e3e42;
  color: #cccccc;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 16px;
}

#refresh-btn:hover,
#logout-btn:hover {
  background: #3e3e42;
}

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

/* Tree view styles */
.tree-view {
  width: 100%;
}

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

.tree-item {
  margin: 0;
  padding: 0;
}

.tree-item-header {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  cursor: pointer;
  user-select: none;
  color: #cccccc;
  font-size: 13px;
  border-radius: 3px;
  margin: 1px 0;
}

.tree-item-header:hover {
  background: #2a2d2e;
}

.tree-item-header.active {
  background: #37373d;
  color: #ffffff;
}

.tree-item-header.folder {
  font-weight: 500;
}

.tree-item-header.folder.expanded .tree-icon {
  /* Change folder icon when expanded */
}

.tree-chevron {
  display: inline-block;
  width: 16px;
  font-size: 10px;
  color: #cccccc;
  transition: transform 0.1s ease;
  flex-shrink: 0;
}

.tree-spacer {
  display: inline-block;
  width: 16px;
  flex-shrink: 0;
}

.tree-icon {
  margin-right: 6px;
  font-size: 14px;
  flex-shrink: 0;
}

.tree-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-item-empty {
  padding: 4px 8px 4px 24px;
  color: #858585;
  font-size: 12px;
  font-style: italic;
}

/* Nested tree indentation */
.tree-list .tree-list {
  padding-left: 16px;
}

.loading {
  padding: 20px;
  text-align: center;
  color: #858585;
}

.error {
  padding: 20px;
  text-align: center;
  color: #f48771;
}

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

.editor-header {
  background: #2d2d30;
  padding: 10px 15px;
  border-bottom: 1px solid #3e3e42;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.current-file {
  font-size: 14px;
  color: #cccccc;
}

.save-btn {
  background: #0e639c;
  border: none;
  color: #ffffff;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
}

.save-btn:hover:not(:disabled) {
  background: #1177bb;
}

.save-btn:disabled {
  background: #3e3e42;
  color: #858585;
  cursor: not-allowed;
}

.editor {
  flex: 1;
  overflow: hidden;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #2d2d30;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 90%;
}

.modal-content h2 {
  margin: 0 0 10px 0;
  color: #cccccc;
  font-size: 20px;
}

.modal-content p {
  margin: 0 0 20px 0;
  color: #858585;
  font-size: 14px;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #cccccc;
  font-size: 14px;
}

.form-group input[type="password"] {
  width: 100%;
  padding: 10px;
  background: #1e1e1e;
  border: 1px solid #3e3e42;
  border-radius: 3px;
  color: #cccccc;
  font-size: 14px;
}

.form-group input[type="password"]:focus {
  outline: none;
  border-color: #0e639c;
}

.form-group input[type="checkbox"] {
  margin-right: 8px;
}

.login-btn {
  width: 100%;
  background: #0e639c;
  border: none;
  color: #ffffff;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
}

.login-btn:hover {
  background: #1177bb;
}
