/* styles.css */

/* Variables globales */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
}

/* Styles généraux */
body {
    font-family: 'Poppins', sans-serif; /* Priorité à Poppins (index.php) */
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); /* index.php */
    min-height: 100vh; /* index.php */
}

.container {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.editor {
    min-height: 700px;
    max-height: 800px; /* Ajouté précédemment pour la barre de défilement */
    overflow-y: auto; /* Ajouté précédemment pour la barre de défilement */
    border: 1px solid #e2e8f0;
    border-radius: 12px; /* index.php */
    padding: 16px; /* index.php */
    margin: 16px; /* index.php */
    outline: none;
    width: 95%;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.6;
    background-color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* index.php */
    transition: all 0.3s ease; /* index.php */
}

.editor:focus {
    border-color: var(--primary); /* index.php */
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); /* index.php */
}

.editor:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
}

/* Barre d'outils stylisée */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px; /* index.php */
    background: white; /* index.php */
    border: 0px solid #e5e7eb;
    border-radius: 12px; /* index.php */
    border-bottom-left-radius: 12px; /* Arrondi en bas à gauche */
    border-bottom-right-radius: 12px; /* Arrondi en bas à droite */
    padding: 12px; /* index.php */
    margin-bottom: 16px; /* index.php */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* index.php */
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease; /* index.php */
    backdrop-filter: blur(8px);
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 3px; /* index.php */
    padding: 0 8px; /* index.php */
    border-right: 1px solid #e5e7eb;
    margin: 0;
}

.toolbar-section:last-child {
    border-right: none;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; /* index.php */
    height: 40px; /* index.php */
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #64748b; /* index.php */
    transition: all 0.2s ease; /* index.php */
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.toolbar-btn:hover {
    background: #f1f5f9; /* index.php */
    border-color: #d1d5db;
    transform: translateY(-2px); /* index.php */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); /* index.php */
    color: var(--primary); /* index.php */
}

.toolbar-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.toolbar-btn.active {
    background: var(--primary); /* index.php */
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.toolbar-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: scale(0) translate(-50%, -50%);
    transform-origin: top left;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.toolbar-btn:active::after {
    transform: scale(2.5) translate(-50%, -50%);
    opacity: 1;
    transition: 0s;
}

.emoji-picker, .style-picker {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
    background-color: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: absolute;
    z-index: 1100;
    width: 350px;
    left: -30px;
    top: 100%;
    margin-top: 8px;
    padding: 16px;
    opacity: 0;
    transform: translateY(10px);
    visibility: hidden;
    transition: all 0.2s ease;
}

.style-picker:not(.hidden), .emoji-picker:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.emoji-picker {
    position: fixed;
    z-index: 9999;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid #e5e7eb;
    padding: 12px;
    width: 250px; /* Réduit la largeur pour accommoder 4 colonnes */
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden; /* Empêche le défilement horizontal */
    display: none;
}

.emoji-picker .grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Exactement 4 colonnes */
    gap: 5px;
    width: 80%;
}

.emoji-picker button {
    font-size: 24px;
    padding: 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    width: 30px; /* Taille fixe pour éviter le débordement */
    height: 30px;
}

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

@media (max-width: 767px) {
    .emoji-picker, .style-picker {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 30px);
        max-width: 350px;
    }
    
    .editor-toolbar {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        mask-image: linear-gradient(to right, transparent, black 10px, black 90%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 10px, black 90%, transparent);
    }
    
    .toolbar-section {
        flex-shrink: 0;
    }
    
    .toolbar-btn {
        width: 36px;
        height: 36px;
    }
}

.style-picker .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.style-picker button {
    text-align: left;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.style-picker button:hover {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
}

.style-category {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
    margin-bottom: 16px; /* index.php */
    padding-left: 8px;
    padding-right: 8px;
}

.style-category h3 {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 8px;
    font-weight: 600;
}

.style-sample {
    float: right; /* index.php */
    font-size: 0.9rem;
    color: #6b7280;
}

.emoji-picker {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px; /* index.php */
    padding: 6px;
}

.emoji-picker button {
    font-size: 20px;
    padding: 6px;
    border-radius: 4px; /* index.php */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease; /* index.php */
    text-align: center; /* index.php */
}

.emoji-picker button:hover {
    background: #f1f5f9; /* index.php */
    transform: scale(1.1);
    border-color: #e5e7eb;
}

.emoji-btn {
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    padding: 4px;
    border-radius: 4px;
}

.emoji-btn:hover {
    background: #f1f5f9;
    transform: scale(1.1);
}

.result-box {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    border: 1px dashed #cbd5e1;
    position: relative;
}

.copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
}

.copy-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.gradient-text {
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.floating-btn {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

.card-hover {
    transition: all 0.3s ease;
}

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

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

.facebook { background: #3b5998; color: white; }
.instagram { background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d); color: white; }
.tiktok { background: #000; color: white; }
.twitter { background: #1da1f2; color: white; }

/* Alignement de texte pour l'éditeur */
.editor[data-align="left"] {
    text-align: left;
}

.editor[data-align="center"] {
    text-align: center;
}

.editor[data-align="right"] {
    text-align: right;
}

/* Animation pour le bouton de copie */
@keyframes copySuccess {
    0% { background-color: #3b82f6; color: white; }
    50% { background-color: #10b981; color: white; }
    100% { background-color: #3b82f6; color: white; }
}

.copy-success {
    animation: copySuccess 1.5s ease;
}

/* Style pour le soulignement continu */
.underline-continuous {
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

/* Style pour le bouton mobile */
#copy-btn-mobile {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
}

#copy-btn-mobile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

#copy-btn-mobile:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Assurer que les icônes Font Awesome sont correctement affichées */
.fas, .far, .fab {
    display: inline-block;
    width: auto;
    height: auto;
    line-height: 1;
}
/* Ajoutez ces styles à votre fichier styles.css existant 
   pour corriger l'affichage des menus déroulants */

/* Correction pour les sélecteurs d'émojis et de styles */
.emoji-picker, .style-picker {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
    background-color: white;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: absolute;
    z-index: 9999;
    width: 200px;
    left: -30px;
    top: 100%;
    margin-top: 8px;
    padding: 12px;
    transition: all 0.2s ease;
}


/* Assurer que .hidden fonctionne correctement */
.hidden {
    display: none !important;
}

/* Style amélioré pour les boutons dans le sélecteur d'émojis */
.emoji-picker .grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 6px;
}

.emoji-picker button {
    font-size: 20px;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.emoji-picker button:hover {
    background: #f1f5f9;
    transform: scale(1.1);
    border-color: #e5e7eb;
}

/* Style amélioré pour les boutons dans le sélecteur de styles */
.style-picker .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.style-picker button {
    cursor: pointer;
}

/* Assurer la compatibilité mobile */
@media (max-width: 767px) {
    .emoji-picker, .style-picker {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 30px);
        max-width: 350px;
    }
    
    .emoji-picker .grid {
        grid-template-columns: repeat(6, 1fr);
    }
}