/* ============================================================
   comunidad.css — Módulo de Lectura Social Interactiva
   Estilos premium para la comunidad de lectores en tiempo real
   ============================================================ */

/* ————— PANEL DE NOTAS COMUNITARIAS (Drawer derecho) ————— */
.com-panel-notas {
    position: fixed;
    right: -430px;
    top: 72px;
    width: 400px;
    max-width: 92vw;
    height: calc(100vh - 72px);
    background: #0e0d0b;
    border-left: 1px solid rgba(184, 151, 90, 0.25);
    z-index: 2500;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -15px 0 50px rgba(0,0,0,0.7);
}
.com-panel-notas.open { right: 0; }

.com-panel-header {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: rgba(184,151,90,0.05);
}
.com-panel-header h3 {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    color: #fff;
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.com-panel-live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(0,230,118,0.12);
    color: #00e676;
    border: 1px solid rgba(0,230,118,0.25);
    border-radius: 20px;
    padding: 0.15rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.com-live-dot {
    width: 6px; height: 6px;
    background: #00e676;
    border-radius: 50%;
    animation: com-pulsar 1.4s infinite;
    box-shadow: 0 0 6px #00e676;
}
@keyframes com-pulsar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.com-panel-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}
.com-panel-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

#com-panel-form {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.com-nota-form { display: flex; flex-direction: column; gap: 0.6rem; }

