/* ==================== NOTES DE FORMATION ==================== */

/* Conteneur principal */
.notes-container {
    display: flex;
    height: calc(100vh - 80px);
    gap: 0;
    background-color: #f5f7fa;
}

/* ==================== SIDEBAR (CATÉGORIES) ==================== */

.notes-sidebar {
    width: 280px;
    background-color: #ffffff;
    border-right: 2px solid #e1e8ed;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 2px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.add-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.add-btn:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

.categories-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-item:hover {
    background-color: #e9ecef;
    border-color: #3498db;
}

.category-item.active {
    background-color: #3498db;
    color: white;
    border-color: #2980b9;
}

.category-item.active .category-name {
    color: white;
    font-weight: 600;
}

.category-content {
    flex: 1;
    display: flex;
    align-items: center;
}

.category-name {
    color: #2c3e50;
    font-size: 1rem;
}

.category-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.category-item:hover .category-actions,
.category-item.active .category-actions {
    opacity: 1;
}

.edit-category-btn,
.delete-category-btn {
    width: 28px;
    height: 28px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.edit-category-btn:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.delete-category-btn:hover {
    background-color: rgba(231, 76, 60, 0.2);
}

.category-item.active .edit-category-btn:hover,
.category-item.active .delete-category-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ==================== ZONE PRINCIPALE (NOTES) ==================== */

.notes-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-header {
    padding: 20px 30px;
    border-bottom: 2px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
}

.notes-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #2c3e50;
}

.add-note-btn {
    padding: 10px 20px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.add-note-btn:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    align-content: start;
}

/* ==================== CARTES DE NOTES ==================== */

.note-card {
    background-color: white;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.note-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.note-title {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
    flex: 1;
    word-wrap: break-word;
}

.note-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.note-card:hover .note-actions {
    opacity: 1;
}

.preview-note-btn,
.edit-note-btn,
.delete-note-btn {
    width: 30px;
    height: 30px;
    border: none;
    background-color: #f8f9fa;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.preview-note-btn:hover {
    background-color: #3498db;
    transform: scale(1.1);
}

.edit-note-btn:hover {
    background-color: #f39c12;
    transform: scale(1.1);
}

.delete-note-btn:hover {
    background-color: #e74c3c;
    transform: scale(1.1);
}

.note-preview {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e1e8ed;
}

.note-date {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* ==================== MODALS ==================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e1e8ed;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background-color: #f8f9fa;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: #e74c3c;
    color: white;
}

.modal-body {
    padding: 25px;
}

.modal-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: #3498db;
}

.modal-textarea {
    width: 100%;
    min-height: 300px;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.modal-textarea:focus {
    outline: none;
    border-color: #3498db;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 2px solid #e1e8ed;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* ==================== MODAL DE PRÉVISUALISATION ==================== */

.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.preview-modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e1e8ed;
}

.preview-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50;
}

.preview-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.note-preview-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #2c3e50;
}

/* ==================== ÉTAT VIDE ==================== */

.empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #7f8c8d;
    font-size: 1.1rem;
}

.empty-state p {
    text-align: center;
    padding: 20px;
}

/* ==================== NOTIFICATIONS ==================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    font-size: 1rem;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #27ae60;
    color: #27ae60;
}

.notification-error {
    border-left: 4px solid #e74c3c;
    color: #e74c3c;
}

.notification-info {
    border-left: 4px solid #3498db;
    color: #3498db;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .notes-container {
        flex-direction: column;
    }

    .notes-sidebar {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 2px solid #e1e8ed;
    }

    .notes-list {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .modal-content {
        width: 95%;
        max-width: none;
    }

    .modal-large {
        max-width: none;
    }
}
