:root {
    /* Palette de couleurs moderne */
    --primary-gradient: linear-gradient(135deg, #4f6cf7 0%, #3b5fe2 100%);
    --secondary-gradient: linear-gradient(135deg, #3a7bd5 0%, #2456ad 100%);
    --green-gradient: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    --red-gradient: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    --orange-gradient: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    --light-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #1a2530 100%);
    
    /* Couleurs de base */
    --primary-color: #4f6cf7;
    --secondary-color: #3b5fe2;
    --bg-color: #f5f7fa;
    --text-color: #2c3e50;
    --folder-color: #f39c12;
    --file-color: #2ecc71;
    --hover-color: #e4e8f0;
    --border-color: #ddd;
    
    /* Effets */
    --box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    height: 100%;
    background-color: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.sidebar-header {
    padding: 15px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #4f6cf7 100%);
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
    border-bottom: none;
    position: relative;
}

/* Logo container for better visibility */
.sidebar-header img {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 6px 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.sidebar-header img:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.user-info {
    font-size: 0.9em;
    padding: 10px 15px;
    background-color: #f0f0f0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tree-container {
    flex: 1;
    overflow: auto;
    padding: 10px;
}

.tree {
    list-style-type: none;
}

.tree-item {
    margin: 4px 0;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.tree-item:hover {
    background-color: var(--hover-color);
    transform: translateX(3px);
}

.tree-item.selected {
    background-color: rgba(79, 108, 247, 0.1);
    font-weight: 600;
}

.tree-item i {
    margin-right: 10px;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.tree-item span {
    font-size: 0.95rem;
    margin-left: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Style pour les icônes de dossiers */
.folder > i {
    color: #f8d775;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Effet de survol pour les dossiers */
.folder:hover > i {
    color: #f5c211;
    transform: scale(1.1);
}

/* Style pour les dossiers ouverts */
.folder.open > i {
    color: #f5c211;
}

/* Styles pour les icônes de fichiers */
.file > i {
    color: #4a9df8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Effet de survol pour les fichiers */
.file:hover > i {
    color: #3a7bd5;
    transform: scale(1.1);
}

/* Utiliser des icônes plus spécifiques si Font Awesome est disponible */
.folder > i.fas.fa-folder:before {
    content: "\f07b";
}

.folder.open > i.fas.fa-folder:before {
    content: "\f07c";
}

.file > i.fas.fa-file-alt:before {
    content: "\f15c";
}

.nested {
    display: none;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.active {
    display: block;
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

/* Styles pour les lignes d'arborescence */
.tree ul {
    list-style-type: none;
    padding-left: 20px;
    margin: 0;
    position: relative;
}

/* Lignes verticales */
.tree ul:before {
    content: '';
    position: absolute;
    top: 0;
    left: 8px;
    width: 1px;
    height: 100%;
    background-color: #ddd;
    z-index: 0;
}

/* Lignes horizontales */
.tree-item:before {
    content: '';
    position: absolute;
    top: 15px;
    left: -12px;
    width: 12px;
    height: 1px;
    background-color: #ddd;
    z-index: 1;
}

/* Pas de ligne horizontale pour le premier niveau */
.tree > li > .tree-item:before {
    display: none;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px 20px;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--box-shadow);
    border-radius: 8px 8px 0 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-controls .actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.content-header h2 {
    font-size: 1.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: none;
}

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

.editor-area {
    flex: 1;
    padding: 15px;
    background-color: white;
    resize: none;
    border: none;
    outline: none;
    font-family: 'Courier New', Courier, monospace;
    overflow: auto;
    border-radius: 0 0 8px 8px;
}

.btn {
    padding: 8px 12px;
    background: var(--secondary-gradient);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn i {
    margin-right: 5px;
}

/* Boutons spécifiques avec gradients différents */
#save-btn {
    background: var(--green-gradient);
}

#delete-btn {
    background: var(--red-gradient);
}

#share-btn {
    background: var(--orange-gradient);
}

#register-btn {
    background: var(--green-gradient);
}

#login-button {
    background: var(--secondary-gradient);
}

.actions {
    display: flex;
    gap: 10px;
}

.sidebar-buttons {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

.sidebar-buttons .btn {
    flex: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--light-gradient);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: none;
    padding: 20px;
    width: 400px;
    max-width: 90%;
}

.modal-header {
    background: var(--secondary-gradient);
    color: white;
    border-radius: 12px 12px 0 0;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -20px -20px 15px -20px;
}

.modal-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
    opacity: 0.8;
}

.close-btn:hover {
    opacity: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 108, 247, 0.2);
    outline: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    background-color: #2ecc71;
    color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1001;
    transition: var(--transition);
}

/* Style pour les bannières de notification */
.notification.success {
    background: var(--green-gradient);
}

.notification.error {
    background: var(--red-gradient);
}

.notification.info {
    background: var(--secondary-gradient);
}

#file-upload {
    display: none;
}

.register-banner {
    background: var(--light-gradient);
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.register-banner p {
    margin-bottom: 10px;
}

.register-banner .btn {
    display: inline-block;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 40%;
    }
    
    .main-content {
        height: 60%;
    }
}