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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    background-color: #1e1e1e;
    color: #cccccc;
    font-size: 13px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* NAVIGATION TOP - Title Bar */
.nav-top {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    background-color: #323233;
    padding: 4px 12px;
    color: #cccccc;
    min-height: 28px;
    -webkit-app-region: drag;
}

.nav-top .btn-left {
    display: flex;
    gap: 8px;
}

.nav-top .btn-left div {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.nav-top .btn-left .btn-red {
    background-color: #ff5f57;
}

.nav-top .btn-left .btn-yellow {
    background-color: #febc2e;
}

.nav-top .btn-left .btn-green {
    background-color: #28c840;
}

.nav-top .center-menu-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-top .center-menu-top i {
    font-size: 11px;
    color: #858585;
    cursor: pointer;
}

.nav-top .center-menu-top i:hover {
    color: #cccccc;
}

.nav-top .center-menu-top .search {
    min-width: 450px;
    padding: 3px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background-color: #3c3c3c;
    border-radius: 6px;
    font-size: 12px;
    color: #cccccc;
}

.nav-top .center-menu-top .search i {
    font-size: 11px;
    color: #858585;
}

.nav-top .menu-droite {
    display: flex;
    gap: 12px;
}

.nav-top .menu-droite i {
    font-size: 14px;
    color: #858585;
    cursor: pointer;
}

.nav-top .menu-droite i:hover {
    color: #cccccc;
}

/* Menu Bar */
.menu-bar {
    display: flex;
    background-color: #3c3c3c;
    padding: 2px 10px;
    gap: 4px;
}

.menu-bar span {
    padding: 4px 8px;
    font-size: 12px;
    color: #cccccc;
    cursor: pointer;
    border-radius: 4px;
}

.menu-bar span:hover {
    background-color: #505050;
}

/* MAIN */
main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Activity Bar (NAV LEFT) */
.nav-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 48px;
    background-color: #333333;
    padding-top: 4px;
}

.nav-left .icon {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    color: #858585;
}

.nav-left .icon:hover {
    color: #cccccc;
}

.nav-left .icon.active {
    color: #ffffff;
}

.nav-left .icon.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #ffffff;
}

.nav-left .icon i {
    font-size: 22px;
}

.nav-left .spacer {
    flex: 1;
}

.nav-left .icon.bottom {
    margin-bottom: 4px;
}

/* EXPLORATEUR / Sidebar */
.explorateur {
    background-color: #252526;
    color: #cccccc;
    width: 240px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #3c3c3c;
}

.explorateur header {
    display: flex;
    padding: 10px 16px;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #bbbbbb;
}

.explorateur header i {
    font-size: 14px;
    color: #858585;
    cursor: pointer;
}

.explorateur .dossier {
    flex: 1;
    overflow-y: auto;
}

.folder-header {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    gap: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
}

.folder-header:hover {
    background-color: #2a2d2e;
}

.folder-header i:first-child {
    font-size: 10px;
    width: 16px;
    color: #858585;
}

.folder-header.sub {
    padding-left: 20px;
    font-weight: 400;
    text-transform: none;
    font-size: 13px;
}

.folder-icon {
    color: #dcb67a;
    font-size: 14px;
}

.folder-content.sub {
    padding-left: 12px;
}

.file {
    display: flex;
    align-items: center;
    padding: 4px 8px 4px 44px;
    cursor: pointer;
    gap: 6px;
    font-size: 13px;
}

.file.root {
    padding-left: 32px;
}

.file:hover {
    background-color: #2a2d2e;
}

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

.html-icon {
    color: #e44d26;
    font-size: 14px;
}

.css-icon {
    color: #264de4;
    font-size: 14px;
}

.js-icon {
    color: #f7df1e;
    font-size: 14px;
}

