/* ==================== STYLES COMMUNS ==================== */
/* assets/css/common.css */

/* Styles pour l'édition */
.editable-content {
    border: 2px dashed transparent;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
    min-height: 20px;
    cursor: pointer;
    position: relative;
}

.editable-content:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.editable-content:after {
    content: "✏️";
    position: absolute;
    top: -10px;
    right: -10px;
    background: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s;
}

.editable-content:hover:after {
    opacity: 1;
}

.editable-content.modified {
    border-color: #ffc107 !important;
    background-color: rgba(255, 193, 7, 0.1) !important;
}

/* Barre d'outils admin */
.admin-toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    gap: 10px;
    border: 1px solid #e0e0e0;
}

.admin-toolbar .btn {
    padding: 8px 15px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

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

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

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

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

.btn-info:hover, .btn-success:hover, .btn-warning:hover, .btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Indicateur de modification */
.edit-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffc107;
    color: #212529;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 9999;
    font-size: 14px;
    display: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 5px;
    z-index: 10002;
    max-width: 80%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
}

.notification-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.notification-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

@keyframes slideIn {
    from { top: -50px; opacity: 0; }
    to { top: 20px; opacity: 1; }
}

/* Mode admin */
body.admin-mode .editable-content[data-field] {
    cursor: pointer;
}

body.admin-mode .editable-content[data-field]:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

/* Styles pour les messages d'erreur */
.alert-error {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #f8d7da;
    color: #721c24;
    padding: 12px 20px;
    border-radius: 5px;
    z-index: 10001;
    border: 1px solid #f5c6cb;
    max-width: 80%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Conteneur principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Liens de retour */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

/* Section d'accueil avec image */
.welcome-section {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    align-items: center;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.welcome-left {
    flex: 1;
}

.welcome-right {
    flex: 1;
}

.welcome-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Titres et texte */
.content h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2rem;
}

.intro-text {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Boîtes en surbrillance */
.highlight-box {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 5px 5px 0;
}

.highlight-box h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.highlight-box p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.highlight-box ul {
    padding-left: 20px;
    margin: 15px 0;
}

.highlight-box li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Cartes */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.card-header i {
    font-size: 1.5rem;
    color: #007bff;
}

.card-header h3 {
    color: #333;
    margin: 0;
    font-size: 1.3rem;
}

.card-body {
    margin-top: 10px;
}

.card-body p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.card-body ul {
    padding-left: 20px;
    margin: 10px 0;
}

.card-body li {
    margin-bottom: 5px;
    color: #666;
}

/* Boutons */
.btn-outline {
    display: inline-block;
    padding: 8px 16px;
    border: 2px solid #007bff;
    background: white;
    color: #007bff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    margin-top: 10px;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
}

/* Boutons d'acquisition */
.btn-acquisition {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 25px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    margin-top: 10px;
}

.btn-acquisition:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4) !important;
}

.btn-acquisition i {
    font-size: 18px !important;
}

/* Options d'acquisition */
.acquisition-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.acquisition-option {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.acquisition-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.acquisition-option h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.acquisition-option p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Styles PDF communs */
.pdf-container {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pdf-toolbar {
    background: linear-gradient(135deg, #2c3e50, #4a607a);
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdf-toolbar-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    margin-left: 8px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-toolbar-btn:hover {
    background: rgba(255,255,255,0.2);
}

.pdf-content {
    background: #f8f9fa;
    padding: 20px;
}

.pdf-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pdf-icon {
    font-size: 48px;
    color: #e74c3c;
    flex-shrink: 0;
}

.pdf-details {
    flex: 1;
}

.pdf-details h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 18px;
}

.pdf-details p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.pdf-preview-container {
    position: relative;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.pdf-iframe {
    width: 100%;
    height: 500px;
    border: none;
    display: block;
}

.pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    color: #666;
    z-index: 10;
}

.pdf-loading i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #3498db;
}

.pdf-actions {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.pdf-download-btn {
    display: inline-block;
    padding: 10px 25px;
    background: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.pdf-download-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

/* Liens de fichiers */
.file-link-container {
    margin: 15px 0;
    padding: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
}

.file-link-container:hover {
    border-color: #3498db;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.1);
}

.file-link {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s;
}

.file-link:hover {
    color: #3498db;
}

.file-link i {
    font-size: 24px;
    color: #3498db;
}

.file-link-text {
    flex: 1;
}

.file-link-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
}

.file-link-text small {
    font-size: 12px;
    color: #666;
}

/* Styles communs pour le contenu HTML */
.editable-content strong, .editable-content b {
    font-weight: bold !important;
}

.editable-content em, .editable-content i {
    font-style: italic !important;
}

.editable-content u {
    text-decoration: underline !important;
}

.editable-content p {
    margin: 5px 0 !important;
}

/* Progression steps (utilisé dans enseignants.php) */
.progression-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.step {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
}

.step h4 {
    color: #007bff;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.step p {
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* Corpus list (utilisé dans enseignants.php) */
.corpus-list {
    margin: 20px 0;
}

.corpus-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.corpus-item h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.corpus-item p {
    margin: 5px 0;
    color: #666;
    line-height: 1.5;
}

/* Text center */
.text-center {
    text-align: center;
}

/* DEBUG overlay */
.debug-overlay {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(255,255,255,0.9);
    padding: 10px;
    border: 2px solid red;
    z-index: 99999;
    font-size: 12px;
    max-width: 300px;
    display: none;
}

/* Responsive commun */
@media (max-width: 768px) {
    .admin-toolbar {
        top: 10px;
        right: 10px;
        left: 10px;
        flex-direction: column;
    }
    
    .welcome-section {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .welcome-image {
        max-height: 300px;
        object-fit: cover;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .acquisition-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .acquisition-option {
        padding: 20px;
    }
    
    .progression-steps {
        grid-template-columns: 1fr;
    }
    
    .edit-indicator {
        bottom: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
    
    .container {
        padding: 15px;
    }
    
    .notification {
        top: 10px;
        width: 95%;
    }
    
    .pdf-iframe {
        height: 300px;
    }
    
    .pdf-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .debug-overlay {
        max-width: 200px;
        font-size: 10px;
    }
}

/* Styles spécifiques pour les petits écrans */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .admin-toolbar .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .welcome-section {
        padding: 15px;
    }
    
    .highlight-box {
        padding: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .btn-acquisition {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
}