/* community.css - Premium Dashboard Layout */

/* --- TOPBAR OVERRIDES --- */
.community-search {
    position: relative;
    width: 300px;
}

.community-search input {
    padding-right: 44px !important;
}

/* --- MAIN LAYOUT --- */
.community-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.community-main-column, .community-widgets {
    min-width: 0; /* Prevents CSS grid blowout */
}

/* --- TABS --- */
.community-tabs-container {
    border-bottom: 2px solid var(--fellow-line);
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.community-tabs-container::-webkit-scrollbar {
    display: none;
}

.community-tabs {
    display: flex;
    gap: 32px;
    white-space: nowrap;
}

.community-tabs button {
    background: transparent;
    border: 0;
    padding: 0 0 16px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--fellow-muted);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.community-tabs button:hover {
    color: var(--fellow-text);
}

.community-tabs button.active {
    color: var(--fellow-pink);
}

.community-tabs button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--fellow-pink);
    border-radius: 2px 2px 0 0;
}

/* --- HERO BANNER --- */
.community-hero {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
    border-radius: 20px;
    padding: 32px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 60%;
}

.hero-content h2 {
    margin: 0 0 12px;
    font-size: 1.4rem;
    color: var(--fellow-text);
    line-height: 1.4;
}

.hero-content p {
    margin: 0 0 24px;
    font-size: 0.95rem;
    color: var(--fellow-muted);
}

