/* ==========================================================================
   FORUM.CSS - Isolé pour ne pas entrer en conflit avec Global/Home
   ========================================================================== */

.forum-container {
    --f-accent: #00d4ff;
    --f-accent-glow: rgba(0, 212, 255, 0.3);
    --f-card-bg: rgba(30, 41, 59, 0.6);
    --f-border: rgba(255, 255, 255, 0.1);
    --f-text-muted: #94a3b8;
    
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    color: var(--text-main, #fff);
    font-family: 'Poppins', sans-serif;
}

/* --- LAYOUT DU FEED --- */
.forum-main-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    align-items: start;
}

/* --- CARTES GLASSMORPHISM --- */
.card-glass {
    background: var(--f-card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--f-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

/* --- HEADER & RECHERCHE --- */
.intro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.forum-title {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.forum-title::before {
    content: "";
    width: 4px;
    height: 24px;
    background: var(--f-accent);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--f-accent-glow);
}

.search-bar {
    position: relative;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--f-border);
    border-radius: 50px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
    color: white;
}

.search-bar:focus-within {
    border-color: var(--f-accent);
    box-shadow: 0 0 12px var(--f-accent-glow);
}

.search-bar input {
    background: transparent;
    border: none;
    color: white;
    outline: none;
    width: 100%;
    margin-left: 10px;
    font-size: 0.9rem;
}

/* --- FILTRES --- */
.filter-bar { display: flex; gap: 8px; margin-bottom: 25px; flex-wrap: wrap; }

.filter-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--f-border);
    color: var(--f-text-muted);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--f-accent);
    color: #000;
    border-color: var(--f-accent);
    font-weight: 600;
}

/* --- MENU DOTS --- */
.menu-dots-container {
    position: relative;
    display: inline-block;
}

.menu-dots-btn {
    background: transparent;
    border: none;
    color: var(--f-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.menu-dots-btn:hover { color: var(--f-accent); }

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: var(--f-card-bg);
    min-width: 140px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 1px solid var(--f-border);
    z-index: 10;
}

.dropdown-content button {
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px 12px;
    text-align: left;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.dropdown-content button:hover { background: var(--f-accent); color: #000; }

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

/* --- QUESTIONS CARDS --- */
.question-card:hover { transform: translateY(-3px); border-left: 3px solid var(--f-accent); }

.q-header { display: flex; justify-content: space-between; margin-bottom: 15px; }
.user-info { display: flex; gap: 10px; align-items: center; }
.avatar-md { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; }

.username-wrapper a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.admin-badge {
    background: var(--f-accent);
    color: black;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* --- CONTEXTE / PROJET --- */
.q-context-header {
    background: rgba(0,212,255,0.08);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-bottom: 12px;
    border-left: 2px solid var(--f-accent);
}

.context-link { color: var(--f-accent); font-weight: 700; text-decoration: none; }

/* --- TAG BADGES --- */
.tag-badge {
    display: inline-block;
    background: rgba(255,255,255,0.05);
    color: var(--f-text-muted);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.tag-badge.tech { background: rgba(0,212,255,0.1); color: #fff; }
.tag-badge.code { background: rgba(0,255,128,0.1); color: #fff; }
.tag-badge.design { background: rgba(255,128,0,0.1); color: #fff; }
.tag-badge.feedback { background: rgba(255,255,0,0.1); color: #000; }

/* --- IMAGES --- */
.q-image-wrapper { margin: 12px 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--f-border); }
.q-image-wrapper img { width: 100%; max-height: 400px; object-fit: cover; cursor: zoom-in; }

/* --- FOOTER CARDS --- */
.q-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--f-border);
}

.q-stats { display: flex; gap: 12px; color: var(--f-text-muted); font-size: 0.8rem; }
.q-stats i { color: var(--f-accent); }

.btn-action-main {
    background: rgba(255,255,255,0.05);
    color: white;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--f-border);
}

.btn-action-main:hover { background: var(--f-accent); color: black; }

/* --- TEXTAREA & FORM --- */
.textarea-wrapper textarea {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--f-border);
    border-radius: 10px;
    padding: 12px;
    color: white;
    font-family: inherit;
    resize: none;
}

.publish-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }

.form-control, .tag-select {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--f-border);
    padding: 8px;
    border-radius: 6px;
    color: white;
    font-size: 0.85rem;
}

.btn-primary-glow {
    background: var(--f-accent);
    color: #000;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 10px var(--f-accent-glow);
}

/* --- SIDEBAR --- */
.sidebar-widget h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--f-text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.tag-link {
    display: inline-block;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--f-border);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    color: var(--f-text-muted);
    text-decoration: none;
    margin-bottom: 5px;
}

.tag-link.active {
    background: var(--f-accent);
    color: black;
    border-color: var(--f-accent);
}

/* --- MODALS --- */
.modal-zoom {
    display: none;
    position: fixed;
    z-index: 999;
    left:0; top:0; width:100%; height:100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.modal-zoom img { max-width: 90%; max-height: 90%; border-radius: 10px; }

.modal-zoom .close-modal {
    position: absolute; top: 20px; right: 30px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
}

.custom-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left:0; top:0; width:100%; height:100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.custom-modal .modal-content {
    max-width: 400px;
    padding: 20px;
}

.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; }

.btn-cancel { background: rgba(255,255,255,0.2); border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; color: white; }
.btn-del { background: var(--f-accent); border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; color: black; font-weight: 700; }


/* =========================
   SIDEBAR LINKS
   ========================= */
.sidebar-link {
    display: block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--f-border);
    border-radius: 12px;
    padding: 6px 12px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--f-text-muted);
    text-decoration: none;
    transition: 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-link:hover {
    background: var(--f-accent);
    color: #000;
}

/* =========================
   IMAGE UPLOAD BUTTON
   ========================= */
.upload-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--f-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--f-text-muted);
    transition: 0.2s;
}

.upload-label:hover {
    background: var(--f-accent);
    color: #000;
}

.upload-label input[type="file"] {
    display: none;
}

/* =========================
   MODAL ZOOM IMAGE
   ========================= */
.modal-zoom {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.modal-zoom img {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80%;
    border-radius: 12px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

/* =========================
   CONFIRMATION MODAL
   ========================= */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.custom-modal .modal-content {
    max-width: 400px;
    margin: auto;
    padding: 20px;
    text-align: center;
}

.modal-btns {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn-cancel, .btn-del {
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-cancel {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transition: 0.2s;
}

.btn-cancel:hover {
    background: var(--f-accent);
    color: #000;
}

.btn-del {
    background: #ff4d4d;
    color: #fff;
    transition: 0.2s;
}

.btn-del:hover {
    background: #ff1a1a;
}

/* =========================
   RESPONSIVE SIDEBAR LINKS
   ========================= */
@media (max-width: 1024px) {
    .sidebar-link {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}
/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .forum-main-layout { grid-template-columns: 1fr; }
    .forum-sidebar { display: none; }
}

@media (max-width: 600px) {
    .forum-container { padding: 0 10px; }
    .intro-header { flex-direction: column; align-items: stretch; }
    .publish-options { grid-template-columns: 1fr; }
}