/* ============================================
   Bikini Tahiti — Styles édition admin
   ============================================ */

/* Crayon admin dans la navbar */
.admin-edit-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: 10px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}
.admin-edit-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.5);
}
body.admin-editing .admin-edit-toggle {
    background: linear-gradient(135deg, #ef4444, #f97316);
}

/* Éléments éditables : indication visuelle */
body.admin-editing .is-editable {
    outline: 2px dashed rgba(236, 72, 153, 0.5);
    outline-offset: 4px;
    cursor: text;
    border-radius: 4px;
    transition: outline-color 0.15s;
}
body.admin-editing .is-editable:hover {
    outline-color: rgba(236, 72, 153, 0.9);
    background: rgba(236, 72, 153, 0.05);
}
body.admin-editing .is-editable:focus {
    outline: 2px solid #ec4899;
    outline-offset: 4px;
    background: rgba(255, 255, 255, 0.4);
}

/* Liens éditables : conserver l'apparence bouton */
body.admin-editing a.is-editable {
    cursor: text;
}

/* Bouton "Changer l'image" sur parallaxes */
.edit-image-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: 2px solid #ec4899;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s;
}
.edit-image-btn:hover {
    background: #ec4899;
    transform: scale(1.05);
}

/* Indication parallaxe en mode édition */
body.admin-editing [data-edit-image] {
    position: relative;
    outline: 3px dashed rgba(236, 72, 153, 0.6);
    outline-offset: -8px;
}

/* Barre flottante Enregistrer / Annuler */
.admin-edit-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 22px;
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
    border-radius: 50px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.admin-edit-bar-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}
.admin-edit-bar-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ec4899;
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.3);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.3); }
    50%      { box-shadow: 0 0 0 8px rgba(236, 72, 153, 0.1); }
}

.admin-edit-bar-actions {
    display: flex;
    gap: 10px;
}

.admin-edit-cancel,
.admin-edit-save {
    padding: 8px 18px;
    border: none;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.admin-edit-cancel {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.admin-edit-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}
.admin-edit-save {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
}
.admin-edit-save:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4);
}
.admin-edit-save:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Toast de confirmation */
.admin-edit-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 10000;
    padding: 12px 24px;
    background: #16a34a;
    color: #fff;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.4);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.admin-edit-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Mobile : barre plus compacte */
@media (max-width: 600px) {
    .admin-edit-bar {
        bottom: 12px;
        left: 12px;
        right: 12px;
        transform: none;
        padding: 12px 16px;
        border-radius: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .admin-edit-bar-info { justify-content: center; font-size: 12px; }
    .admin-edit-bar-actions { justify-content: flex-end; }
    .admin-edit-toast { bottom: 130px; }
    .edit-image-btn { top: 12px; right: 12px; padding: 8px 14px; font-size: 12px; }
}

/* ===== Modale recadrage photo (éditeur de site) ===== */
.site-crop-modal { position: fixed; inset: 0; z-index: 100001; display: none; align-items: center; justify-content: center; padding: 16px; }
.site-crop-modal.open { display: flex; }
.site-crop-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,0.6); backdrop-filter: blur(4px); }
.site-crop-card { position: relative; background: #fff; border-radius: 16px; max-width: 680px; width: 100%; max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,0.35); }
.site-crop-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #eee; font-size: 1.05rem; }
.site-crop-x { background: none; border: none; font-size: 1.7rem; line-height: 1; cursor: pointer; color: #94a3b8; }
.site-crop-ratios { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px 0; }
.site-crop-ratios button { border: 1.5px solid #e5e5e5; background: #fff; color: #666; border-radius: 999px; padding: 6px 14px; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.site-crop-ratios button.active { background: linear-gradient(135deg, #ec4899, #8b5cf6); color: #fff; border-color: transparent; }
.site-crop-stage { margin: 14px 20px; max-height: 50vh; background: #f3f4f6; border-radius: 12px; overflow: hidden; }
.site-crop-stage img { display: block; max-width: 100%; }
.site-crop-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding: 0 20px 18px; }
.site-crop-actions button { border: 1px solid #e5e5e5; background: #fff; color: #374151; border-radius: 10px; padding: 9px 14px; font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.site-crop-actions button.primary { background: linear-gradient(135deg, #ec4899, #8b5cf6); color: #fff; border-color: transparent; }

/* Images cliquables dans une zone de texte riche (édition article) */
body.admin-editing .rich-img-editable { cursor: pointer; outline: 2px dashed transparent; transition: outline-color .15s, filter .15s; }
body.admin-editing .rich-img-editable:hover { outline-color: #ec4899; filter: brightness(.92); }

/* Barre d'outils de mise en forme (édition texte riche) */
.rich-toolbar { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 10001; display: none; flex-wrap: wrap; gap: 4px; align-items: center; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 8px 10px; box-shadow: 0 8px 30px rgba(0,0,0,.18); max-width: 94vw; }
.rich-toolbar button { border: 1px solid #e5e7eb; background: #fff; color: #374151; border-radius: 8px; padding: 7px 11px; font-size: 0.85rem; font-weight: 600; cursor: pointer; line-height: 1; transition: background .12s, border-color .12s; }
.rich-toolbar button:hover { background: #fdf2f7; border-color: #ec4899; color: #be185d; }
.rich-toolbar .rich-sep { width: 1px; height: 22px; background: #e5e7eb; margin: 0 3px; }
html[data-theme="dark"] .rich-toolbar { background: #1a1d24; border-color: #2a2e37; }
html[data-theme="dark"] .rich-toolbar button { background: #20242d; border-color: #3a4150; color: #e5e7eb; }
