/**
 * ============================================================================
 * STYLES CSS - CONVERTEUR PDF
 * ============================================================================
 * 
 * Description : Feuille de styles pour l'application Convertisseur PDF
 * Auteur : Gehan16
 * 
 * Structure:
 *   1. Reset et styles de base
 *   2. Layout et conteneurs
 *   3. Composants spécifiques (boutons, zones de dépôt, etc.)
 *   4. Éditeur Quill
 *   5. Responsive design
 * 
 * ============================================================================
 */


/* ============================================================================
 * SECTION 1 : RESET ET STYLES DE BASE
 * ============================================================================
 * 
 * Remet à zéro les styles par défaut du navigateur
 * et définit les styles globaux de l'application.
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}


/* ============================================================================
 * SECTION 2 : LAYOUT ET CONTAINERS
 * ============================================================================
 */

/* Conteneur principal de l'application */
.main-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* Contenu principal (zone centrale) */
.content {
    flex: 1;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* Sidebar (colonne de droite) */
.sidebar {
    width: 280px;
    background-color: transparent;
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
}


/* ============================================================================
 * SECTION 3 : HEADER
 * ============================================================================
 */

/* Conteneur du header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 28px;
}

.header p {
    color: #6c757d;
    font-size: 16px;
}


/* ============================================================================
 * SECTION 4 : SECTIONS ET TITRES
 * ============================================================================
 */

/* Style des sections principales */
.section {
    margin-bottom: 40px;
    padding-bottom: 20px;
}

.section:last-child {
    margin-bottom: 0;
}

/* Titre des sections */
.section-title {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 20px;
}


/* ============================================================================
 * SECTION 5 : ÉLÉMENTS DE FORMULAIRE (pour compatibilité)
 * ============================================================================
 */

textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    margin-bottom: 15px;
    font-family: 'Inter', sans-serif;
}


/* ============================================================================
 * SECTION 6 : BOUTONS
 * ============================================================================
 */

/* Groupe de boutons (conteneur flex) */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* Style de base des boutons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Bouton désactivé */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Bouton primaire (action principale) */
.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #0069d9;
}

/* Bouton succès */
.btn-success {
    background-color: #28a745;
    color: white;
}

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

/* Bouton avertissement */
.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover:not(:disabled) {
    background-color: #e0a800;
}

/* Bouton secondaire */
.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}


/* ============================================================================
 * SECTION 7 : ZONES DE DÉPÔT (DRAG & DROP)
 * ============================================================================
 */

/* Style de base des zones de dépôt */
.drop-zone {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin: 15px 0;
    background-color: #f8f9fa;
}

/* Effet au survol */
.drop-zone:hover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

/* Effet pendant le drag over */
.drop-zone.dragover {
    border-color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

/* Icône dans la zone de dépôt */
.drop-zone i {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
    color: #6c757d;
}

.drop-zone p {
    color: #6c757d;
    font-size: 16px;
}


/* ============================================================================
 * SECTION 8 : CONTAINER DE FICHIERS (MINIATURES)
 * ============================================================================
 */

/* Conteneur des fichiers sélectionnés */
.file-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}

/* Wrapper pour chaque fichier */
.file-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Image dans le wrapper */
.file-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bouton de suppression */
.remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.remove-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Icône PDF pour les miniatures */
.pdf-icon {
    width: 100%;
    height: 60px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    color: #e74c3c;
}

/* Nom du fichier */
.file-name {
    text-align: center;
    font-size: 12px;
    padding: 5px;
    background-color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ============================================================================
 * SECTION 9 : MESSAGES D'ERREUR
 * ============================================================================
 */

.error-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    display: none;
}

.error-message.show {
    display: block;
}


/* ============================================================================
 * SECTION 10 : CONTRÔLES DE MARGES
 * ============================================================================
 */

.margin-controls {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.margin-controls h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #495057;
}

.margin-note {
    font-size: 12px;
    color: #6c757d;
    margin-top: 0;
    margin-bottom: 10px;
}

.margin-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.margin-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.margin-input label {
    font-size: 14px;
    color: #6c757d;
    min-width: 60px;
}

.margin-input input {
    width: 70px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

/* Option d'étirement des images */
.stretch-option {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.stretch-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
}

.stretch-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}


/* ============================================================================
 * SECTION 11 : SIDEBAR ET CARTES
 * ============================================================================
 */

/* Style des cartes dans la sidebar */
.card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.card h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 10px;
}

.card p {
    color: #495057;
    font-size: 14px;
    line-height: 1.6;
}

/* Widget Ko-fi */
.ko-fi-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}


/* ============================================================================
 * SECTION 12 : LOGO
 * ============================================================================
 */

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    width: 100%;
    background-color: transparent;
}

.logo {
    max-width: 96px;  /* Taille augmentée de 20% par rapport à 80px */
    height: auto;
    background-color: transparent;
}


/* ============================================================================
 * SECTION 13 : ÉDITEUR QUILL
 * ============================================================================
 */

/* Conteneur de l'éditeur Quill */
.quill-editor {
    width: 100%;
    min-height: 150px;
    margin-bottom: 15px;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 8px;
}

.quill-editor .ql-container {
    min-height: 150px;
    border: none;
}

.quill-editor .ql-toolbar {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid #ced4da;
}

.quill-editor .ql-container {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
}


/* ============================================================================
 * SECTION 14 : RESPONSIVE DESIGN
 * ============================================================================
 * 
 * Adaptation de la mise en page pour les écrans mobiles
 */

@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
    }

    .content {
        width: 100%;
    }

    .sidebar {
        width: 100%;
        order: 1;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}


/* ============================================================================
 * SECTION 15 : STYLES DIVERS
 * ============================================================================
 */

/* Style pour les boutons petits (si besoin) */
.btn-small {
    padding: 5px 10px;
    font-size: 14px;
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Sélecteur de couleur */
.color-picker {
    width: 30px;
    height: 30px;
    padding: 2px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}
