.app-container {
  display: flex;
  height: 100vh;
  color: rgb(17, 24, 39);
}

/* Sidebar (Left) */
.sidebar {
  width: 56px;
  background-color: rgb(249, 250, 251);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  gap: 10px;
}

.sidebar-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  opacity: 0.95;
}

.sidebar-icon:hover {
  background-color: rgba(0, 0, 0, 0.06);
  opacity: 1;
}

.sidebar-icon.active {
  background-color: rgba(0, 0, 0, 0.10);
  opacity: 1;
}

.sidebar-icon img {
  width: 18px;
  height: 18px;
  display: block;
}

.sidebar .settings {
  margin-top: auto;
  margin-bottom: 10px;
}

/* File Explorer (Middle) */
.file-explorer {
  width: 280px;
  background-color: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.tree-header{
    padding: 14px 14px 8px 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--muted-2);
    text-transform: uppercase;
}

.tree-scroll{
    overflow-y: auto;
    padding: 4px 6px 12px 6px;
}

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

.tree-list li{
    display: block;
    position: relative;
    min-height: 28px;
    line-height: 28px;
    padding: 0 8px 0 28px;
    margin: 2px 0;
    color: var(--muted-2);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
    transition: background-color 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.tree-list li::before{
    content: "";
    position: absolute;
    left: 12px;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgb(203,213,225);
}

.tree-list li:hover{
    background-color: var(--hover);
    color: rgb(31,41,55);
    padding-left: 30px;
}

.tree-list li.active{
    background-color: var(--active);
    color: rgb(17, 24, 39);
}

.tree-list li.folder > ul{
    display:none;
}

.tree-list li.folder.open > ul{
    display: block;
}

.tree-list li.folder::before{
    width: 0;
    height: 0;
    border-radius: 0;
    top: 11px;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid rgb(148,163,184);
}

.tree-list li.folder.open::before{
    transform: rotate(90deg);
}

.tree-list ul{
    margin: 2px 0 6px 0;
    padding-left: 12px;
}

/* Right Workspace */
.tabbed-editor{
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.workspace-header{
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.nav-arrows{
    display: inline-flex;
    gap: 6px;
}

.icon-btn{
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 6px;
    color: var(--muted-2);
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover{
    background: var(--hover);
    color: rgb(31,41,55);
}

/* Tabs */
.tab-strip{
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.tab{
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-bottom-color: var(--bg);
    background: var(--bg);
    color: rgb(31,41,55);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    cursor: default;
}

.tab .tab-title{
    font-size: 14px;
}

.tab .tab-close{
    font-size: 14px;
    opacity: 0.6;
}

.tab .tab-close:hover{
    opacity: 1;
    cursor: pointer;
}

.tab-new{
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 6px;
    color: var(--muted-2);
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.tab-new:hover{
    background: var(--hover);
    color: rgb(31,41,55);
}

/* Content Area */
.tab-content{
    padding: 22px 40px 40px 40px;
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
    color: rgb(17, 24, 39);
}

#path-bar{
    font-size: 12px;
    color: var(--muted);
    min-height: 18px;
    margin-bottom: 8px;
}

.content-surface{
    min-height: 200px;
}

.tab-content::-webkit-scrollbar{
    width: 10px;
}

.tab-content::-webkit-scrollbar-track{
    background: rgb(243, 244, 246); 
}

.tab-content::-webkit-scrollbar-thumb{ 
    background: rgb(209, 213, 219); border-radius: 6px;
}

.tab-content::-webkit-scrollbar-thumb:hover{ 
    background: rgb(156, 163, 175);
}

/*Toolbar*/
.editor-toolbar{
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    margin: 10px 0; 
    background: var(--bg);
}

.tool{
    height: 26px;
    padding: 0 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: rgb(55,65,81);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.tool:hover{
    background: var(--hover);
}

.tool-sep{
    width: 1px;
    height: 16px;
    background: var(--border);
    display: inline-block;
    margin: 0 4px;
}

/*Editor surface*/
.content-surface{
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor{
    flex: 1;
    overflow: auto;
    padding: 18px 22px;
    line-height: 1.6;
    outline: none;
}

.editor h1{
    font-size: 28px;
    margin: 0 0 10px 0;
}

.editor h2{
    font-size: 22px;
    margin: 18px 0 8px 0;
}

.editor p{
    margin: 10px 0;
}

/*Status bar*/
.statusbar{
    height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding: 0 10px;
    color: var(--muted);
    background: var(--bg);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.statusbar .dot{
    color: rgb(203,213,225);
}

#path-bar .sep{
    margin: 0 8px;
    color: rgb(156,163,175);
}
#path-bar .current{
    color: rgb(31,41,55);
}