/* ===================================
   M.E.N.T.A FORO - REDDIT STYLE
=================================== */

:root {
    --verde:       #2E7D32;
    --verde-hover: #1B5E20;
    --bg:          #DAE0E6;
    --card:        #FFFFFF;
    --text:        #1A1A1B;
    --text-light:  #787C7E;
    --border:      #D3D6DA;
    --shadow:      0 1px 3px rgba(0,0,0,.08);
    --rojo:        #E53935;
}

* { margin:0; padding:0; box-sizing:border-box; font-family:'Poppins',sans-serif; }

body { background:var(--bg); color:var(--text); }

/* ==========================
   HEADER
========================== */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo-img { height:45px; display:block; }

.search-box-header {
    flex: 1;
    max-width: 650px;
    margin: 0 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F6F7F8;
    border: 1px solid #EDEFF1;
    border-radius: 999px;
    padding: 12px 20px;
}

.search-box-header i { color:#878A8C; }

.search-box-header input {
    width: 100%;
    border: none;
    outline: none;
    background: none;
    font-size: 14px;
}

nav { display:flex; gap:8px; }

nav a {
    text-decoration: none;
    color: #555;
    padding: 10px 14px;
    border-radius: 8px;
    transition: .3s;
    font-size: 14px;
}

nav a:hover, nav a.active {
    background: #F6F7F8;
    color: var(--verde);
}

.nav-auth { margin-left:15px; display:flex; gap:10px; }

/* ==========================
   LAYOUT
========================== */

.foro-layout {
    max-width: 1400px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    gap: 20px;
    padding: 0 20px;
}

/* ==========================
   SIDEBAR IZQUIERDA
========================== */

.foro-sidebar {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.sidebar-title { font-size:16px; margin-bottom:15px; }

.cat-list { list-style:none; }

.cat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: .3s;
    font-size: 14px;
}

.cat-item:hover { background:#F6F7F8; }

.cat-item.active {
    background: #E8F5E9;
    color: var(--verde);
    font-weight: 600;
}

/* ==========================
   MAIN
========================== */

.foro-main { width:100%; }

.community-banner {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.community-banner h1 { font-size:30px; margin-bottom:5px; }
.community-banner p  { color:var(--text-light); }

/* ==========================
   BOTON NUEVA PUBLICACION
========================== */

.new-post-btn {
    border: none;
    background: var(--verde);
    color: white;
    padding: 12px 22px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: .3s;
}

.new-post-btn:hover { background:var(--verde-hover); }

/* ==========================
   FILTROS
========================== */

.filter-bar { display:flex; gap:10px; margin-bottom:20px; }

.filter-btn {
    border: 1px solid var(--border);
    background: white;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: .3s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--verde);
    color: white;
    border-color: var(--verde);
}

/* ==========================
   POSTS
========================== */

.post-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: .2s;
}

.post-card:hover { border-color:#898989; }

/* ==========================
   CUERPO POST
========================== */

.post-body { padding:18px 20px; }

.post-tags { display:flex; gap:8px; margin-bottom:10px; }

.tag {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.tag-riego   { background:#E3F2FD; color:#1976D2; }
.tag-plagas  { background:#FFF3E0; color:#EF6C00; }
.tag-luz     { background:#FCE4EC; color:#C2185B; }
.tag-tierra  { background:#E8F5E9; color:#2E7D32; }
.tag-general { background:#ECEFF1; color:#455A64; }

.post-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    cursor: pointer;
}

.post-title:hover { color:var(--verde); }

.post-desc {
    line-height: 1.7;
    color: #444;
    margin-bottom: 14px;
}

/* ==========================
   ACCIONES + VOTOS ABAJO
========================== */

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 14px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 10px;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: #878A8C;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 999px;
    transition: .2s;
}

.action-btn:hover {
    background: #F6F7F8;
    color: var(--verde);
}

/* ── VOTOS ABAJO ── */
.vote-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.like-btn, .dislike-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: .2s;
}

.like-btn {
    background: #E8F5E9;
    color: var(--verde);
}

.like-btn:hover { background:#C8E6C9; }

.dislike-btn {
    background: #FFEBEE;
    color: var(--rojo);
}

.dislike-btn:hover { background:#FFCDD2; }

.vote-count {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    min-width: 24px;
    text-align: center;
}

/* ── BOTONES EDITAR / ELIMINAR ── */
.edit-btn, .delete-btn {
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 999px;
    transition: .2s;
}

.edit-btn   { color:#1976D2; }
.delete-btn { color:var(--rojo); }

.edit-btn:hover   { background:#E3F2FD; }
.delete-btn:hover { background:#FFEBEE; }

/* ==========================
   SIDEBAR DERECHA
========================== */

.community-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.community-box h3 { margin-bottom:10px; }
.community-box p  { color:var(--text-light); margin-bottom:20px; }

.community-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.community-stat { display:flex; flex-direction:column; }

.community-stat strong {
    font-size: 22px;
    color: var(--verde);
}

.community-stat span { font-size:13px; color:#777; }

.join-community {
    width: 100%;
    margin-top: 20px;
    border: none;
    background: var(--verde);
    color: white;
    padding: 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    transition: .3s;
}

.join-community:hover { background:var(--verde-hover); }

/* ==========================
   MODALES
========================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.open { display:flex; }

.modal-box {
    width: 600px;
    max-width: 95%;
    background: white;
    border-radius: 16px;
    padding: 25px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 18px;
    color: #888;
    transition: .2s;
}

.modal-close:hover { color:#333; }

.modal-box label { font-weight:600; font-size:14px; }

.modal-box input,
.modal-box textarea,
.modal-box select {
    width: 100%;
    margin-top: 8px;
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

.modal-btns {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.m-cancel {
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: .2s;
}

.m-cancel:hover { background:#f5f5f5; }

.m-submit {
    background: var(--verde);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: .2s;
}

.m-submit:hover { background:var(--verde-hover); }

/* ── COMENTARIOS MODAL ── */
.comentario-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comentario-item:last-child { border-bottom:none; }

.comentario-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--verde);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.comentario-content { flex:1; }

.comentario-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comentario-username {
    font-weight: 600;
    font-size: 13px;
    color: var(--verde);
}

.comentario-fecha {
    font-size: 11px;
    color: var(--text-light);
}

.comentario-texto {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.lista-comentarios-vacia {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-size: 14px;
}

/* ==========================
   EMPTY STATE
========================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state .empty-icon { font-size:48px; margin-bottom:16px; }
.empty-state h3 { font-size:18px; margin-bottom:8px; color:var(--text); }

/* ==========================
   TOAST
========================== */

.foro-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: var(--verde);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(10px);
    transition: all .3s;
    pointer-events: none;
    z-index: 9999;
}

.foro-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================
   BOTONES AUTH
========================== */

.btn-perfil, .btn-logout {
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    transition: .3s;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.btn-perfil { background:#2E7D32; color:white; }
.btn-perfil:hover { background:#1b5e20; }

.btn-login  { background:#2E7D32; color:white; }
.btn-login:hover { background:#1b5e20; }

.btn-logout { background:white; color:black; border:1px solid var(--border); }
.btn-logout:hover { background:#b91c1c; color:white; border-color:#b91c1c; }

/* ==========================
   RESPONSIVE
========================== */

@media(max-width:1200px) {
    .community-box { display:none; }
    .foro-layout { grid-template-columns: 250px 1fr; }
}

@media(max-width:900px) {
    .foro-sidebar { display:none; }
    .foro-layout  { grid-template-columns: 1fr; }
    nav           { display:none; }
    .search-box-header { display:none; }
}

@media(max-width:768px) {
    .community-banner { flex-direction:column; align-items:flex-start; gap:15px; }
    .post-footer      { flex-direction:column; align-items:flex-start; }
}
/*--------------------------------------------------------------------------------------------------------------------------------------
/* ==========================
   COMENTARIOS CON RESPUESTAS
========================== */

.comentario-acciones {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.btn-like-comentario {
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    transition: .2s;
    font-family: 'Poppins', sans-serif;
}

.btn-like-comentario:hover,
.btn-like-comentario.activo {
    background: #E8F5E9;
    color: var(--verde);
}

.btn-like-comentario i { font-size:13px; }

.btn-responder-comentario {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    transition: .2s;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-responder-comentario:hover { 
    background: #F6F7F8;
    color: var(--verde); 
}

/* Respuestas */
.respuestas-container {
    margin-left: 48px;
    margin-top: 8px;
    border-left: 2px solid #E8F5E9;
    padding-left: 12px;
}

.respuesta-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f9f9f9;
}

.respuesta-item:last-child { border-bottom: none; }

.respuesta-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1976D2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

.respuesta-content { flex:1; }

.respuesta-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.respuesta-username {
    font-weight: 600;
    font-size: 12px;
    color: #1976D2;
}

.respuesta-fecha {
    font-size: 11px;
    color: var(--text-light);
}

.respuesta-texto {
    font-size: 13px;
    line-height: 1.5;
    color: #444;
}

/* Form de respuesta inline */
.form-respuesta {
    margin-left: 48px;
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.form-respuesta textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    resize: none;
    height: 60px;
}

.form-respuesta textarea:focus {
    outline: none;
    border-color: var(--verde);
}

.btn-enviar-respuesta {
    background: var(--verde);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    transition: .2s;
    white-space: nowrap;
}

.btn-enviar-respuesta:hover { background: var(--verde-hover); }

/* Top comentarios en post */
.top-comentarios {
    padding: 0 20px 14px;
    border-top: 1px solid #f0f0f0;
}

.top-comentarios-titulo {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 600;
}

.top-comentario-preview {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #f9f9f9;
}

.top-comentario-preview:last-child { border-bottom: none; }

.top-comentario-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--verde);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.top-comentario-texto {
    font-size: 13px;
    color: #444;
    line-height: 1.4;
}

.top-comentario-texto strong {
    color: var(--verde);
    font-size: 12px;
}

/* Vote row sin número separado */
.vote-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.like-btn, .dislike-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: .2s;
    font-family: 'Poppins', sans-serif;
}

.like-btn {
    background: #E8F5E9;
    color: var(--verde);
}

.like-btn:hover, .like-btn.activo { background:#C8E6C9; }

.dislike-btn {
    background: #FFEBEE;
    color: var(--rojo);
}

.dislike-btn:hover, .dislike-btn.activo { background:#FFCDD2; }

.like-count   { font-weight:700; color: var(--verde); }
.dislike-count { font-weight:700; color: var(--rojo); }