/* EDITEUR Principal */
.principal-editor {
    background-color: #1e1e1e;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tabs */
.tabs {
    display: flex;
    background-color: #252526;
    min-height: 35px;
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: #2d2d2d;
    border-right: 1px solid #252526;
    cursor: pointer;
    font-size: 13px;
    color: #969696;
}

.tab:hover {
    background-color: #2d2d2d;
}

.tab.active {
    background-color: #1e1e1e;
    color: #ffffff;
    border-top: 1px solid #007acc;
    margin-top: -1px;
}

.tab .close {
    font-size: 10px;
    padding: 2px;
    border-radius: 4px;
    opacity: 0;
}

.tab:hover .close {
    opacity: 1;
}

.tab .close:hover {
    background-color: #505050;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 16px;
    background-color: #1e1e1e;
    font-size: 12px;
    color: #969696;
    border-bottom: 1px solid #3c3c3c;
}

.breadcrumb i {
    font-size: 8px;
    color: #858585;
}

/* Editor Area */
.editor {
    flex: 1;
    display: flex;
    overflow: hidden;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}

.code-lines {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    background-color: #1e1e1e;
}

.code-row {
    display: flex;
}

.code-row:hover {
    background-color: #2a2d2e;
}

.line-num {
    flex-shrink: 0;
    width: 50px;
    text-align: right;
    padding-right: 16px;
    color: #858585;
    user-select: none;
    box-sizing: border-box;
}

.line {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
    padding-right: 16px;
    min-height: 21px;
}

/* Indentation */
.indent1 { padding-left: 48px; }
.indent2 { padding-left: 80px; }
.indent3 { padding-left: 112px; }

/* Syntax highlighting */
.gray { color: #808080; }
.blue { color: #569cd6; }
.lightblue { color: #9cdcfe; }
.orange { color: #ce9178; }
.white { color: #d4d4d4; }
.green { color: #6a9955; }
.yellow { color: #dcdcaa; }
.purple { color: #c586c0; }
.comment { color: #6a9955; font-style: italic; }

/* Minimap */
.minimap {
    width: 80px;
    background-color: #1e1e1e;
    border-left: 1px solid #3c3c3c;
    padding: 8px 4px;
}

.minimap-content {
    width: 100%;
    height: 120px;
    background: linear-gradient(
        to bottom,
        #569cd640 2px, transparent 2px,
        transparent 4px, #9cdcfe40 4px,
        #9cdcfe40 6px, transparent 6px,
        transparent 8px, #80808040 8px,
        #80808040 10px, transparent 10px,
        transparent 12px, #569cd640 12px,
        #569cd640 14px, transparent 14px,
        transparent 16px, #ce917840 16px,
        #ce917840 18px, transparent 18px,
        transparent 20px, #80808040 20px,
        #80808040 22px, transparent 22px
    );
    background-size: 100% 24px;
    border-radius: 2px;
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    background-color: #007acc;
    padding: 2px 10px;
    font-size: 12px;
    color: #ffffff;
    min-height: 22px;
}

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

.status-bar span {
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.status-bar span:hover {
    background-color: #1f8ad2;
}

.status-bar .branch {
    background-color: #1f8ad2;
}

.status-bar .errors i:first-child {
    color: #ffffff;
}

.status-bar .errors i:last-child {
    color: #ffcc00;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #4f4f4f;
}

/* Overlay when sidebar is open on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 5;
}

/* RESPONSIVE - Tablette */
@media (max-width: 768px) {
    .nav-top .center-menu-top .search {
        min-width: 200px;
    }

    .explorateur {
        width: 200px;
        min-width: 160px;
    }

    .minimap {
        display: none;
    }

    .menu-bar {
        overflow-x: auto;
        white-space: nowrap;
    }

    .menu-bar::-webkit-scrollbar {
        height: 0;
    }

    .status-bar .right span:nth-child(2),
    .status-bar .right span:nth-child(3),
    .status-bar .right span:nth-child(4) {
        display: none;
    }
}

/* RESPONSIVE - Mobile */
@media (max-width: 550px) {
    .nav-top .btn-left .btn-red,
    .nav-top .btn-left .btn-yellow,
    .nav-top .btn-left .btn-green {
        display: none;
    }

    .nav-top .center-menu-top .search {
        min-width: 0;
        flex: 1;
    }

    .nav-top .center-menu-top {
        flex: 1;
    }

    .nav-top .center-menu-top i.fa-chevron-left,
    .nav-top .center-menu-top i.fa-chevron-right {
        display: none;
    }

    .menu-bar {
        display: none;
    }

    /* Activity bar compact */
    .nav-left {
        width: 40px;
    }

    .nav-left .icon {
        width: 40px;
        height: 40px;
    }

    .nav-left .icon i {
        font-size: 18px;
    }

    /* Sidebar hidden by default, overlay when open */
    .explorateur {
        display: none;
        position: fixed;
        top: 0;
        left: 40px;
        bottom: 0;
        width: 220px;
        z-index: 10;
    }

    /* Sidebar open state */
    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    body.sidebar-open .explorateur {
        display: flex;
    }

    /* Highlight active icon when sidebar is open */
    body.sidebar-open .nav-left {
        z-index: 11;
    }

    body.sidebar-open .nav-left .icon.active {
        background-color: #252526;
    }

    /* Editor compact */
    .line-num {
        width: 35px;
        padding-right: 8px;
        font-size: 11px;
    }

    .editor {
        font-size: 12px;
    }

    .line {
        padding-right: 8px;
    }

    .indent1 { padding-left: 24px; }
    .indent2 { padding-left: 40px; }
    .indent3 { padding-left: 56px; }

    /* Tabs scrollable */
    .tabs {
        overflow-x: auto;
    }

    .tabs::-webkit-scrollbar {
        height: 0;
    }

    .tab {
        white-space: nowrap;
        font-size: 12px;
        padding: 6px 10px;
    }

    /* Breadcrumb */
    .breadcrumb {
        padding: 3px 10px;
        font-size: 11px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .breadcrumb::-webkit-scrollbar {
        height: 0;
    }

    /* Status bar compact */
    .status-bar {
        font-size: 11px;
    }

    .status-bar .right span:nth-child(2),
    .status-bar .right span:nth-child(3),
    .status-bar .right span:nth-child(4) {
        display: none;
    }

    .status-bar span {
        padding: 0 4px;
    }
}
