/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Gestion des pages */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Page de connexion */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #002b6c, #004494);
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 350px;
}

.login-logo {
    max-width: 200px;
    margin-bottom: 30px;
}

.login-form h1 {
    color: #002b6c;
    margin-bottom: 30px;
}

/* Dashboard */
.dashboard-header {
    background: #002b6c;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-logo {
    max-height: 40px;
}

.dashboard-header h1 {
    margin: 0;
}

.logout-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #ff5252;
}

.dashboard-content {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-actions {
    margin-bottom: 30px;
    text-align: right;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.project-card h3 {
    color: #002b6c;
    margin-bottom: 10px;
}

.project-card p {
    color: #666;
    margin-bottom: 15px;
}

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

.project-class {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
}

.project-class.safe {
    background: #4CAF50;
    color: white;
}

.project-class.half-way {
    background: #FF9800;
    color: white;
}

.project-class.agressif {
    background: #F44336;
    color: white;
}

/* Formulaire */
.form-header {
    background: #002b6c;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-container {
    padding: 30px;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
}

.form-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.form-section {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
}

.form-section h3 {
    color: #002b6c;
    margin-bottom: 20px;
    border-bottom: 2px solid #feb621;
    padding-bottom: 10px;
}

/* Boutons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary { background: #002b6c; color: white; }
.btn-primary:hover { background: #004494; }

.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }

.btn-success { background: #28a745; color: white; }
.btn-success:hover { background: #218838; }

.btn-info { background: #17a2b8; color: white; }
.btn-info:hover { background: #138496; }

.btn-warning { background: #ffc107; color: #212529; }
.btn-warning:hover { background: #e0a800; }

.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; }

.btn-small { padding: 8px 16px; font-size: 12px; }

/* Formulaires */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #feb621;
}

.form-actions {
    text-align: right;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-actions .btn { margin-left: 10px; }

/* Preview */
.preview-container {
    margin-top: 30px;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
}
#previewContent { background: white; }

/* Messages de statut */
.status-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
}
.status-message.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.status-message.warning { background-color: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
.status-message.info { background-color: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Messages d'erreur */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
    border: 1px solid #f5c6cb;
}

/* Styles pour le dashboard amélioré */
.header-actions { display: flex; align-items: center; gap: 15px; }
.welcome-text { font-weight: 500; color: #feb621; }

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card h3 { font-size: 2.5rem; color: #002b6c; margin-bottom: 10px; font-weight: bold; }
.stat-card p { color: #666; font-size: 0.9rem; font-weight: 500; }

.projects-section h2 { color: #002b6c; margin-bottom: 20px; font-size: 1.8rem; }
.projects-filter { display: flex; gap: 15px; margin-bottom: 30px; }
.projects-filter select, .projects-filter input {
    padding: 10px; border: 2px solid #ddd; border-radius: 5px; font-size: 14px;
}
.projects-filter select { min-width: 200px; }
.projects-filter input { flex: 1; max-width: 300px; }

/* Amélioration des cartes de projet */
.project-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.project-info p { margin-bottom: 8px; color: #555; }
.project-date { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eee; }
.project-date small { color: #999; }

/* Pas de projets */
.no-projects { grid-column: 1 / -1; text-align: center; padding: 60px 20px; }
.no-projects-content {
    background: white; padding: 40px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 500px; margin: 0 auto;
}
.no-projects-content h3 { color: #002b6c; margin-bottom: 15px; font-size: 1.5rem; }
.no-projects-content p { color: #666; margin-bottom: 25px; }

/* Modal de confirmation */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 1000;
}
.modal-content {
    background: white; padding: 30px; border-radius: 10px; text-align: center;
    max-width: 400px; width: 90%; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-content h3 { color: #002b6c; margin-bottom: 20px; }
.modal-content p { color: #555; margin-bottom: 25px; line-height: 1.6; }
.modal-actions { display: flex; gap: 15px; justify-content: center; }

/* Aperçu amélioré */
.preview-container {
    margin-top: 40px; border: 2px solid #ddd; border-radius: 10px; overflow: hidden;
    background: white; box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.preview-header { background: #002b6c; color: white; padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.preview-header h2 { margin: 0; font-size: 1.3rem; }
.preview-content { background: white; overflow-x: auto; }

/* Améliorations du formulaire */
.form-section h3 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.form-group small { display: block; color: #666; font-size: 0.85rem; margin-top: 5px; line-height: 1.4; }
.form-group label { display: flex; align-items: center; gap: 5px; }

/* Validation visuelle */
.form-group input:invalid { border-color: #dc3545; }
.form-group input:valid { border-color: #28a745; }

/* Responsive amélioré */
@media (max-width: 768px) {
    .form-sections { grid-template-columns: 1fr; gap: 20px; }
    .projects-grid { grid-template-columns: 1fr; }
    .dashboard-header, .form-header { flex-direction: column; gap: 15px; text-align: center; }
    .header-actions { width: 100%; justify-content: center; }
    .projects-filter { flex-direction: column; }
    .projects-filter input { max-width: none; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .modal-content { width: 95%; padding: 20px; }
    .preview-header { flex-direction: column; gap: 15px; text-align: center; }
}

@media (max-width: 480px) {
    .dashboard-stats { grid-template-columns: 1fr; }
    .project-actions { flex-direction: column; gap: 8px; }
    .btn-small { width: 100%; justify-content: center; }
}
