/* Styles pour l'éditeur et l'interface principale */

:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --sidebar-width: 25%;
    --sidebar-collapsed-width: 60px;
    --right-sidebar-width: 300px;
    --console-height: 200px;
}

/* Styles pour les éléments de contenu dans la sidebar */
.content-list {
    padding: 15px;
}

.content-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.content-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.content-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.content-item:hover:before {
    opacity: 1;
}

/* Classes pour les différentes difficultés */
.content-item.difficulty-easy:before {
    background: var(--success-color);
}

.content-item.difficulty-medium:before {
    background: var(--warning-color);
}

.content-item.difficulty-hard:before {
    background: var(--error-color);
}

/* Header de la carte avec titre et langage */
.content-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.content-item-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: rgba(0, 0, 0, 0.9);
    flex: 1;
    margin-right: 10px;
}

/* Corps de la carte avec tags et informations sur les points */
.content-item-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Tags (difficulté, type, etc.) */
.content-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.content-tag {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.85);
}

/* Style spécifique pour chaque type de tag */
.language-tag {
    background-color: rgba(59, 130, 246, 0.25);
    color: rgba(0, 0, 0, 0.9);
}

.difficulty-tag {
    display: inline-flex;
    align-items: center;
}

.difficulty-tag.difficulty-easy {
    background-color: rgba(16, 185, 129, 0.25);
    color: rgba(0, 0, 0, 0.9);
}

.difficulty-tag.difficulty-medium {
    background-color: rgba(245, 158, 11, 0.25);
    color: rgba(0, 0, 0, 0.9);
}

.difficulty-tag.difficulty-hard {
    background-color: rgba(239, 68, 68, 0.25);
    color: rgba(0, 0, 0, 0.9);
}

.type-tag {
    background-color: rgba(139, 92, 246, 0.25);
    color: rgba(0, 0, 0, 0.9);
}

/* Informations sur les points */
.content-item-points {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.8);
}

.unlock-cost, .reward-points {
    display: flex;
    align-items: center;
    gap: 4px;
}

.unlock-cost i {
    color: var(--warning-color);
}

.reward-points i {
    color: var(--success-color);
}

/* Contrôles de l'éditeur avec positionnement absolu */
.editor-controls-absolute {
    position: absolute;
    bottom: 25px;
    right: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

/* Groupe de boutons */
.editor-buttons-group {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Boutons flottants */
.btn-float {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    width: auto;
    min-width: 130px;
    text-align: left;
}

/* Petits boutons flottants (pour les actions de console) */
.btn-float.btn-small {
    min-width: unset;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-float.btn-small i {
    margin-right: 0;
    font-size: 1.1rem;
}

.btn-float i {
    margin-right: 8px;
    font-size: 1rem;
}

.btn-float:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#run-code {
    display: none;
    background-color: rgba(16, 185, 129, 0.7); /* Couleur verte semi-transparente */
}

#run-code:hover {
    background-color: rgba(16, 185, 129, 0.9);
}

#clear-console {
    background-color: rgba(107, 114, 128, 0.7); /* Couleur grise semi-transparente */
}

#clear-console:hover {
    background-color: rgba(107, 114, 128, 0.9);
}

#toggle-console {
    background-color: rgba(59, 130, 246, 0.7); /* Couleur bleue semi-transparente */
}

#toggle-console:hover {
    background-color: rgba(59, 130, 246, 0.9);
}

/* Style pour le bouton de validation */
#validate-code {
    display: none;
    background-color: rgba(139, 92, 246, 0.7); /* Couleur violette semi-transparente */
}

#validate-code:hover {
    background-color: rgba(139, 92, 246, 0.9);
}

/* Indicateur de langage actif */
.language-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 50;
    animation: fadeIn 0.3s ease;
}

.language-indicator i {
    margin-right: 6px;
    font-size: 1rem;
}

/* Couleurs spécifiques pour chaque langage */
.language-indicator.lang-js {
    background-color: rgba(240, 219, 79, 0.8);
    color: rgba(0, 0, 0, 0.8);
}

.language-indicator.lang-html {
    background-color: rgba(227, 79, 38, 0.8);
    color: white;
}

.language-indicator.lang-css {
    background-color: rgba(33, 150, 243, 0.8);
    color: white;
}

