/* =========================
   COMMUNITY PAGE STYLES
========================= */

body {
    font-size: 17px;
}

.community-section {
    padding: 60px 0;
}

.community-header {
    text-align: center;
    margin-bottom: 4rem;
}

.community-layout {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(350px, 1fr);
    gap: 2rem;
    align-items: start;
}

.community-header .section-title {
    margin-bottom: 12px;
    font-size: 4rem;
}

.community{
    font-size: 1.3rem;
    margin-right: 8px;
}

.community-header .section-subtitle {
    opacity: 0.75;
    max-width: 650px;
    margin: 0 auto;
    font-size: 1.35rem;
}

.community-main,
.community-sidebar {
    animation: fadeUp 0.6s ease;
    min-width: 380px;

}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.community-section .container {
    max-width: 1700px;
    width: 94%;
    margin: 0 auto;
}

/* =========================
   GLASS CARD
========================= */

.glass-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;

    padding: 1.5rem;

    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 36px rgba(139, 92, 246, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.3);
}

/* =========================
   CREATE POST
========================= */

.create-post-card {
    width: 100%;
    margin-bottom: 2rem;
}

.create-post-card h3 {
    margin-bottom: 1rem;
    font-size: 1.6rem;
    font-weight: 700;
}

.create-post-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.create-post-form input,
.create-post-form textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: white;
    font-size: 1.05rem;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s ease;
}

.create-post-form input::placeholder,
.create-post-form textarea::placeholder {
    font-size: 1rem;
}

.create-post-form input:focus,
.create-post-form textarea:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139,92,246,0.2);
}

.create-post-form textarea {
    resize: vertical;
    min-height: 120px;
}

.create-post-form input:hover,
.create-post-form textarea:hover {
    border-color: rgba(139, 92, 246, 0.4);
}

.post-submit-btn {
    align-self: flex-start;

    padding: 12px 28px;
    border-radius: 14px;

    border: none;
    cursor: pointer;

    font-weight: 600;
    font-size: 1.05rem;

    color: white;

    background: linear-gradient(
        135deg,
        #8b5cf6,
        #6366f1
    );

    box-shadow:
        0 4px 14px rgba(139,92,246,0.35);

    transition: all 0.3s ease;
}

.post-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 20px rgba(139,92,246,0.45);
}

.post-submit-btn:active {
    transform: translateY(0);
}

.create-post-card,
.post-card,
.sidebar-card {
    padding: 2.25rem;
}

/* =========================
   FEED HEADER
========================= */

.feed-header-wrapper {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem !important;
}

.feed-header-wrapper h3 {
    font-size: 1.8rem;
    font-weight: 700;
}

.search-filter-container {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.search-input {
    min-width: 280px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139,92,246,0.2);
    outline: none;
}

/* =========================
   POSTS
========================= */

.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1rem;
}

.post-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 2.5rem;
    transition: all 0.3s ease;
}

.post-card:hover {
    border-color: rgba(139,92,246,0.35);
    transform: translateY(-4px);
    box-shadow:
        0 8px 24px rgba(139,92,246,0.15);
}

.post-title {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.4;
}

.post-content {
    line-height: 1.7;
    margin: 1rem 0;
    font-size: 1.15rem;
    line-height: 1.9;
}

.post-meta {
    opacity: 0.8;
    font-size: 1.1rem;
}

/* =========================
   SIDEBAR
========================= */

.community-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-self: start;
    position: sticky;
    top: 100px;
}

.sidebar-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.guidelines-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guidelines-list li {
    margin-bottom: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

/* =========================
   TAGS
========================= */

.post-tag,
.tag {
    font-size: 0.95rem;
    font-weight: 500;
}
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag,
.tags-cloud span,
.tags-cloud button {
    background: rgba(139,92,246,0.12);
    color: #d8b4fe;
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tag:hover,
.tags-cloud span:hover,
.tags-cloud button:hover {
    background: rgba(139,92,246,0.25);
    transform: translateY(-2px);
}

.vote-section,
.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
}

.vote-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: white;
    cursor: pointer;
    font-size: 0.95rem;
}

.comment-count {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
}

.comment-input {
    width: 380px;
    max-width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: white;
}

/* =========================
   POST HEADER
========================= */

.post-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
}

.post-meta {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* =========================
   TAGS
========================= */

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1.2rem 0;
}

.post-tag {
    background: rgba(139,92,246,0.15);
    color: #c4b5fd;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.3s;
}

.post-tag:hover {
    background: rgba(139,92,246,0.3);
}

/* =========================
   ACTION BAR
========================= */

.post-actions {
    display: flex !important;
    align-items: center;
    gap: 15px;
    margin-top: 1rem;
}

.vote-actions {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.06);
    padding: 8px 16px !important;
    border-radius: 999px !important;
    font-size: 1rem;
}

.post-action-btn {
    border: none;
    background: rgba(255,255,255,0.06);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    min-width: 42px;
    min-height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
}

.post-action-btn:hover {
    background: rgba(139,92,246,0.25);
}

/* =========================
   COMMENTS
========================= */

.comments-section {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1rem;
    display: none;
}

.comments-section.active {
    display: block;
}

.comments-list {
    margin-bottom: 1rem;
}

.comment {
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.8rem;
}

.comment-meta {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-bottom: 6px;
}

.comment-text {
    line-height: 1.6;
    font-size: 1.05rem;
}

/* =========================
   COMMENT FORM
========================= */

.add-comment-form {
    display: flex;
    gap: 12px;
    margin-top: 1rem;
}

.add-comment-form input {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: white;
}

.add-comment-form button {
    min-width: 50px;
    height: 50px;

    border: none;
    border-radius: 12px;

    background: linear-gradient(
        135deg,
        #8b5cf6,
        #6366f1
    );

    color: white;
    cursor: pointer;
}
/* =========================
   RESPONSIVE
========================= */

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

    .community-sidebar {
        position: static;
    }

    .community-main {
        order: 1;
    }
}

@media (max-width: 768px) {

    .feed-header-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .search-filter-container {
        width: 100%;
    }

    .search-input {
        width: 100%;
        min-width: unset;
    }

    .post-submit-btn {
        width: 100%;
    }

    .glass-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .create-post-form input,
    .create-post-form textarea {
        padding: 12px;
        font-size: 0.9rem;
    }
    .post-submit-btn {
        padding: 12px;
    }
}


/* =========================
   LIGHT MODE
========================= */

body.light-mode .glass-card,
body.light-mode .post-card {
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .create-post-form input,
body.light-mode .create-post-form textarea,
body.light-mode .search-input,
body.light-mode .add-comment-form input {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #d1d5db;
}

body.light-mode .post-title,
body.light-mode .sidebar-card h3,
body.light-mode .community-header,
body.light-mode .post-content,
body.light-mode .comment-text,
body.light-mode .guidelines-list li {
    color: #111827;
}

body.light-mode .post-meta,
body.light-mode .comment-meta,
body.light-mode .section-subtitle {
    color: #6b7280;
}

body.light-mode .post-action-btn {
    background: #f3f4f6;
    color: #111827;
}

body.light-mode .vote-actions {
    background: #f3f4f6;
}

body.light-mode .post-tag,
body.light-mode .tag {
    background: rgba(139, 92, 246, 0.12);
    color: #6d28d9;
}

body.light-mode .comments-section {
    border-top: 1px solid #e5e7eb;
}

body.light-mode .comment {
    background: #f9fafb;
}