.com-textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: #f0ece4;
    font-family: inherit;
    font-size: 0.87rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    line-height: 1.5;
}
.com-textarea:focus { border-color: var(--gold, #b8975a); }
.com-textarea::placeholder { color: #555; }

.com-nota-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.com-toggle-privada {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.79rem;
    color: #888;
    cursor: pointer;
    user-select: none;
}
.com-toggle-privada input { accent-color: var(--gold, #b8975a); cursor: pointer; }

.com-login-prompt {
    text-align: center;
    padding: 0.5rem 0;
}
.com-login-prompt p {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0.9rem;
    line-height: 1.55;
}

.com-notas-divider {
    text-align: center;
    font-size: 0.7rem;
    color: #444;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 0;
    flex-shrink: 0;
}

.com-notas-lista {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.com-notas-lista::-webkit-scrollbar { width: 3px; }
.com-notas-lista::-webkit-scrollbar-track { background: transparent; }
.com-notas-lista::-webkit-scrollbar-thumb { background: rgba(184,151,90,0.25); border-radius: 4px; }

/* ————— TARJETAS DE NOTAS ————— */
.com-nota-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    transition: all 0.2s ease;
    animation: com-fadeIn 0.3s ease;
}
.com-nota-card:hover { border-color: rgba(184,151,90,0.2); }
.com-nota-card.propia {
    border-color: rgba(184,151,90,0.18);
    background: rgba(184,151,90,0.04);
}
@keyframes com-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.com-nota-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}
.com-nota-meta { flex: 1; display: flex; flex-direction: column; }
.com-nota-nick { font-size: 0.82rem; font-weight: 700; color: var(--gold, #b8975a); }
.com-nota-fecha { font-size: 0.7rem; color: #555; margin-top: 0.1rem; }

.com-nota-texto {
    font-size: 0.86rem;
    color: #ccc;
    line-height: 1.55;
    margin-bottom: 0.65rem;
    word-break: break-word;
}

.com-nota-footer { display: flex; align-items: center; gap: 0.5rem; }

.com-btn-like {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 0.28rem 0.75rem;
    color: #777;
    font-size: 0.77rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.com-btn-like:hover, .com-btn-like.active {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.com-btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.35;
    transition: opacity 0.2s;
    padding: 0.15rem;
    margin-left: auto;
}
.com-btn-delete:hover { opacity: 1; }

/* ————— SECCIÓN CLUBES (en catálogo) ————— */
.com-clubes-section {
    margin-bottom: 2rem;
    background: rgba(0, 230, 118, 0.02);
    border: 1px solid rgba(0, 230, 118, 0.12);
    border-radius: 16px;
    padding: 1.4rem 1.5rem;
    animation: com-fadeIn 0.4s ease;
}

.com-clubes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.com-clubes-title {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.com-live-badge {
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-radius: 20px;
    padding: 0.12rem 0.55rem;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    animation: com-pulsar 2s infinite;
}

.com-clubes-lista {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
}
.com-clubes-lista::-webkit-scrollbar { height: 3px; }
.com-clubes-lista::-webkit-scrollbar-thumb { background: rgba(0,230,118,0.2); border-radius: 4px; }

/* ————— TARJETA DE CLUB ————— */
.com-club-card {
    flex-shrink: 0;
    width: 255px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(0, 230, 118, 0.1);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.com-club-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00e676, transparent);
}
.com-club-card:hover {
    border-color: rgba(0, 230, 118, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 230, 118, 0.08);
}
.com-club-card-dot {
    position: absolute;
    top: 12px; right: 12px;
    width: 8px; height: 8px;
    background: #00e676;
    border-radius: 50%;
    animation: com-pulsar 1.5s infinite;
    box-shadow: 0 0 8px #00e676;
}
.com-club-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}
.com-club-titulo {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.com-club-anfitrion {
    font-size: 0.7rem;
    color: var(--gold, #b8975a);
}
.com-club-libro {
    font-size: 0.78rem;
    color: #777;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.com-club-desc {
    font-size: 0.78rem;
    color: #aaa;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.com-club-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #555;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 0.6rem;
}

/* ————— SALA DE CLUB (Chat en vivo) ————— */
#com-modal-sala-club {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(14px);
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
}

.com-sala-container {
    width: 700px;
    max-width: 95vw;
    height: 85vh;
    background: #0c0b0a;
    border: 1px solid rgba(0, 230, 118, 0.2);
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 60px rgba(0,230,118,0.04);
    animation: com-modalIn 0.3s ease;
}
@keyframes com-modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(15px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.com-sala-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(0, 230, 118, 0.04);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0;
}
.com-sala-info { flex: 1; }
#com-sala-titulo {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.15rem;
}
#com-sala-libro  { font-size: 0.8rem; color: var(--gold, #b8975a); margin: 0 0 0.1rem; display: block; }
#com-sala-descripcion { font-size: 0.78rem; color: #777; margin: 0; display: block; }

#com-sala-mensajes {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
#com-sala-mensajes::-webkit-scrollbar { width: 3px; }
#com-sala-mensajes::-webkit-scrollbar-thumb { background: rgba(0,230,118,0.2); border-radius: 4px; }

.com-mensaje {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    animation: com-fadeIn 0.2s ease;
}
.com-mensaje.propio { flex-direction: row-reverse; }

.com-mensaje-burbuja {
    max-width: 74%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    padding: 0.65rem 1rem;
}
.com-mensaje.propio .com-mensaje-burbuja {
    background: rgba(0, 230, 118, 0.09);
    border-color: rgba(0, 230, 118, 0.18);
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 16px;
}
.com-mensaje-nick {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold, #b8975a);
    display: block;
    margin-bottom: 0.2rem;
}
.com-mensaje-burbuja p {
    font-size: 0.87rem;
    color: #ddd;
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
}
.com-mensaje-hora {
    font-size: 0.66rem;
    color: #555;
    display: block;
    margin-top: 0.3rem;
    text-align: right;
}
.com-mensaje.propio .com-mensaje-hora { text-align: left; }

.com-sala-input-bar {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
    align-items: center;
}
.com-sala-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 25px;
    padding: 0.7rem 1.2rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.com-sala-input:focus { border-color: #00e676; }
.com-sala-input::placeholder { color: #555; }

/* ————— MODALES COMUNIDAD (genérico) ————— */
.com-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(10px);
    z-index: 3600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.com-modal-box {
    background: #0e0d0b;
    border: 1px solid rgba(184,151,90,0.22);
    border-radius: 22px;
    padding: 2rem;
    width: 420px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
    animation: com-modalIn 0.3s ease;
}
.com-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}
.com-modal-title {
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.com-modal-subtitle {
    font-size: 0.84rem;
    color: #888;
    margin: 0.3rem 0 0;
    line-height: 1.5;
}

/* ————— FORMULARIOS ————— */
.com-form-group { margin-bottom: 1.1rem; }
.com-label {
    font-size: 0.72rem;
    color: var(--gold, #b8975a);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 700;
    display: block;
    margin-bottom: 0.45rem;
}
.com-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0.72rem 1rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.com-input:focus { border-color: var(--gold, #b8975a); }
.com-input::placeholder { color: #555; }

/* ————— PERFIL ————— */
.com-perfil-avatar-section { text-align: center; margin-bottom: 1.5rem; }
#com-perfil-avatar-display {
    font-size: 4rem;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1;
}
.com-avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
    margin-top: 0.8rem;
}
.com-avatar-opt {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 0.45rem;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}
.com-avatar-opt:hover { border-color: var(--gold, #b8975a); background: rgba(184,151,90,0.08); }
.com-avatar-opt.selected {
    border-color: var(--gold, #b8975a);
    background: rgba(184,151,90,0.15);
    box-shadow: 0 0 14px rgba(184,151,90,0.22);
}

/* ————— BOTONES COMUNIDAD ————— */
.com-btn-primary {
    background: linear-gradient(135deg, var(--gold, #b8975a), #a07840);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 0.62rem 1.3rem;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 0.87rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.com-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184,151,90,0.35);
}
.com-btn-secondary {
    background: rgba(255,255,255,0.06);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0.62rem 1.3rem;
    font-size: 0.87rem;
    cursor: pointer;
    transition: all 0.2s;
}
.com-btn-secondary:hover { background: rgba(255,255,255,0.1); color: #fff; }

.com-btn-google {
    width: 100%;
    background: #fff;
    color: #333;
    border: none;
    border-radius: 12px;
    padding: 0.9rem 1.5rem;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.25s;
    box-shadow: 0 4px 20px rgba(255,255,255,0.08);
}
.com-btn-google:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(255,255,255,0.15); }

.com-btn-icon-round {
    background: none;
    border: none;
    color: #777;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
}
.com-btn-icon-round:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* ————— AVATAR MINI (componente inline) ————— */
.com-avatar-mini {
    width: 30px; height: 30px;
    background: rgba(184,151,90,0.1);
    border: 1px solid rgba(184,151,90,0.2);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    line-height: 1;
}

/* ————— BOTONES NAVBAR COMUNIDAD ————— */
#btn-comunidad-perfil {
    display: none;
    align-items: center;
    gap: 0.4rem;
    background: rgba(184,151,90,0.1);
    border: 1px solid rgba(184,151,90,0.25);
    color: var(--gold, #b8975a);
    border-radius: 25px;
    padding: 0.38rem 1rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}
#btn-comunidad-perfil:hover { background: rgba(184,151,90,0.2); }

#btn-comunidad-login {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0,230,118,0.07);
    border: 1px solid rgba(0,230,118,0.25);
    color: #00e676;
    border-radius: 25px;
    padding: 0.38rem 1rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}
#btn-comunidad-login:hover { background: rgba(0,230,118,0.14); }

/* ————— BOTÓN NOTAS EN EL LECTOR ————— */
#btn-notas-comunidad {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(184,151,90,0.07);
    border: 1px solid rgba(184,151,90,0.2);
    border-radius: 8px;
    padding: 0.48rem 0.9rem;
    color: var(--gold, #b8975a);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}
#btn-notas-comunidad:hover { background: rgba(184,151,90,0.14); }
#btn-notas-comunidad.active {
    background: rgba(184,151,90,0.18);
    box-shadow: 0 0 14px rgba(184,151,90,0.18);
    border-color: rgba(184,151,90,0.4);
}

/* ————— ESTADO VACÍO ————— */
.com-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
    font-size: 0.84rem;
    line-height: 1.6;
}

/* ————— TOAST NOTIFICATION ————— */
#com-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1c1b19;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 25px;
    padding: 0.7rem 1.5rem;
    font-size: 0.87rem;
    font-weight: 600;
    z-index: 9999;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    white-space: nowrap;
}
#com-toast.visible { transform: translateX(-50%) translateY(0); }
#com-toast.com-toast-error { border-color: rgba(239,68,68,0.35); color: #fca5a5; }
#com-toast.com-toast-success { border-color: rgba(0,230,118,0.3); }

/* ————— LOGIN MODAL ESPECIAL ————— */
.com-login-modal-box {
    max-width: 380px;
    text-align: center;
}
.com-login-logo { font-size: 3rem; margin-bottom: 1rem; display: block; }
.com-benefits-list {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 1.2rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.com-benefits-list li {
    font-size: 0.84rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.com-benefits-list li::before {
    content: '✦';
    color: var(--gold, #b8975a);
    font-size: 0.7rem;
    flex-shrink: 0;
}
.com-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.2rem 0;
}
.com-divider::before, .com-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.07);
}
.com-divider span { font-size: 0.73rem; color: #555; }

/* ————— ACCIÓN MODAL FOOTER ————— */
.com-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ————— RESPONSIVE ————— */
@media (max-width: 768px) {
    .com-panel-notas { width: 100vw; right: -100vw; }
    .com-clubes-lista { flex-wrap: nowrap; }
    .com-club-card { width: 230px; }
    .com-sala-container { height: 95vh; border-radius: 16px; }
}
