/**
 * Wiki MixMaster - CSS Commun
 * Styles partagés entre toutes les pages
 * Version: 1.0
 */

/* ==================== BREADCRUMB ==================== */
.breadcrumb-nav {
    background: var(--wiki-bg-secondary);
    border-bottom: 1px solid var(--wiki-border);
    padding: 1rem 0;
}

.breadcrumb-container {
    max-width: calc(1600px - 320px - 2rem);
    width: calc(100vw - 10rem);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumb-nav a {
    color: var(--wiki-text-muted);
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    color: var(--wiki-accent);
}

.breadcrumb-nav .separator {
    color: var(--wiki-text-muted);
}

.breadcrumb-nav .current {
    color: var(--wiki-text);
    font-weight: 600;
}

/* ==================== PAGE LAYOUT ==================== */
.page-container {
    width: 92%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .page-container {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-container {
        padding: 1rem;
    }
}

/* ==================== SECTIONS ==================== */
.content-section {
    background: var(--wiki-bg-secondary);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(30, 40, 80, 0.08);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid var(--wiki-border);
}

.section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--wiki-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}

.section-title {
    font-family: 'Raleway', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--wiki-text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.section-title i {
    color: var(--wiki-accent);
    font-size: 1.1rem;
}

.section-count {
    color: var(--wiki-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.section-body {
    padding: 1.5rem;
}

/* ==================== TAGS ==================== */
.tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tag-type {
    color: white;
}

.tag-level {
    background: var(--wiki-bg-tertiary);
    color: var(--wiki-text-secondary);
}

/* ==================== VOTE SYSTEM ==================== */
.vote-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vote-score {
    font-size: 1.4rem;
    font-weight: 700;
    margin-left: 0.25rem;
    color: var(--wiki-accent);
}

.vote-score.positive {
    color: #2ecc71;
}

.vote-score.negative {
    color: #e74c3c;
}

.vote-buttons {
    display: flex;
    gap: 0.75rem;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid var(--wiki-border);
    background: var(--wiki-bg-card);
    color: var(--wiki-text-muted);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.vote-btn:hover {
    border-color: var(--wiki-accent);
}

.vote-btn.upvote:hover,
.vote-btn.upvote.active {
    background: #27ae60;
    border-color: #27ae60;
    color: white;
}

.vote-btn.downvote:hover,
.vote-btn.downvote.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.vote-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vote-btn.disabled:hover {
    border-color: var(--wiki-border);
    background: var(--wiki-bg-card);
}

/* ==================== COMMENTS ==================== */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background: var(--wiki-bg-card);
    border-radius: 12px;
    padding: 1rem;
    border-left: 4px solid var(--wiki-accent);
}

.comment-item.deleted {
    opacity: 0.6;
    border-left-color: #e74c3c;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--wiki-bg-tertiary);
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.comment-meta {
    flex: 1;
    min-width: 0;
}

.comment-author {
    font-weight: 600;
    color: var(--wiki-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.comment-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.comment-badge.admin {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.comment-badge.modo {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.comment-badge.contributor {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--wiki-text-muted);
}

.comment-content {
    color: var(--wiki-text);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
}

.comment-content.deleted-text {
    font-style: italic;
    color: var(--wiki-text-muted);
}

.comment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.comment-action {
    font-size: 0.85rem;
    color: var(--wiki-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: transparent;
}

.comment-action i {
    font-size: 0.85rem;
}

.comment-action:hover {
    background: var(--wiki-bg-tertiary);
}

.comment-action.like-btn:hover {
    color: #27ae60;
}

.comment-action.liked {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.comment-action.dislike-btn:hover {
    color: #e74c3c;
}

.comment-action.disliked {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.comment-action.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-action.disabled:hover {
    background: transparent;
    color: var(--wiki-text-muted);
}

.comment-action.mod-action {
    color: #f39c12;
}

.comment-action.mod-action:hover {
    color: #e67e22;
}

.comment-action.mod-delete {
    color: #e74c3c;
}

.comment-action.mod-delete:hover {
    color: #c0392b;
}

.comment-action.mod-restore {
    color: #27ae60;
}

.comment-action.mod-restore:hover {
    color: #1e8449;
}

.comment-vote-count {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.comment-form {
    margin-top: 1.5rem;
}

.recaptcha-container-comment {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: var(--wiki-bg-tertiary);
    border-radius: 10px;
    border: 2px dashed var(--wiki-border);
}

.recaptcha-container-comment .comment-input {
    width: 100%;
    margin: 0;
}

.recaptcha-container-comment #recaptcha_comment {
    align-self: center;
}

.recaptcha-container-comment .comment-submit {
    align-self: center;
}

.comment-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--wiki-border);
    border-radius: 12px;
    background: var(--wiki-bg-card);
    color: var(--wiki-text);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: var(--wiki-accent);
}

/* Placeholder lisible : couleur du texte (blanc en thème sombre), légèrement atténuée. */
.comment-input::placeholder { color: var(--wiki-text); opacity: .55; }

/* Retire l'emplacement d'icône vide de TinyMCE (bouton émoji = caractère, pas d'icône). */
.tox .tox-tbtn__icon-wrap:empty,
.tox .tox-tbtn .tox-icon:empty,
.tox .tox-tbtn__icon-wrap:has(.tox-icon:empty) { display: none !important; width: 0 !important; margin: 0 !important; }

/* Commentaires du STAFF : mise en forme de base (les COULEURS par rang viennent de
   Wiki::getStaffBorderCSS() = config rank_badges, source unique éditable en admin). */
.comment.comment-staff, .reply.comment-staff {
    padding-left: 12px;
    border-radius: 8px;
}

/* Commentaires plus lisibles sur mobile (comme le site) : moins de marge, avatar réduit, actions qui passent à la ligne. */
@media (max-width: 600px) {
    .comment, .reply { padding: 12px !important; }
    .comment-avatar, .comment-avatar img { width: 36px !important; height: 36px !important; }
    .comment-header { flex-wrap: wrap; gap: 4px 8px; }
    .comment-actions, .comment-footer { flex-wrap: wrap; gap: 6px; }
    .staff-badge { font-size: 10px; }
}

.comment-submit {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--wiki-accent), #4a5a8f);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.comment-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 110, 160, 0.3);
}

.comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.login-prompt {
    text-align: center;
    padding: 2rem;
    color: var(--wiki-text-muted);
    background: var(--wiki-bg-tertiary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.login-prompt a {
    color: var(--wiki-accent);
    font-weight: 600;
    cursor: pointer;
}

.no-comments {
    text-align: center;
    padding: 2rem;
    color: var(--wiki-text-muted);
}

/* ==================== REPLY MODAL ==================== */
.reply-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.reply-modal-overlay.active {
    display: flex;
}

.reply-modal {
    background: var(--wiki-bg-card);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.reply-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--wiki-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reply-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--wiki-text);
}

.reply-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--wiki-text-muted);
    padding: 0;
    line-height: 1;
}

.reply-modal-close:hover {
    color: var(--wiki-text);
}

.reply-modal-body {
    padding: 1.5rem;
}

.reply-modal textarea {
    width: 100%;
    min-height: 80px;
    padding: 1rem;
    border: 2px solid var(--wiki-border);
    border-radius: 10px;
    background: var(--wiki-bg-tertiary);
    color: var(--wiki-text);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
}

.reply-modal textarea:focus {
    outline: none;
    border-color: var(--wiki-accent);
}

.reply-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.reply-modal-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.reply-modal-btn.cancel {
    background: var(--wiki-bg-tertiary);
    border: 1px solid var(--wiki-border);
    color: var(--wiki-text-muted);
}

.reply-modal-btn.cancel:hover {
    background: var(--wiki-bg-secondary);
}

.reply-modal-btn.submit {
    background: var(--wiki-accent);
    border: none;
    color: white;
}

.reply-modal-btn.submit:hover {
    filter: brightness(1.1);
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--wiki-bg-secondary);
    border: 2px solid var(--wiki-border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    display: none;
    align-items: center;
    gap: 0.75rem;
    color: var(--wiki-text);
    font-weight: 500;
}

.toast.success {
    border-color: #27ae60;
}

.toast.success .toast-icon {
    color: #27ae60;
}

.toast.error {
    border-color: #e74c3c;
}

.toast.error .toast-icon {
    color: #e74c3c;
}
.toast.info {
    border-color: #3498db;
}
.toast.info .toast-icon {
    color: #3498db;
}

.toast.show {
    display: flex;
    animation: slideUp 0.3s ease;
}

.toast-icon {
    flex-shrink: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
}

.sidebar-card {
    background: var(--wiki-bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--wiki-border);
}

.sidebar-title {
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--wiki-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title i {
    color: var(--wiki-accent);
}

/* ==================== SHARE DROPDOWN ==================== */
.share-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--wiki-bg-secondary);
    border: 1px solid var(--wiki-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    min-width: 200px;
    z-index: 100;
    display: none;
}

.share-dropdown.show {
    display: block;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--wiki-text);
    text-decoration: none;
}

.share-option:hover {
    background: var(--wiki-bg-tertiary);
}

.share-option i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.share-option.copy i {
    color: var(--wiki-accent);
}

/* ==================== ACTION BUTTONS ==================== */
.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid var(--wiki-border);
    background: var(--wiki-bg-tertiary);
    color: var(--wiki-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.action-btn:hover {
    border-color: var(--wiki-accent);
    color: var(--wiki-accent);
}

/* ==================== META INFO ==================== */
.meta-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--wiki-text-muted);
    font-size: 0.9rem;
}

.meta-item i {
    color: var(--wiki-accent);
}

/* ==================== DESCRIPTION ==================== */
.description-content {
    line-height: 1.7;
    color: var(--wiki-text);
    font-size: 0.95rem;
}

.description-empty {
    color: var(--wiki-text-muted);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* ==================== LIGHTBOX ==================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    overflow: hidden;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.1s ease;
    transform-origin: center center;
    pointer-events: none;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.lightbox-ctrl {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.lightbox-ctrl:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== FLOATING BUTTONS ==================== */
.floating-btns-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: none;
    font-size: 1.2rem;
}

.floating-btn:hover {
    transform: scale(1.1);
}

.floating-btn.scroll-top {
    background: var(--wiki-accent);
    color: white;
}

.floating-btn.scroll-top:hover {
    box-shadow: 0 6px 20px rgba(90, 110, 160, 0.5);
}

/* ==================== SPINNER ==================== */
.map-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--wiki-border);
    border-top-color: var(--wiki-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
    .vote-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .vote-btn {
        justify-content: center;
    }
    
    .comment-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==================== HEADER ==================== */
        /* Header styles */
        .wiki-header {
            background: var(--gradient-header);
            padding: 0 2rem;
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }
        
        .header-container {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 70px;
        }
        
        .wiki-brand {
            display: flex;
            align-items: center;
            gap: 12px;
            text-decoration: none;
        }
        
        .wiki-brand img {
            height: 40px;
        }
        
        .header-nav {
            display: flex;
            gap: 0.5rem;
        }
        
        .nav-link {
            color: rgba(255, 255, 255, 0.8);
            padding: 8px 16px;
            border-radius: 8px;
            font-weight: 500;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            text-decoration: none;
        }
        
        .nav-link:hover, .nav-link.active {
            color: white;
            background: rgba(255, 255, 255, 0.1);
        }
        
        /* Dropdown Navigation */
        .nav-dropdown {
            position: relative;
        }
        .nav-dropdown > .nav-link {
            display: flex;
            align-items: center;
            cursor: pointer;
        }
        .nav-dropdown-menu {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            min-width: 200px;
            background: var(--bg-primary, #fff);
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            padding: 8px 0;
            z-index: 1000;
            padding-top: 16px;
        }
        .nav-dropdown-menu::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 16px;
            background: transparent;
        }
        .nav-dropdown:hover .nav-dropdown-menu {
            display: block;
        }
        .nav-dropdown-menu a {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 16px;
            color: var(--text-primary, #333);
            text-decoration: none;
            font-size: 0.9rem;
            transition: background 0.2s;
        }
        .nav-dropdown-menu a:hover {
            background: var(--bg-secondary, #f5f5f5);
        }
        .nav-dropdown-menu a i {
            width: 18px;
            text-align: center;
            color: var(--accent-color, #5E72AF);
        }
        [data-theme="dark"] .nav-dropdown-menu {
            background: #2d323e;
            border: 1px solid #3d4354;
        }
        [data-theme="dark"] .nav-dropdown-menu a {
            color: #e8eaf0;
        }
        [data-theme="dark"] .nav-dropdown-menu a:hover {
            background: #3d4152;
        }
        
        .header-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .theme-toggle {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            border: 2px solid rgba(255, 255, 255, 0.2);
            background: transparent;
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            transition: all 0.3s ease;
        }
        
        .theme-toggle:hover {
            border-color: var(--accent-gold);
            color: var(--accent-gold);
            transform: rotate(20deg);
        }
        
        .theme-toggle .fa-sun { display: none; }
        .theme-toggle .fa-moon { display: block; }
        [data-theme="dark"] .theme-toggle .fa-sun { display: block; }
        [data-theme="dark"] .theme-toggle .fa-moon { display: none; }
        
        .btn-login {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 24px;
            background: var(--accent-primary);
            color: white;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            border: none;
            cursor: pointer;
            text-decoration: none;
        }
        
        .btn-login:hover {
            background: var(--accent-hover);
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(94, 114, 175, 0.4);
        }
        
        .mobile-menu-btn {
            display: none;
            flex-direction: column;
            gap: 5px;
            background: none;
            border: none;
            cursor: pointer;
            padding: 10px;
        }
        
        .mobile-menu-btn span {
            width: 24px;
            height: 2px;
            background: white;
            transition: all 0.3s ease;
        }
        
        .mobile-menu {
            display: none;
            position: fixed;
            top: 70px;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--bg-secondary);
            z-index: 999;
            padding: 2rem;
            flex-direction: column;
            gap: 1rem;
            overflow-y: auto;
        }
        
        .mobile-menu.active {
            display: flex;
        }
        
        .mobile-menu a {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px;
            background: var(--bg-tertiary);
            border-radius: 12px;
            color: var(--text-primary);
            font-weight: 600;
            text-decoration: none;
            transition: all 0.3s ease;
        }
        
        .mobile-menu a:hover, .mobile-menu a.active {
            background: var(--accent-primary);
            color: white;
        }
        
        .mobile-menu a i {
            width: 24px;
            text-align: center;
        }
        
        /* Sous-menus mobiles */
        .mobile-submenu {
            display: flex;
            flex-direction: column;
        }
        
        .mobile-submenu-toggle {
            display: flex;
            align-items: center;
            padding: 14px 20px;
            color: var(--wiki-text-primary);
            text-decoration: none;
            font-weight: 500;
            border-bottom: 1px solid var(--wiki-border);
            cursor: pointer;
        }
        
        .mobile-submenu-toggle i:first-child {
            width: 24px;
            text-align: center;
            margin-right: 12px;
        }
        
        .mobile-chevron {
            margin-left: auto;
            font-size: 0.8em;
            transition: transform 0.3s ease;
        }
        
        .mobile-submenu.open .mobile-chevron {
            transform: rotate(180deg);
        }
        
        .mobile-submenu-content {
            display: none;
            flex-direction: column;
            background: var(--wiki-bg-tertiary);
        }
        
        .mobile-submenu.open .mobile-submenu-content {
            display: flex;
        }
        
        .mobile-submenu-content a {
            padding: 12px 20px 12px 56px !important;
            font-size: 0.95em;
            border-bottom: 1px solid var(--wiki-border);
        }
        
        .mobile-submenu-content a i {
            width: 20px;
            margin-right: 10px;
        }
        
        .user-dropdown {
            position: relative;
        }
        
        .user-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: rgba(255, 255, 255, 0.1);
            border: none;
            border-radius: 8px;
            color: white;
            cursor: pointer;
            font-weight: 500;
        }
        
        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: cover;
            border: 2px solid rgba(255, 255, 255, 0.3);
        }
        
        .user-menu {
            display: none;
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 8px;
            background: var(--bg-card);
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
            min-width: 200px;
            overflow: hidden;
            z-index: 100;
        }
        
        .user-menu.active { display: block; }
        
        .user-menu a {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 16px;
            color: var(--text-primary);
            text-decoration: none;
            transition: background 0.2s;
        }
        
        .user-menu a:hover {
            background: var(--bg-tertiary);
        }
        
        .show-on-desktop { display: block; }
        .hide-on-desktop { display: none; }
        .show-on-mobile { display: none; }
        .hide-on-mobile { display: block; }
        
        @media (max-width: 1024px) {
            .header-nav { display: none; }
            .mobile-menu-btn { display: flex; }
            .show-on-desktop { display: none; }
            .show-on-mobile { display: block; }
        }
        
        @media (max-width: 768px) {
            .wiki-header { padding: 0 1rem; }
            .btn-login span { display: none; }
            .btn-login { padding: 12px; }
        }
        
        /* IMPORTANT: Fix scroll modale */
        .modal {
            overflow-y: auto !important;
        }
        
        .modal-content {
            margin: 20px auto !important;
            max-height: none !important;
            overflow: visible !important;
            border-radius: 16px !important;
        }
        
        /* Fix coins arrondis du header modal */
        .modal-header {
            border-radius: 16px 16px 0 0 !important;
        }
        
        .modal-body {
            max-height: none !important;
            overflow: visible !important;
        }
        
        /* ============================================
           MODE SOMBRE - Modales connexion/inscription
           ============================================ */
        [data-theme="dark"] .modal-content {
            background: #2d323e !important;
            border: 1px solid #3d4354 !important;
        }
        [data-theme="dark"] .modal-header {
            background: #5E72AF !important;
            border-bottom: none !important;
        }
        [data-theme="dark"] .modal-header h2,
        [data-theme="dark"] .modal-header .modal-title {
            color: #fff !important;
        }
        [data-theme="dark"] .modal-close {
            color: rgba(255,255,255,0.8) !important;
        }
        [data-theme="dark"] .modal-close:hover {
            color: #fff !important;
        }
        [data-theme="dark"] .modal-body {
            background: #2d323e !important;
            color: #e8eaf0 !important;
        }
        [data-theme="dark"] .modal-body label {
            color: #b8bdd0 !important;
        }
        [data-theme="dark"] .modal-body input[type="text"],
        [data-theme="dark"] .modal-body input[type="email"],
        [data-theme="dark"] .modal-body input[type="password"] {
            background: #3d4152 !important;
            border: 1px solid #4a4f65 !important;
            color: #e8eaf0 !important;
        }
        [data-theme="dark"] .modal-body input::placeholder {
            color: #8890a8 !important;
        }
        [data-theme="dark"] .modal-body input:focus {
            border-color: #5E72AF !important;
            outline: none !important;
        }
        /* Validation HTML5 - inputs invalides */
        [data-theme="dark"] .modal-body input:invalid:not(:placeholder-shown),
        [data-theme="dark"] .modal-body input.is-invalid {
            border-color: #ef4444 !important;
            background: rgba(239, 68, 68, 0.1) !important;
        }
        [data-theme="dark"] .modal-body input:valid:not(:placeholder-shown) {
            border-color: #22c55e !important;
        }
        /* Messages de validation inline */
        [data-theme="dark"] .modal-body .invalid-feedback,
        [data-theme="dark"] .modal-body .form-error,
        [data-theme="dark"] .modal-body .error-message {
            color: #fca5a5 !important;
        }
        [data-theme="dark"] .modal-body .valid-feedback {
            color: #86efac !important;
        }
        /* Form group avec erreur */
        [data-theme="dark"] .form-group.has-error input,
        [data-theme="dark"] .form-group.error input {
            border-color: #ef4444 !important;
            background: rgba(239, 68, 68, 0.1) !important;
        }
        [data-theme="dark"] .form-group.has-error label,
        [data-theme="dark"] .form-group.error label {
            color: #fca5a5 !important;
        }
        [data-theme="dark"] .modal-footer,
        [data-theme="dark"] .modal-body .modal-footer {
            background: #2d323e !important;
            border-top: 1px solid #3d4354 !important;
        }
        [data-theme="dark"] .modal-btn-link {
            color: #5E72AF !important;
        }
        [data-theme="dark"] .modal-btn-link:hover {
            color: #7B8EC9 !important;
        }
        [data-theme="dark"] .recaptcha-container-inscription,
        [data-theme="dark"] .checkbox-group-inscription {
            background: #3d4152 !important;
            border-color: #4a4f65 !important;
        }
        [data-theme="dark"] .cgu-terms-label {
            color: #b8bdd0 !important;
        }
        [data-theme="dark"] .cgu-link {
            color: #5E72AF !important;
        }
        
        /* Notice messages */
        .notice {
            padding: 12px 16px;
            border-radius: 8px;
            margin: 15px;
        }
        .notice.error { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
        .notice.success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
        .notice.warning { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }
        .notice.info { background: #dbeafe; color: #2563eb; border: 1px solid #bfdbfe; }
        .notice p { margin: 0; }
        
        /* Notice mode sombre */
        [data-theme="dark"] .notice.error { background: rgba(220, 38, 38, 0.15); color: #fca5a5; border-color: rgba(220, 38, 38, 0.3); }
        [data-theme="dark"] .notice.success { background: rgba(22, 163, 74, 0.15); color: #86efac; border-color: rgba(22, 163, 74, 0.3); }
        [data-theme="dark"] .notice.warning { background: rgba(217, 119, 6, 0.15); color: #fcd34d; border-color: rgba(217, 119, 6, 0.3); }
        [data-theme="dark"] .notice.info { background: rgba(37, 99, 235, 0.15); color: #93c5fd; border-color: rgba(37, 99, 235, 0.3); }
        
        /* reCAPTCHA container */
        .recaptcha-container-inscription {
            display: flex;
            justify-content: center;
            margin: 20px 0;
            padding: 16px;
            background: #f7fafc;
            border-radius: 10px;
            border: 2px dashed #e2e8f0;
        }
        
        /* Checkbox CGU */
        .checkbox-group-inscription {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            margin: 20px 0;
            padding: 16px;
            background: #f7fafc;
            border-radius: 10px;
            border: 1px solid #e2e8f0;
        }
        
        .checkbox-group-inscription input[type="checkbox"] {
            width: 18px;
            height: 18px;
            margin-top: 2px;
            cursor: pointer;
            accent-color: #6072AC;
            flex-shrink: 0;
        }
        
        .cgu-terms-label {
            font-size: 0.85rem;
            line-height: 1.4;
            color: #4a5568;
            cursor: pointer;
        }
        
        .cgu-link {
            color: #6072AC;
            text-decoration: none;
            font-weight: 500;
        }
        
        .cgu-link:hover {
            text-decoration: underline;
        }
        
        .cgu-required-mark {
            color: #e53e3e;
            margin-left: 2px;
        }

.mes-arbres-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}
.mes-arbres-overlay.active { display: flex; }

.mes-arbres-box {
    background: var(--bg-secondary, #1a1d28);
    border-radius: 16px;
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
[data-theme="light"] .mes-arbres-box { background: #ffffff; border-color: #e0e0e0; }

.mes-arbres-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.1));
    display: flex;
    align-items: center;
    justify-content: space-between;
}
[data-theme="light"] .mes-arbres-header { border-color: #e0e0e0; }

.mes-arbres-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary, #fff);
}
[data-theme="light"] .mes-arbres-header h3 { color: #1a1a2e; }
.mes-arbres-header h3 i { color: #5E72AF; }

.mes-arbres-close {
    background: none;
    border: none;
    color: var(--text-secondary, #8892b0);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}
.mes-arbres-close:hover { color: var(--text-primary, #fff); }
[data-theme="light"] .mes-arbres-close { color: #666; }
[data-theme="light"] .mes-arbres-close:hover { color: #1a1a2e; }

.mes-arbres-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
}

.mes-arbres-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary, #8892b0);
}
.mes-arbres-loading i { font-size: 1.5rem; margin-bottom: 0.5rem; }

.mes-arbres-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary, #8892b0);
}
.mes-arbres-empty i { font-size: 3rem; opacity: 0.3; margin-bottom: 1rem; display: block; }

.mes-arbres-list { display: flex; flex-direction: column; gap: 0.5rem; }

.mes-arbre-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary, rgba(255,255,255,0.05));
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}
[data-theme="light"] .mes-arbre-item { background: #f5f5f5; }
.mes-arbre-item:hover { background: rgba(94, 114, 175, 0.15); }
.mes-arbre-item.selected { border-color: #5E72AF; background: rgba(94, 114, 175, 0.2); }

.mes-arbre-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--border-color, rgba(255,255,255,0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
[data-theme="light"] .mes-arbre-checkbox { border-color: #ccc; }
.mes-arbre-item.selected .mes-arbre-checkbox {
    background: #5E72AF;
    border-color: #5E72AF;
    color: #fff;
}

.mes-arbre-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(0,0,0,0.3);
}

.mes-arbre-info { flex: 1; min-width: 0; }
.mes-arbre-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary, #fff);
}
[data-theme="light"] .mes-arbre-name { color: #1a1a2e; }
.mes-arbre-meta {
    font-size: 0.75rem;
    color: var(--text-secondary, #8892b0);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}
[data-theme="light"] .mes-arbre-meta { color: #666; }

.mes-arbre-open {
    padding: 0.5rem 0.75rem;
    background: #5E72AF;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.mes-arbre-open:hover { opacity: 0.85; }

.mes-arbres-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
[data-theme="light"] .mes-arbres-footer { border-color: #e0e0e0; }

.mes-arbres-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mes-arbres-btn-new { background: #27ae60; color: #fff; }
.mes-arbres-btn-new:hover { background: #2ecc71; }
.mes-arbres-btn-delete { background: #e74c3c; color: #fff; margin-left: auto; }
.mes-arbres-btn-delete:hover { background: #c0392b; }

.mes-arbres-selection-info {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary, #8892b0);
}
[data-theme="light"] .mes-arbres-selection-info { color: #666; }

/* ==================== FOOTER ==================== */
.scroll-top-container {
    position: fixed;
    right: 20px;
    bottom: 80px; /* Au-dessus du bouton calculatrice (50px + 10px marge + 20px base) */
    z-index: 999;
    transition: bottom 0.3s ease;
}
/* Si pas de calculatrice, le JS ajustera */
.scroll-top-container.no-calc {
    bottom: 20px;
}
.scroll-top-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    background: var(--wiki-bg-card, #363a4a);
    color: var(--wiki-text-primary, #e8eaf0);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}
.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-top-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    background: var(--wiki-accent, #5E72AF);
}

@media (max-width: 480px) {
    .scroll-top-container { right: 15px; }
    .scroll-top-btn { width: 45px; height: 45px; font-size: 1rem; }
}

/* ==================== MODAL HEADER ICON ==================== */
.modal-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: 0.35rem;
}
.modal-header-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* filter: brightness(0) invert(1); */
}
.modal-header-icon i {
    font-size: 1.1rem;
    color: inherit;
}

/* Mode Embed (iframe) */
body.embed-mode {
    padding-top: 0 !important;
    background: var(--wiki-bg-primary);
}
body.embed-mode .main-content {
    padding-top: 1rem;
    margin-top: 0;
}
body.embed-mode .wiki-breadcrumb,
body.embed-mode .breadcrumb-nav {
    display: none !important;
}
body.embed-mode .fab-container {
    display: none !important;
}

/* ── Spinner de chargement PAR-DESSUS un bouton de vote (le bouton reste visible) ── */
.mm-vote-loading { position: relative !important; pointer-events: none; }
.mm-vote-loading::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: rgba(0,0,0,.28); }
.mm-vote-loading::after {
    content: ''; position: absolute; top: 50%; left: 50%; z-index: 2;
    width: 14px; height: 14px; margin: -7px 0 0 -7px;
    border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
    border-radius: 50%; animation: mm-vote-spin .6s linear infinite;
}
@keyframes mm-vote-spin { to { transform: rotate(360deg); } }