.hero-content .btn-primary-pink {
    padding: 10px 20px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-illustration {
    position: absolute;
    right: 20px;
    bottom: 0;
    height: 120%;
    max-height: 250px;
    object-fit: contain;
    z-index: 1;
}

/* --- HEADERS & LINKS --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--fellow-text);
}

.link-all {
    font-size: 0.85rem;
    color: var(--fellow-pink);
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- POPULAR GROUPS --- */
.popular-groups-container {
    margin-bottom: 32px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 8px; /* For shadow */
    margin-left: -4px;
    padding-left: 4px;
}

.popular-groups-container::-webkit-scrollbar {
    display: none;
}

.popular-groups {
    display: flex;
    gap: 16px;
}

.group-card {
    background: #fff;
    border: 1px solid var(--fellow-line);
    border-radius: 16px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 200px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(170, 52, 104, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.group-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(170, 52, 104, 0.06);
}

.group-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    margin-bottom: 16px;
}

.pink-gradient { background: linear-gradient(135deg, #fbcfe8, #f43f5e); }
.purple-gradient { background: linear-gradient(135deg, #e9d5ff, #a855f7); }
.orange-gradient { background: linear-gradient(135deg, #fed7aa, #f97316); }
.green-gradient { background: linear-gradient(135deg, #bbf7d0, #22c55e); }
.outline-dash {
    background: #fff;
    border: 2px dashed #cbd5e1;
    color: #94a3b8;
}

.group-card h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: var(--fellow-text);
    line-height: 1.3;
}

.member-count {
    font-size: 0.75rem;
    color: var(--fellow-muted);
    margin-bottom: 12px;
}

.group-card p {
    margin: 0 0 20px;
    font-size: 0.75rem;
    color: var(--fellow-muted);
    line-height: 1.5;
    flex-grow: 1;
}

.group-card .btn-outline {
    width: 100%;
    padding: 8px 0;
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* --- DISCUSSIONS --- */
.discussion-header {
    margin-bottom: 24px;
}

.inline-tabs {
    display: flex;
    gap: 16px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
}

.inline-tabs button {
    background: transparent;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fellow-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.inline-tabs button.active {
    background: #fff;
    color: var(--fellow-pink);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.discussion-list {
    display: flex;
    flex-direction: column;
}

.discussion-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--fellow-line);
}

.discussion-item:last-child {
    border-bottom: none;
}

.discuss-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.discuss-content {
    flex: 1;
    min-width: 0;
}

.discuss-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.discuss-title-row h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--fellow-text);
}

.badge-tag {
    font-size: 0.65rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 6px;
}

.badge-tag.pink { background: #fce7f3; color: #db2777; }
.badge-tag.purple { background: #f3e8ff; color: #9333ea; }
.badge-tag.orange { background: #ffedd5; color: #ea580c; }
.badge-tag.green { background: #dcfce7; color: #16a34a; }

.discuss-meta {
    font-size: 0.8rem;
    color: var(--fellow-muted);
}

.discuss-meta strong {
    color: var(--fellow-text);
    font-weight: 600;
}

.discuss-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.discuss-actions button {
    background: transparent;
    border: none;
    color: var(--fellow-muted);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.discuss-actions button:hover {
    color: var(--fellow-pink);
}

.discuss-footer {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

/* --- WIDGETS --- */
.community-widgets {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget-card {
    background: #fff;
    border: 1px solid var(--fellow-line);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(170, 52, 104, 0.03);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}

.widget-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--fellow-text);
}

.widget-header a {
    font-size: 0.75rem;
    color: var(--fellow-pink);
    text-decoration: none;
    font-weight: bold;
}

/* Contributors */
.contributors-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contributor-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    transition: background 0.2s;
}

.contributor-item.active {
    background: #fdf2f8;
}

.rank {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--fellow-muted);
    width: 20px;
    text-align: center;
}

.rank-1 { color: #eab308; }
.rank-2 { color: #94a3b8; }
.rank-3 { color: #d97706; }

.contributor-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.contributor-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contributor-info strong {
    font-size: 0.85rem;
    color: var(--fellow-text);
    margin-bottom: 2px;
}

.pink-text {
    color: #db2777 !important;
}

.contributor-info span {
    font-size: 0.7rem;
    color: var(--fellow-muted);
}

.contributor-points {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--fellow-muted);
}

.contributor-points i.gold { color: #eab308; font-size: 1rem; }
.contributor-points i.silver { color: #94a3b8; font-size: 1rem; }
.contributor-points i.bronze { color: #d97706; font-size: 1rem; }
.contributor-points i.fa-ellipsis-vertical { color: #cbd5e1; }

/* Community Events Widget */
.comm-events-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comm-event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--fellow-line);
}

.comm-event-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comm-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fdf2f8;
    padding: 8px 12px;
    border-radius: 10px;
    min-width: 50px;
}

.comm-event-date strong { font-size: 1.2rem; line-height: 1; }
.comm-event-date span { font-size: 0.65rem; font-weight: bold; margin-top: 4px; }

.comm-event-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.comm-event-info h4 {
    margin: 0 0 4px;
    font-size: 0.85rem;
    color: var(--fellow-text);
}

.comm-event-info span {
    font-size: 0.7rem;
    color: var(--fellow-muted);
}

.btn-outline.sm {
    padding: 4px 12px;
    font-size: 0.75rem;
}

/* Topics Widget */
.topics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.topic-pill {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--fellow-line);
}

.purple-text { color: #9333ea; font-size: 0.85rem; margin-top: 2px;}

.topic-info {
    display: flex;
    flex-direction: column;
}

.topic-info strong {
    font-size: 0.8rem;
    color: var(--fellow-text);
    margin-bottom: 2px;
}

.topic-info span {
    font-size: 0.65rem;
    color: var(--fellow-muted);
}


/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .community-layout {
        grid-template-columns: 1fr 300px;
        gap: 20px;
    }
}

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

    .community-widgets {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .community-hero {
        flex-direction: column;
        text-align: center;
        padding: 32px 20px;
    }

    .hero-content {
        max-width: 100%;
        margin-bottom: 24px;
    }

    .hero-content h2 {
        font-size: 1.2rem;
    }

    .hero-illustration {
        position: relative;
        right: auto;
        height: 180px;
    }

    .discussion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .discussion-item {
        flex-direction: column;
    }

    .discuss-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 8px;
        padding-left: 60px; /* Aligns with text */
    }
}

@media (max-width: 500px) {
    .discuss-actions {
        padding-left: 0;
    }
}
