/* Styles généraux pour l'administration */
:root {
    --primary-color: #254363;
    --primary-hover: #1a3249;
    --secondary-color: #4DD0E1;
    --light-gray: #f5f5f5;
    --dark-gray: #4d4d4d;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
}

body {
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Styles pour la page de connexion */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f7fa;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 100px;
    margin-bottom: 20px;
}

.login-header h1 {
    font-family: 'Gentium Book Basic', serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--primary-color);
    margin: 0;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Styles pour l'interface d'administration */
.admin-header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    margin-bottom: 30px;
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-logo {
    width: 60px;
}

.admin-title {
    font-family: 'Gentium Book Basic', serif;
    margin: 0;
    font-size: 22px;
    color: var(--primary-color);
}

.admin-nav {
    display: flex;
    gap: 20px;
}

/* Styles pour les boutons */
.btn {
    display: inline-block;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

/* Styles pour les alertes */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-danger {
    background-color: #fdecea;
    border: 1px solid #f8c9c4;
    color: var(--danger-color);
}

.alert-success {
    background-color: #e8f8f5;
    border: 1px solid #d1f2eb;
    color: var(--success-color);
}

/* Styles pour le gestionnaire de timeline */
.timeline-manager {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.timeline-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.timeline-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-item {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.item-title {
    font-weight: 700;
    font-size: 18px;
    margin: 0;
}

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

.item-content {
    line-height: 1.6;
}

/* Styles pour le formulaire d'édition */
.edit-form {
    margin-top: 20px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.form-row input,
.form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-row textarea {
    min-height: 150px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Styles pour le drag-and-drop */
.draggable {
    cursor: grab;
}

.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.drop-zone {
    border: 2px dashed #ddd;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    background-color: #f9f9f9;
}


/* Améliorations pour le drag and drop */
.draggable {
    cursor: grab;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.draggable:hover {
    background-color: #f5f5f5;
}

.draggable:before {
    content: '☰';
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

.dragging {
    cursor: grabbing !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    background-color: #f9f9f9 !important;
}

.drop-zone {
    border: 2px dashed #4DD0E1 !important;
    background-color: #e1f5fe !important;
}

/* Améliorations pour les boutons d'édition et de suppression */
.item-actions {
    display: flex;
    gap: 10px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.timeline-item:hover .item-actions {
    opacity: 1;
}

.btn-secondary, .btn-danger {
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-secondary:hover, .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active, .btn-danger:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Amélioration de la visibilité du formulaire d'édition */
.edit-form {
    background-color: #f5f7fa;
    border: 1px solid #e6e9ed;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.edit-form:focus-within {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-nav {
        margin-top: 15px;
    }
    
    .timeline-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Ajustements supplémentaires pour les écrans très petits (320px et moins) */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .timeline-manager {
        padding: 15px 10px;
    }
    
    .admin-branding {
        flex-direction: column;
    }
    
    .admin-title {
        font-size: 18px;
        margin-top: 5px;
    }
    
    .admin-logo {
        width: 50px;
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-title {
        margin-bottom: 10px;
        font-size: 16px;
        word-break: break-word;
    }
    
    .item-actions {
        width: 100%;
    }
    
    .item-actions .btn-small {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* Prévenir les débordements de texte */
    .item-content {
        word-break: break-word;
        font-size: 14px;
    }
    
    /* Réduire la taille du formulaire */
    .form-row label {
        font-size: 14px;
    }
    
    .form-row input,
    .form-row textarea {
        padding: 8px;
        font-size: 14px;
    }
    
    .draggable:before {
        left: -15px;
        font-size: 14px;
    }
    
    /* Ajuster les marges pour les formulaires */
    .edit-form {
        padding: 15px;
    }
}
