/* ==================== COMMUNITY ==================== */
.page-comunidad {
    padding: 42px 24px 70px;
}

.community-hero {
    max-width: 1320px;
    margin: 0 auto 20px;
    padding: 26px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    background:
        radial-gradient(circle at 85% 10%, rgba(6,182,212,0.18), transparent 40%),
        radial-gradient(circle at 10% 85%, rgba(124,58,237,0.22), transparent 46%),
        linear-gradient(135deg, rgba(20,18,35,0.96), rgba(9,17,32,0.95));
}

.community-hero h1 {
    font-family: 'Cinzel', serif;
    margin-bottom: 10px;
}

.community-hero p {
    color: var(--text-secondary);
    max-width: 840px;
}

.community-layout {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 16px;
}

.community-composer,
.community-feed,
.community-panel {
    background: rgba(20, 19, 36, 0.9);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.community-feed-col {
    display: grid;
    gap: 12px;
}

.community-feed-tabs {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    background: rgba(20, 19, 36, 0.9);
    box-shadow: var(--shadow-md);
    width: fit-content;
}

.community-feed-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.community-feed-tab i {
    font-size: 0.82rem;
    color: var(--accent-secondary);
}

.community-feed-tab:hover {
    color: var(--text-primary);
}

.community-feed-tab.active {
    background: linear-gradient(120deg, rgba(124, 58, 237, 0.32), rgba(59, 130, 246, 0.28));
    border-color: rgba(168, 85, 247, 0.6);
    color: #fff;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.25);
}

.community-feed-tab.active i {
    color: #fff;
}

.community-search {
    background: rgba(20, 19, 36, 0.9);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: var(--shadow-md);
}

.community-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 8px 10px;
    background: var(--bg-secondary);
}

.community-search-input-wrap i {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.community-search-input-wrap input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
}

.community-search-results {
    margin-top: 8px;
    display: grid;
    gap: 6px;
}

.community-search-item {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 8px;
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.community-search-item:hover {
    border-color: rgba(124,58,237,0.6);
    background: rgba(124,58,237,0.12);
}

.community-search-empty {
    padding: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.community-composer {
    padding: 12px;
    position: sticky;
    top: calc(var(--header-height) + 16px);
    z-index: 4;
}

.community-composer textarea {
    width: 100%;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px 12px;
    min-height: 92px;
    resize: vertical;
}

.composer-footer {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.composer-footer span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.community-feed {
    padding: 12px;
    display: grid;
    gap: 10px;
}

.community-post {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px;
    background: linear-gradient(130deg, rgba(255,255,255,0.03), rgba(124,58,237,0.07));
    animation: postDrop 0.4s ease;
}

@keyframes postDrop {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.community-post-head {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.community-post-head:hover strong {
    color: var(--accent-secondary);
}

.community-post-head p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.community-post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

.community-post-body {
    white-space: pre-wrap;
    line-height: 1.5;
    color: var(--text-primary);
}

.community-post-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.btn-like,
.btn-delete {
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-like.active,
.btn-like:hover {
    color: #fff;
    border-color: rgba(236, 72, 153, 0.8);
    background: rgba(236, 72, 153, 0.2);
}

.btn-delete:hover {
    color: #fff;
    border-color: rgba(239,68,68,0.9);
    background: rgba(239,68,68,0.24);
}

.community-panel {
    padding: 14px;
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + 16px);
}

.community-panel h3 {
    font-size: 0.95rem;
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.community-suggestion {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
    background: rgba(255,255,255,0.02);
    cursor: pointer;
}

.community-suggestion:hover {
    border-color: rgba(124,58,237,0.55);
    background: rgba(124,58,237,0.1);
}

.community-suggestion p {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.community-empty,
.community-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 10px;
}

.community-empty i,
.community-loading i {
    font-size: 2rem;
    color: var(--accent-secondary);
    margin-bottom: 8px;
    display: block;
}

@media (max-width: 1200px) {
    .community-layout {
        grid-template-columns: 1fr 260px;
    }

    .community-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .community-layout {
        grid-template-columns: 1fr;
    }

    .community-side {
        grid-column: 1 / -1;
    }

    .community-composer {
        position: static;
    }

    .community-feed-tabs {
        width: 100%;
        display: flex;
    }

    .community-feed-tab {
        flex: 1;
        justify-content: center;
    }
}
