/* ==========================================================================
   LAYOUT.CSS - Estrutura Principal, Header, Sidebar e Modos de Interface
   ========================================================================== */

.header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.header h1 {
    font-size: 20px;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: #34495e;
    color: white;
    overflow-y: auto;
    padding: 20px;
    transition: width 0.3s;
}

.workspace {
    flex: 1;
    display: flex;
    position: relative;
    overflow: auto;
    background: #f0f0f0;
}

/* Botões de Modo localizados no Header */
.mode-btn {
    background: #34495e;
    color: white;
    border: 1px solid #5d6d7e;
    padding: 8px 15px;
    margin-right: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.mode-btn:hover { background: #4e6a85; }
.mode-btn.active { background: #3498db; border-color: #fff; font-weight: bold; }

.execute-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    margin-left: 15px;
}

.execute-btn:hover { background: #2ecc71; }

/* Botão Flutuante de Saída (Modo Teste) */
#exit-test-mode {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
}

/* --- CONTROLE DE VISIBILIDADE DE MODOS --- */

/* 1. Escondido por padrão */
.category-script-blocks, 
.script-area,
#exit-test-mode {
    display: none !important;
}

/* 2. Configurações para MODO EDITOR */
body.mode-editor .category-element-tools { display: block; }
body.mode-editor .canvas-area { display: block; }
body.mode-editor .script-area { display: none !important; }

/* 3. Configurações para MODO SCRIPT */
body.mode-script .category-element-tools,
body.mode-script .canvas-area { 
    display: none !important; 
}
body.mode-script .category-script-blocks { display: block !important; }
body.mode-script .sidebar { width: 300px; }
body.mode-script .script-area {
    display: flex !important;
    position: fixed;
    top: 60px;
    left: 300px;
    right: 0;
    bottom: 0;
    z-index: 100;
    border-radius: 0;
    background: white;
    padding: 20px;
    flex-direction: column;
}

/* 4. Configurações para MODO TESTE */
body.mode-test .header, 
body.mode-test .sidebar, 
body.mode-test .script-area { 
    display: none !important; 
}
body.mode-test #exit-test-mode { display: block !important; }
body.mode-test .main-container { padding: 0; }
body.mode-test .canvas-area {
    display: block !important;
    width: 100vw;
    height: 100vh;
    border: none;
    padding: 0;
    border-radius: 0;
}

body.show-homepage .header,
body.show-homepage .main-container {
    display: none !important;
}