@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');


/* ==========================================================
   UTILITAIRES GLOBAUX
========================================================== */
/* Applique cette classe au <body> des pages de type "Application" (Messages, Groupes) */
.app-mode-locked {
    height: 100vh !important;
    overflow-y: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}
:root {
    --primary-color: #d10000;
    --background-light: #f4f7f6;
    --card-background: #ffffff;
    --text-color: #333;
    --gray-text: #777;
    --box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    --border-radius: 15px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-light);
    color: var(--text-color);
}

/* =================================================================
   COMPOSANTS GLOBAUX (Boutons, Modales, Badges, Animations)
================================================================= */

/* --- Splash Screen --- */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
}
.splash-screen.hidden { opacity: 0; visibility: hidden; }
.splash-logo {
    width: 80px; height: 80px; border-radius: 15px;
    animation: pulseSplash 1.5s infinite ease-in-out;
}
.splash-footer { position: absolute; bottom: 40px; text-align: center; color: #888; font-size: 0.9rem; line-height: 1.4; }
.splash-brand { background: linear-gradient(45deg, #d10000, #ff4d4d); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 600; font-size: 1.1rem; }

/* --- Boutons d'action standards (Juicy UI) --- */
.btn-juicy-grey {
    background: #f0f2f5; color: #555; border: none; padding: 10px 20px; border-radius: 20px; font-weight: 600; cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-juicy-grey:hover { background: #e4e6eb; color: #333; transform: scale(1.05); }
.btn-juicy-grey:active { transform: scale(0.95); opacity: 0.8; }

.btn-juicy-red, .btn-modal.delete {
    background: #d10000; color: white; border: none; padding: 10px 20px; border-radius: 20px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 10px rgba(209, 0, 0, 0.3); transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-juicy-red:hover, .btn-modal.delete:hover { background: #ff0000; transform: scale(1.1); box-shadow: 0 6px 15px rgba(209, 0, 0, 0.4); }
.btn-juicy-red:active, .btn-modal.delete:active { transform: scale(0.9); opacity: 0.9; }

.btn-modal.cancel { background: #f0f2f5; color: #555; }
.btn-modal.cancel:hover { background: #e4e6eb; transform: scale(1.05); color: #333; }

.close-btn-juicy {
    cursor: pointer; font-size: 1.8rem; color: #aaa; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; align-items: center; justify-content: center; width: 35px; height: 35px; border-radius: 50%;
}
.close-btn-juicy:hover { color: #d10000; background: #fff5f5; transform: rotate(90deg) scale(1.1); }

/* --- Options Post (Juicy UI) --- */
.option-btn {
    cursor: pointer; display: inline-flex !important; align-items: center !important; justify-content: center; gap: 6px;
    padding: 0 14px; border-radius: 20px; font-size: 0.85em; font-weight: 500; height: 32px;
    background: #f5f5f5; color: #666 !important; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.option-btn i { font-size: 1.2rem; display: flex; align-items: center; position: relative; pointer-events: none; }
.option-btn:hover { background: #fff5f5 !important; color: #d10000 !important; transform: scale(1.05); }
.option-btn:hover i { color: #d10000 !important; transform: scale(1.15) rotate(-5deg); }
.option-btn.active { background: #d10000 !important; color: white !important; }
.option-btn.active i { color: white !important; }

/* --- Avatars --- */
.user-avatar {
    width: 45px; height: 45px; border-radius: 50%; background-color: #333; background-size: cover; background-position: center;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    text-decoration: none !important; color: white !important; font-size: 1.2rem; text-transform: uppercase; font-weight: 600;
    flex-shrink: 0; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.user-avatar:hover { transform: scale(1.15) rotate(3deg); z-index: 5; }
.user-avatar.sm { width: 30px; height: 30px; font-size: 0.8em; }

/* --- Badges --- */
.badge-tier {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 14px;
    font-size: 0.85em; font-weight: 600; font-family: 'Poppins', sans-serif; cursor: default; white-space: nowrap;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.badge-tier:hover { transform: scale(1.05); }
.badge-bronze { background: linear-gradient(135deg, #c76a22, #8c4109) !important; color: white !important; border: 1px solid #a85213 !important; box-shadow: 0 2px 4px rgba(140, 65, 9, 0.3); text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.badge-silver { background: linear-gradient(135deg, #e6e9f0 0%, #eef1f5 100%); color: #333; border: 1px solid #b0b8c4; box-shadow: inset 0 0 10px rgba(255,255,255,0.8), 0 2px 4px rgba(0,0,0,0.05); position: relative; overflow: hidden; }
.badge-silver::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%); transform: rotate(30deg); animation: silverBadgeShine 3s infinite linear; }
.badge-gold { background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%); color: #fff; border: 1px solid #E5A900; text-shadow: 0 1px 2px rgba(0,0,0,0.2); box-shadow: 0 0 12px rgba(255, 215, 0, 0.6); position: relative; }

/* --- Mentions --- */
.mention-box {
    position: absolute; left: 0; right: 0; width: auto; background: white; border: 1px solid #eee; border-radius: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 9999; display: none; flex-direction: column; max-height: 180px; padding: 5px; box-sizing: border-box; overflow-y: auto; overflow-x: hidden; opacity: 0; transition: opacity 0.2s ease;
}
.mention-box.active { display: flex; opacity: 1; animation: menuPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.mention-item { padding: 12px 15px; display: flex; align-items: center; gap: 12px; cursor: pointer; border-bottom: 1px solid #f9f9f9; background: white; position: relative; z-index: 1; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.mention-item:hover { background: #fff5f5; transform: scale(1.08); z-index: 10; box-shadow: 0 8px 20px rgba(0,0,0,0.15); border-radius: 10px; border-bottom-color: transparent; }
.mention-link { color: var(--primary-color) !important; font-weight: 600 !important; text-decoration: none !important; transition: all 0.2s ease; }
.mention-link:hover { text-decoration: underline !important; color: #a80000 !important; transform: scale(1.05); display: inline-block; }

/* --- Modales & Lightbox --- */
.modal-overlay { display: none; position: fixed; z-index: 6000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.8); justify-content: center; align-items: center; animation: fadeIn 0.2s; }
.modal-box-custom { background: white; padding: 30px; border-radius: 20px; width: 450px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.3); position: relative; }
.juicy-modal-box { animation: modalSpringPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.modal-btns { display: flex; justify-content: center; gap: 20px; margin-top: 25px; }

.lightbox { display: none; position: fixed; z-index: 5000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.95); justify-content: center; align-items: center; flex-direction: column; }
.lightbox.active { display: flex; }
.lightbox-content { margin: auto; display: block; width: 80%; max-width: 900px; max-height: 80vh; object-fit: contain; border-radius: 5px; animation: zoomIn 0.3s; }
.close-lightbox { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; cursor: pointer; }
.close-lightbox:hover { color: var(--primary-color); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); color: white; font-size: 50px; font-weight: bold; cursor: pointer; padding: 10px 20px; user-select: none; transition: 0.3s; background: rgba(0,0,0,0.2); border-radius: 5px; z-index: 1001; }
.lightbox-nav:hover { background: rgba(0,0,0,0.8); }

/* --- Skeleton Loader --- */
.skeleton { background: #eee; background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%); border-radius: 5px; background-size: 200% 100%; animation: 1.5s shine linear infinite; }
.skeleton-card { background: white; border-radius: 1rem; padding: 20px; margin-bottom: 25px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* --- Animations Globales --- */
@keyframes pulseSplash { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes slideDown { 0% { opacity: 0; transform: translateY(30px) scale(0.95); } 60% { opacity: 1; transform: translateY(-5px) scale(1.01); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes postSmoothEnter { 0% { opacity: 0; transform: translateY(-20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes zoomIn { from {transform:scale(0)} to {transform:scale(1)} }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInMenu { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalSpringPop { 0% { opacity: 0; transform: scale(0.85) translateY(30px); } 50% { opacity: 1; transform: scale(1.03) translateY(-5px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes trashJuicyShake { 0% { transform: rotate(0deg) scale(1.2); } 25% { transform: rotate(-12deg) scale(1.2); } 50% { transform: rotate(0deg) scale(1.2); } 75% { transform: rotate(12deg) scale(1.2); } 100% { transform: rotate(0deg) scale(1.2); } }
@keyframes silverBadgeShine { 0% { transform: translateX(-100%) rotate(30deg); } 100% { transform: translateX(100%) rotate(30deg); } }
@keyframes shine { to { background-position-x: -200%; } }
@keyframes menuPop { 0% { transform: scale(0.9) translateY(10px); opacity: 0; } 60% { transform: scale(1.02) translateY(-2px); opacity: 1; } 100% { transform: scale(1) translateY(0); opacity: 1; } }

/* Touche physique globale */
.publish-btn:active, .btn-modal:active, .option-btn:active, .ad-btn:active, .tab-btn-juicy:active, .btn-secondary-action:active, .lightbox-action-btn:active {
    transform: scale(0.92) !important; transition: transform 0.05s ease-out; opacity: 0.9;
}

/* =================================================================
   LAYOUT DES PAGES SECONDAIRES (Notifs, Messages, Profil, etc.)
   (Grille à 2 colonnes : Sidebar à gauche + Contenu large à droite)
================================================================= */
/* =================================================================
   LAYOUT DES PAGES SECONDAIRES (Notifs, Messages, Profil, etc.)
================================================================= */
.page-layout {
    display: grid;
    grid-template-columns: 250px 1fr 300px; 
    gap: 40px;
    width: 100%;
    max-width: 100%; /* ICI : On enlève le 1200px pour prendre tout l'écran */
    margin: 0; 
    padding: 20px 40px;
}

.page-content {
    display: flex;
    flex-direction: column;
    gap: 30px; 
    width: 100%;
    max-width: 700px; /* ICI : Limite la largeur pour que ça respire */
    margin: 0 auto; /* ICI : Centre la colonne parfaitement au milieu */
}

/* Zone de pub forcée en bas de page */
.bottom-ad-space {
    width: 100%;
    margin-top: 20px;
}
.bottom-ad-space .panel {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* =================================================================
   GLOBAL JUICY TACTILE FEEDBACK
   Rend tous les boutons et liens interactifs satisfaisants au clic
================================================================= */
button, 
.btn, 
.user-avatar, 
.notif-card, 
.contact-item,
.menu-item {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, background-color 0.2s ease !important;
}

/* Quand l'utilisateur clique, l'élément s'écrase légèrement */
button:active, 
.btn:active, 
.user-avatar:active, 
.notif-card:active,
.contact-item:active,
.menu-item:active {
    transform: scale(0.93) !important;
    transition: transform 0.05s ease-out !important; /* Très rapide à l'enfoncement */
    opacity: 0.85;
}

/* ==========================================================
   🧩 STICKERS UI - JUICY MAXIMUM (Ce que tu as effacé)
========================================================== */

/* --- Overlay de Sauvegarde (Feed & Commentaires) --- */
.sticker-display {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}
.sticker-display:hover {
    transform: scale(1.05) rotate(3deg);
    z-index: 10;
}
.save-sticker-overlay {
    position: absolute;
    bottom: -50px; /* Caché en bas par défaut */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(209, 0, 0, 0.95); /* Ton primary-color */
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(209, 0, 0, 0.4);
    white-space: nowrap;
}
.sticker-display:hover .save-sticker-overlay {
    bottom: 10px;
    opacity: 1;
}
.save-sticker-overlay:hover {
    background: #ff0000;
    transform: translateX(-50%) scale(1.1);
}
.save-sticker-overlay:active {
    transform: translateX(-50%) scale(0.9);
}

/* --- Modale des Stickers (Le Conteneur) --- */
#sticker-modal .modal-box-custom {
    width: 500px;
    max-width: 90vw;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- La Pilule (Conteneur) : Centrage mathématique parfait --- */
.sticker-tabs-wrapper {
    display: flex !important;
    align-items: center;
    background: #f0f2f5;
    border-radius: 50px;
    padding: 6px;
    gap: 5px;
    
    /* LA MAGIE EST ICI */
    align-self: center !important; /* Force le centrage dans ta modale (qui est en flex-column) */
    margin: 15px auto 20px auto !important;
    width: max-content !important; /* La pilule se serre pile autour de tes boutons */
    
    position: relative;
    z-index: 10;
}

/* --- Les Boutons Internes --- */
.tab-btn-juicy {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px !important;
    border-radius: 50px !important;
    border: none;
    background: transparent;
    color: #777;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tab-btn-juicy.active {
    background: white !important;
    color: #d10000 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
    transform: scale(1.03); /* Petit effet de relief */
}

.tab-btn-juicy:hover:not(.active) {
    background: #e4e6eb !important;
    color: #333 !important;
}

.close-modal-btn {
    position: absolute !important; /* Le secret est là : elle ne pousse plus le reste */
    top: 18px !important;
    right: 18px !important;
    width: 32px !important;
    height: 32px !important;
    background: #f4f7f6 !important;
    color: #888 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.4rem !important;
    cursor: pointer !important;
    z-index: 100 !important;
    transition: all 0.2s ease-out !important;
}

.close-modal-btn:hover {
    background: #e4e6eb !important;
    color: #d10000 !important;
    transform: rotate(90deg) scale(1.1) !important; /* L'animation fluide */
}

/* --- Grille de Collection --- */
#stickers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}
/* Scrollbar sexy pour la grille */
#stickers-grid::-webkit-scrollbar { width: 6px; }
#stickers-grid::-webkit-scrollbar-thumb { background: #d10000; border-radius: 10px; }

/* --- Élément Sticker dans la grille --- */
.sticker-item {
    position: relative;
    aspect-ratio: 1;
    background: #f9f9f9;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}
.sticker-item:hover {
    transform: scale(1.15) rotate(-4deg);
    background: white;
    border-color: rgba(209, 0, 0, 0.3);
    box-shadow: 0 10px 25px rgba(209, 0, 0, 0.15);
    z-index: 2;
}
.sticker-img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: transform 0.2s;
}
.sticker-item:active .sticker-img {
    transform: scale(0.85);
}

/* --- Bouton Supprimer (Croix) sur un sticker --- */
.btn-del-sticker {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 3px 8px rgba(209, 0, 0, 0.4);
}
.sticker-item:hover .btn-del-sticker {
    opacity: 1;
    transform: scale(1);
}
.btn-del-sticker:hover {
    background: #ff0000;
    transform: scale(1.2) rotate(90deg) !important;
}

/* --- Zone de Création (Canvas & Upload) --- */
#step-upload, #step-cut {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 250px;
    background: #f9f9f9;
    border-radius: 15px;
    border: 3px dashed #ddd;
    padding: 20px;
    transition: border-color 0.3s, background 0.3s;
}
#step-upload:hover { 
    border-color: var(--primary-color); 
    background: #fff5f5; 
}

#cut-canvas {
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAOklEQVQYV2NkYGAwYkAD////ZwRlYCEozIysEBvIwKqQGEUwhQxUhbA2kKMLbQIZaKMo5NBE0UhRCACOjB8RFgMvFwAAAABJRU5ErkJggg=='); /* Damier transparent pro */
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    cursor: crosshair;
    max-width: 100%;
    touch-action: none; /* Crucial pour le découpage tactile */
    border: 2px solid #eee;
}
/* --- Bouton Fermer (Croix) --- */
.close-modal-btn {
    position: absolute; /* Le sort du flux normal */
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: #f9f9f9;
    color: #aaa;
    border-radius: 50%; /* Cercle parfait */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100; /* Toujours par-dessus */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-modal-btn:hover {
    color: #d10000;
    background: #fff5f5;
    transform: rotate(90deg) scale(1.1); /* Ta fameuse rotation de 90 degrés */
}