/* Thème Médical / Épuré */
:root {
    --primary-color: #0ea5e9; /* Bleu clair médical */
    --primary-hover: #0284c7;
    --success-color: #10b981;
    --success-hover: #059669;
    --bg-color: #f8fafc; /* Gris très doux */
    --surface-color: #ffffff; /* Blanc pour les cartes */
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius: 12px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.app-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

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

.app-header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

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

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

.btn-success:hover:not(:disabled) {
    background-color: var(--success-hover);
}

/* Styles pour la liste de révisions */
.revision-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
}

.revision-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.badge {
    background-color: var(--bg-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: bold;
    font-size: 1.1rem;
    border: 1px solid var(--border-color);
}

.badge-late {
    background-color: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

.delay-label {
    background-color: #fee2e2;
    color: #b91c1c;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

/* Modale */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.modal {
    width: 100%;
    max-width: 500px;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.modal-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
}

.app-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 3rem;
}

/* Responsive Design pour Mobile */
@media (max-width: 600px) {
    .app-header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-link {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    /* Dashboard Header (Titre + Bouton Nouveau Cours) */
    .dashboard-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem;
    }
    
    .dashboard-header button {
        width: 100%;
    }

    /* Carte de révision */
    .revision-card {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .revision-info {
        margin-bottom: 0.5rem;
    }

    .revision-card button {
        width: 100%;
    }

    /* Carte de cours (Tous les cours) */
    .course-card > div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .course-card > div:first-child > div:last-child {
        align-items: flex-start !important;
        width: 100%;
    }
    
    .course-card .btn-sm {
        flex: 1;
        text-align: center;
    }
    
    .modal-overlay {
        padding: 1rem;
    }
}
