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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e1e1e;
    color: #d4d4d4;
    height: 100vh;
    overflow: hidden;
}

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

header {
    background-color: #333;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4ec9b0;
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

select,
button {
    background-color: #444;
    color: white;
    border: 1px solid #555;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #555;
}

#btn-run {
    background-color: #28a745;
}

#btn-run:hover {
    background-color: #218838;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
    flex-direction: row;
    /* Retour à une disposition horizontale */
}

#left-panel {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    max-width: 80%;
}

#editor-container {
    flex: 0 0 70%;
    /* L'éditeur prend 70% de la hauteur gauche par défaut */
    display: flex;
    flex-direction: column;
    min-height: 100px;
}

#right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.resizer-v {
    width: 10px;
    background: #333;
    cursor: col-resize;
    transition: background 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resizer-v:hover {
    background: #555;
}

.resizer-v::after {
    content: "||";
    color: #888;
    font-size: 10px;
    font-weight: bold;
}

.resizer-h {
    height: 10px;
    background: #333;
    cursor: row-resize;
    transition: background 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resizer-h:hover {
    background: #555;
}

.resizer-h::after {
    content: "=";
    color: #888;
    font-size: 14px;
    font-weight: bold;
}

.tabs {
    display: flex;
    background-color: #252526;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    color: #969696;
    cursor: pointer;
}

.tab-btn.active {
    background-color: #1e1e1e;
    color: white;
    border-bottom: 2px solid #007acc;
}

.editors {
    flex: 1;
    position: relative;
}

textarea {
    width: 100%;
    height: 100%;
    background-color: #1e1e1e;
    color: #d4d4d4;
    border: none;
    padding: 15px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    resize: none;
    outline: none;
}

.hidden {
    display: none;
}

#preview-container {
    flex: 0 0 50%;
    /* Réduit pour laisser de la place à la console */
    display: flex;
    flex-direction: column;
    background-color: white;
    min-height: 100px;
}

#console-panel {
    flex: 0 0 20%;
    background-color: #1e1e1e;
    display: flex;
    flex-direction: column;
    min-height: 50px;
    border-top: 1px solid #333;
}

.console-header {
    background-color: #252526;
    color: #969696;
    padding: 5px 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#btn-clear-console {
    background: none;
    border: 1px solid #444;
    color: #969696;
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 2px;
}

#btn-clear-console:hover {
    background: #333;
    color: white;
}

#console-output {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

.console-log {
    color: #d4d4d4;
    border-bottom: 1px solid #2d2d2d;
    padding: 2px 0;
}

.console-error {
    color: #f44336;
    border-bottom: 1px solid #2d2d2d;
    padding: 2px 0;
    background: rgba(244, 67, 54, 0.1);
}

.console-warn {
    color: #ffeb3b;
    border-bottom: 1px solid #2d2d2d;
    padding: 2px 0;
    background: rgba(255, 235, 59, 0.1);
}

.console-info {
    color: #2196f3;
    border-bottom: 1px solid #2d2d2d;
    padding: 2px 0;
}

.preview-header {
    background-color: #252526;
    color: #969696;
    padding: 5px 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

#preview-iframe {
    flex: 1;
    border: none;
    width: 100%;
    height: 100%;
}

#assets-panel,
#modding-panel {
    flex: 1;
    background-color: #252526;
    padding: 10px;
    overflow-y: auto;
    border-top: 1px solid #444;
}

.assets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.assets-header h3 {
    margin: 0;
}

#btn-add-asset {
    background-color: #007acc;
    color: white;
    border: none;
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 3px;
    cursor: pointer;
}

#btn-add-asset:hover {
    background-color: #0062a3;
}

.asset-item {
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    border-radius: 3px;
}

.asset-item:hover {
    background-color: #37373d;
    color: white;
}

.asset-folder {
    font-weight: bold;
    color: #ce9178;
}

.asset-folder-content {
    margin-left: 15px;
    border-left: 1px solid #444;
}

.asset-file {
    color: #9cdcfe;
}

.asset-item.open::before {
    content: "▼";
    font-size: 0.6rem;
}

.asset-item.closed::before {
    content: "▶";
    font-size: 0.6rem;
}

.modding-header h3 {
    font-size: 1rem;
    color: #4ec9b0;
    margin-bottom: 10px;
}

#modding-tips-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tip-btn {
    background-color: #3e3e42;
    border: 1px solid #454545;
    color: #ccc;
    text-align: left;
    font-size: 0.85rem;
    padding: 8px;
    transition: all 0.2s;
}

.tip-btn:hover {
    background-color: #4e4e52;
    color: white;
}

.dropdown-export {
    position: relative;
    display: inline-block;
}

.export-options {
    display: none;
    position: absolute;
    right: 0;
    background-color: #333;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.export-options button {
    width: 100%;
    text-align: left;
    border-radius: 0;
    border: none;
}

.dropdown-export:hover .export-options {
    display: block;
}