:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --dark-bg: #1e1e1e;
    --light-bg: #ffffff;
}

body {
    margin: 0;
    height: 100vh;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--primary-color);
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lesson-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.control-btn:hover {
    transform: translateY(-1px);
}

.lesson-select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 2px solid var(--secondary-color);
    background: white;
    color: var(--primary-color);
}

.theme-toggle {
    margin-right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    fill: white;
    transition: opacity 0.3s;
}

.theme-toggle .sun {
    opacity: 1;
}

.theme-toggle .moon {
    opacity: 0;
    position: absolute;
}

.dark-mode .theme-toggle .sun {
    opacity: 0;
}

.dark-mode .theme-toggle .moon {
    opacity: 1;
}

/* Icônes SVG */
.control-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}



.control-btn:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}


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

.editor-container {
    width: 50%;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #ccc;
}

.editor {
    position: relative;
}

.editor-label {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: none; /* Pour éviter que les labels interfèrent avec le clic dans l'éditeur */
}

#html-editor {
    height: 50%;
    border-bottom: 2px solid #ccc;
}

#css-editor {
    height: 50%;
}

#preview {
    width: 50%;
    height: 100%;
    position: fixed;
    right: 0;
    background: white;
}


.run-btn {
    background:#2ecc71;

}

.run-btn:hover {
    background-color: #27ae60;

}

/* Poignées de redimensionnement */
.resize-handle {
    position: absolute;
    background: #3498db;
    opacity: 0.3;
    transition: opacity 0.3s;
    z-index: 100;
}

.resize-handle:hover {
    opacity: 1;
}

.resize-handle.vertical {
    width: 4px;
    height: 100%;
    cursor: col-resize;
    right: -2px;
}

.resize-handle.horizontal {
    width: 100%;
    height: 4px;
    cursor: row-resize;
    bottom: -2px;
}

.preview-container {
    position: relative;
    width: calc(50% - 2px); /* Ajustez cette valeur selon vos besoins */
}

.preview-width {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000; /* Assurez-vous qu'il est au-dessus de l'iframe */
}


.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
}

.close {
  float: right;
  font-size: 24px;
  font-weight: bold;
}


@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .editor-container, #preview {
        width: 100% !important;
        height: 50vh !important;
    }

    .lesson-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .control-btn {
        padding: 6px 10px;
        font-size: 14px;
    }

    .lesson-select {
        width: 100%;
    }
}