/* style.css - Styles principaux de la formation */

/* Variables et reset */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #e53e3e;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --border: #e2e8f0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.main-header h1 {
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

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

.btn-print {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 10px;
}

/* Navigation jours */
.jour-nav {
    background: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 70px;
    z-index: 99;
}

.jour-buttons {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.jour-btn {
    padding: 10px 25px;
    border: none;
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.jour-btn:hover {
    background: var(--border);
}

.jour-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

/* Container principal */
.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Cartes */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h2 {
    color: var(--primary);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
}

.card h3 {
    color: var(--secondary);
    margin: 20px 0 15px 0;
}

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: left;
}

th {
    background: var(--bg-light);
    font-weight: bold;
    color: var(--text-dark);
}

/* Exercices */
.exercice {
    background: linear-gradient(135deg, #fef5e7 0%, #fff9f0 100%);
    border-left: 4px solid var(--warning);
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
}

.exercice h4 {
    color: var(--warning);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.note-input {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin: 10px 0;
    transition: border-color 0.3s;
}

.note-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Engagement */
.engagement {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
}

.engagement h3 {
    color: white;
    margin-top: 0;
}

.engagement input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: none;
    border-radius: 8px;
}

.signature-line {
    border-top: 1px dashed rgba(255, 255, 255, 0.3);
    margin-top: 20px;
    padding-top: 20px;
}

/* Messages d'alerte */
.alert-success {
    background: #c6f6d5;
    color: #22543d;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--success);
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--danger);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jour-content {
    display: none;
    animation: fadeIn 0.5s;
}

.jour-content.active {
    display: block;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 30px;
    margin-top: 50px;
}

.footer .verse {
    font-style: italic;
    margin-top: 10px;
    color: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        padding: 20px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px;
    }
    
    .jour-buttons {
        justify-content: center;
    }
    
    .jour-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .main-header h1 {
        font-size: 1.2rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Styles pour l'impression */
@media print {
    .main-header,
    .jour-nav,
    .btn-save,
    .btn-logout,
    .user-info,
    .btn-print,
    .footer {
        display: none;
    }
    
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .note-input {
        border: 1px solid #ddd;
        min-height: 80px;
        background: #f9f9f9;
    }
    
    .exercice {
        background: #f9f9f9;
    }
    
    body {
        background: white;
    }
    
    .container {
        margin: 20px auto;
    }
}

/* Dashboard Enseignant */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.panel h2 {
    color: var(--primary);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.etudiant-list {
    max-height: 500px;
    overflow-y: auto;
}

.etudiant-item {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.etudiant-item:hover {
    background: var(--bg-light);
}

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

.status-active {
    background: #c6f6d5;
    color: #22543d;
}

.status-inactive {
    background: #fed7d7;
    color: #c53030;
}

.reponse-card {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary);
}

.reponse-question {
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.reponse-text {
    color: var(--text-dark);
    line-height: 1.6;
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}