/* ============================================
   EVM CODE EDITOR PRO - STYLES PRINCIPAUX
   ============================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* ============================================
   HEADER - BARRE SUPÉRIEURE
   ============================================ */

.header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 40px;
    width: auto;
}

.title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
}

.toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: var(--btn-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toolbar-btn:hover {
    background: var(--btn-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.toolbar-btn:active {
    transform: translateY(0);
}

/* ============================================
   CONTENEUR PRINCIPAL
   ============================================ */

.main-container {
    display: flex;
    height: calc(100vh - 61px);
    position: relative;
}

/* ============================================
   SIDEBAR - PANNEAU LATÉRAL
   ============================================ */

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    transition: transform 0.3s;
    position: relative;
    z-index: 10;
}

.sidebar.collapsed {
    transform: translateX(-250px);
}

.sidebar-header {
    padding: 15px;
    background: var(--sidebar-header-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-weight: bold;
    font-size: 14px;
    color: var(--text-primary);
}

.sidebar-toggle {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 5px;
}

/* Bouton de toggle fixe (toujours visible) */
.sidebar-toggle-fixed {
    position: fixed;
    top: 70px;
    left: 10px;
    z-index: 100;
    background: var(--btn-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.sidebar-toggle-fixed:hover {
    background: var(--btn-hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle-fixed.hidden {
    display: none;
}

.sidebar-category {
    margin: 15px 0;
}

.category-title {
    padding: 10px 15px;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    font-size: 14px;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: var(--sidebar-item-hover);
    border-left-color: #4CAF50;
    padding-left: 18px;
}

/* ============================================
   ZONE D'ÉDITION
   ============================================ */

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--editor-container-bg);
}

.tabs {
    display: flex;
    background: var(--tabs-bg);
    border-bottom: 1px solid var(--border-color);
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    background: var(--tab-bg);
    color: var(--text-secondary);
    border: none;
    border-right: 1px solid var(--border-color);
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.tab:hover {
    background: var(--tab-hover-bg);
}

.tab.active {
    background: var(--tab-active-bg);
    color: white;
    border-bottom: 3px solid #2196F3;
}

.editor-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.editor {
    width: 100%;
    height: 100%;
    padding: 15px;
    background: var(--editor-bg);
    color: var(--editor-text);
    border: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

.editor::placeholder {
    color: var(--placeholder-color);
    font-style: italic;
}

/* ============================================
   ZONE D'APERÇU
   ============================================ */

.preview-container {
    width: 50%;
    display: flex;
    flex-direction: column;
    background: var(--preview-container-bg);
    border-left: 1px solid var(--border-color);
}

.preview-header {
    padding: 12px 20px;
    background: var(--preview-header-bg);
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    color: var(--text-primary);
}

.preview {
    flex: 1;
    border: none;
    background: white;
}

/* ============================================
   SCROLLBAR PERSONNALISÉE
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .header {
        padding: 8px 10px;
    }
    
    .title {
        font-size: 16px;
    }
    
    .toolbar-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: absolute;
        height: 100%;
        z-index: 100;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }
    
    .editor-container,
    .preview-container {
        width: 100%;
    }
    
    .preview-container {
        height: 40%;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .sidebar-toggle-fixed {
        top: 60px;
        left: 5px;
    }
}

/* ============================================
   UTILITAIRES
   ============================================ */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

.p-20 {
    padding: 20px;
}
