/* ========================================
   STYLES GÉNÉRAUX
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* ========================================
   HEADER
   ======================================== */

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

/* ========================================
   NAVIGATION
   ======================================== */

nav {
    background: white;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

nav a {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    background: #764ba2;
}

nav a.active {
    background: #764ba2;
}

/* ========================================
   GRILLE PRINCIPALE
   ======================================== */

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

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   CARTES / SECTIONS
   ======================================== */

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.card h3 {
    color: #764ba2;
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 1.2em;
}

/* ========================================
   FORMULAIRES
   ======================================== */

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

select, input[type="text"], input[type="email"], textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ========================================
   BOUTONS
   ======================================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

.btn-warning {
    background: #ed8936;
    color: white;
}

.btn-warning:hover {
    background: #dd6b20;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.4);
}

.btn-secondary {
    background: #cbd5e0;
    color: #333;
}

.btn-secondary:hover {
    background: #a0aec0;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-group .btn {
    flex: 1;
    min-width: 120px;
}

/* ========================================
   ALERTES ET MESSAGES
   ======================================== */

.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-color: #48bb78;
}

.alert-danger {
    background: #fed7d7;
    color: #742a2a;
    border-color: #f56565;
}

.alert-warning {
    background: #feebc8;
    color: #7c2d12;
    border-color: #ed8936;
}

.alert-info {
    background: #bee3f8;
    color: #2c5282;
    border-color: #4299e1;
}

/* ========================================
   LISTES ET TABLEAUX
   ======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table thead {
    background: #f7fafc;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e2e8f0;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

table tbody tr:hover {
    background: #f7fafc;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions a, .table-actions button {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* ========================================
   LISTES
   ======================================== */

.task-list {
    list-style: none;
}

.task-list li {
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.task-list li:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.task-list li.in-progress {
    background: #e6fffa;
    border-color: #81e6d9;
}

.task-list li.completed {
    background: #f0fff4;
    border-color: #9ae6b4;
}

.task-info {
    flex: 1;
}

.task-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.task-category {
    font-size: 0.9em;
    color: #666;
}

.task-time {
    font-size: 0.9em;
    color: #999;
    margin-top: 5px;
}

/* ========================================
   BADGES ET TAGS
   ======================================== */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-primary {
    background: #bee3f8;
    color: #2c5282;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}

.badge-warning {
    background: #feebc8;
    color: #7c2d12;
}

.badge-info {
    background: #e6fffa;
    color: #234e52;
}

/* ========================================
   MODALES
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #667eea;
    margin: 0;
}

.modal-body {
    margin-bottom: 20px;
}

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

.close-modal {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    float: right;
}

.close-modal:hover {
    color: #333;
}

/* ========================================
   STATISTIQUES
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    nav {
        flex-direction: column;
    }
    
    nav a {
        width: 100%;
        text-align: center;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    table {
        font-size: 0.9em;
    }
    
    table th, table td {
        padding: 8px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: slideIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.task-list li.in-progress {
    animation: pulse 2s infinite;
}