.language-indicator.lang-python {
    background-color: rgba(55, 118, 171, 0.8);
    color: white;
}

.language-indicator.lang-java {
    background-color: rgba(244, 67, 54, 0.8);
    color: white;
}

.language-indicator.lang-json {
    background-color: rgba(76, 175, 80, 0.8);
    color: white;
}

.language-indicator.lang-md {
    background-color: rgba(96, 125, 139, 0.8);
    color: white;
}

/* Sidebar gauche */
.left-sidebar {
    width: var(--sidebar-width);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: black;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    z-index: 10;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    /* On supprime la transition lors du redimensionnement manuel */
    transition: width 0.4s ease;
}

/* Style pour le resizer de la sidebar */
.sidebar-resizer {
    width: 6px;
    height: 100%;
    background-color: #e0e0e0;
    position: absolute;
    right: 0; /* Position à droite de la sidebar */
    top: 0;
    cursor: col-resize;
    z-index: 20;
}

/* État survol du resizer */
.sidebar-resizer:hover {
    background-color: #4a6cf7;
}

/* État actif du resizer (pendant le drag) */
.sidebar-resizer.active {
    background-color: #4a6cf7;
}

/* Lors du redimensionnement, désactiver la sélection de texte pour éviter les problèmes */
body.resizing {
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.resize {
    max-width: 45%;
    resize: horizontal;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}
.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgb(0 0 0 / 60%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(0, 0, 0, 0.802);
    transform: scale(1.05);
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    position: relative;
}

.sidebar-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-menu {
    padding: 15px 0;
}

.menu-item {
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    margin: 5px 10px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.menu-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.1), transparent);
    transition: width 0.4s ease;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.menu-item:hover:before {
    width: 100%;
}

.menu-item.active {
    background-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.menu-item i {
    margin-right: 12px;
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.menu-item:hover i {
    transform: scale(1.2);
}

.menu-item-text {
    transition: all 0.3s ease;
    font-weight: 500;
}

.left-sidebar.collapsed .menu-item-text {
    opacity: 0;
    display: none;
    transform: translateX(-20px);
}

.left-sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 14px 0;
}

.left-sidebar.collapsed .menu-item i {
    margin-right: 0;
    font-size: 1.3rem;
}

.submenu {
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.submenu.open {
    max-height: 500px;
}

/* Contenu principal */
.main-content {
    flex: 1;
    width: 80%;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* Zone de l'éditeur */
.editor-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

#monaco-editor {
    width: 100%;
    height: 100%;
}

/* Console */
.console-container {
    height: 0;
    background-color: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    transition: all 0.4s ease;
    overflow: hidden;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2);
}

.console-container.open {
    height: var(--console-height);
}

.console-toggle {
    position: absolute;
    top: -35px;
    right: 20px;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.console-toggle:hover {
    background: rgba(40, 40, 40, 0.9);
    transform: translateY(-3px);
}

.console-content {
    padding: 15px;
    height: 100%;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Sidebar droite */
.right-sidebar {
    width: 0;
    background-color: rgba(241, 241, 241, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 100vh;
    position: absolute;
    right: 0;
    top: 0;
    transition: all 0.4s ease;
    overflow: hidden;
    z-index: 5;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.right-sidebar.open {
    width: var(--right-sidebar-width);
}

.right-sidebar-toggle {
    position: absolute;
    top: 15px;
    left: -35px;
    background: rgba(241, 241, 241, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 35px;
    height: 35px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.right-sidebar-toggle:hover {
    background: rgba(241, 241, 241, 0.9);
    transform: translateX(-3px);
}

.user-info {
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.boutique-section {
    padding: 20px;
}

.boutique-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.boutique-item:hover {
    background-color: #f9f9f9;
}

.boutique-item-icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
}

.boutique-item-info {
    flex: 1;
}

.boutique-item-name {
    font-weight: bold;
}

.boutique-item-price {
    color: var(--secondary-color);
    font-size: 0.9em;
}

/* Responsive design */
@media (max-width: 768px) {
    .left-sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .left-sidebar .menu-item-text {
        display: none;
    }
    
    .right-sidebar.open {
        width: 100%;
    }
}