/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Navigation par onglets */
.tabs {
    display: flex;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background-color: #f8f9fa;
}

.tab-button.active {
    background-color: #667eea;
    color: white;
    border-bottom-color: #4c63d2;
}

.tab-button i {
    margin-right: 8px;
}

/* Contenu des onglets */
.tab-content {
    display: none;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    min-height: 500px;
}

.tab-content.active {
    display: block;
}

/* En-têtes de section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.section-header h2 {
    color: #333;
    font-size: 1.8em;
    font-weight: 300;
}

/* Boutons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5a6fd8;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Groupe de boutons de téléchargement */
.download-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.download-group .btn {
    margin: 0;
}

/* Formulaires */
.form-container {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.form-container h3 {
    margin-bottom: 25px;
    color: #495057;
    font-weight: 400;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Listes */
.list-container {
    margin-top: 20px;
}

.association-item,
.statuts-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.association-item:hover,
.statuts-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.association-header,
.statuts-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.association-title,
.statuts-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.association-meta,
.statuts-meta {
    color: #6c757d;
    font-size: 0.9em;
}

.association-actions,
.statuts-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.association-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.association-details p {
    margin-bottom: 8px;
}

.association-details strong {
    color: #495057;
}

/* Badges de statut */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
}

.status-brouillon {
    background-color: #ffc107;
    color: #212529;
}

.status-en_revision {
    background-color: #17a2b8;
    color: white;
}

.status-approuve {
    background-color: #28a745;
    color: white;
}

.status-archive {
    background-color: #6c757d;
    color: white;
}

/* Version badge */
.version-badge {
    background-color: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

/* Messages */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1em;
}

.loading i {
    margin-right: 10px;
}

.info-message {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.info-message i {
    margin-right: 10px;
    font-size: 1.2em;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.warning {
    background-color: #ffc107;
    color: #212529;
}

.notification.info {
    background-color: #17a2b8;
}

/* Select personnalisé */
#association-select {
    min-width: 300px;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1em;
    background-color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .association-header,
    .statuts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .association-actions,
    .statuts-actions {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.association-item,
.statuts-item {
    animation: fadeIn 0.5s ease;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Styles pour le modal de signature */
.signature-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.signature-modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.signature-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.signature-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.signature-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.signature-close:hover {
    opacity: 1;
}

.signature-modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.signature-modal-footer {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #dee2e6;
}

.signature-options {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.signature-section {
    margin-bottom: 30px;
}

.signature-section h4 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.signature-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.signature-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.signature-tab:hover {
    color: #495057;
    background-color: #f8f9fa;
}

.signature-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: #f8f9fa;
}

.signature-tab-content {
    display: none;
    padding: 20px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
}

.signature-tab-content.active {
    display: block;
}

#signature-canvas {
    display: block;
    margin: 0 auto;
    cursor: crosshair;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.signature-controls {
    text-align: center;
    margin-top: 15px;
}

#signature-upload input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#signature-upload input[type="file"]:hover {
    border-color: #667eea;
}

#signature-preview {
    margin-top: 15px;
    text-align: center;
}

#signature-text input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-family: 'Brush Script MT', cursive;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
}

#signature-text-preview {
    margin-top: 15px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-family: 'Brush Script MT', cursive;
    font-size: 24px;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signatures-list-section {
    margin-top: 30px;
}

.signatures-list-section h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

#signatures-list {
    max-height: 200px;
    overflow-y: auto;
}

.signature-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    animation: slideInRight 0.3s ease-out;
}

.signature-info {
    flex-grow: 1;
}

.signature-info strong {
    display: block;
    color: #495057;
    font-size: 16px;
}

.signature-role {
    display: block;
    color: #6c757d;
    font-size: 14px;
    font-style: italic;
    margin-top: 2px;
}

.signature-date {
    display: block;
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
}

.no-signatures {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive design pour le modal */
@media (max-width: 768px) {
    .signature-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .signature-modal-body {
        padding: 20px;
    }
    
    .signature-tabs {
        flex-direction: column;
    }
    
    .signature-tab {
        border-bottom: 1px solid #dee2e6;
        border-right: none;
    }
    
    .signature-tab.active {
        border-bottom-color: #dee2e6;
        border-left: 4px solid #667eea;
    }
    
    #signature-canvas {
        width: 100%;
        height: auto;
    }
    
    .signature-modal-footer {
        flex-direction: column;
    }
    
    .signature-modal-footer .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Style pour les boutons dans le modal */
.signature-modal .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.signature-modal .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
