@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900');
/* ── HERO ──────────────────────────────────────── */
.hero {
    position: relative;
    width: 100%;
    height: 50vh;
    background-image: url("Pokemon Community Hero.png");
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    border-bottom: 2px solid #d4af37;
}

@media (max-width: 768px) { .hero { height: 250px; } }

/* ── LAYOUT ────────────────────────────────────── */
.community-main-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 1440px;
    width: 100%;
    margin: 70px auto;
    padding: 0 20px;
    animation: pageFadeIn 0.5s ease-out both;
    box-sizing: border-box;
    gap: 0;
}

.community-columns {
    display: flex;
    align-items: flex-start;
    gap: 36px;
    width: 100%;
    margin-top: 60px;
}

.comm-center-col {
    flex: 4;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 20px;
}

.comm-side-col {
    flex: 1;
    max-width: 320px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

/* ── SHARED BUBBLE ─────────────────────────────── */
.comm-bubble {
    background: #1E2329;
    border: 2px solid #d4af37;
    border-radius: 16px;
    padding: 20px;
    color: white;
}

/* ── TAB NAV ───────────────────────────────────── */
.comm-nav {
    display: flex;
    padding: 6px;
    gap: 6px;
    background: #140c20;
}

.comm-tab {
    flex: 1;
    padding: 10px 0;
    background: #1E2329;
    border: none;
    border-radius: 10px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    letter-spacing: 1px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.comm-tab:hover {
    color: #d4af37;
    background: #1E2329;
}
.comm-tab.active {
    background: #1E2329;
    color: #f5d06b;
    border: 2px solid #d4af37;
}

/* ── POST COMPOSER ─────────────────────────────── */
.create-post {
    padding: 16px;
    background: #1E2329;
    border: 2px solid #d4af37;
}

.post-input-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.comm-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid #d4af37;
    background-size: cover !important;
    background-position: center !important;
}

.create-post textarea {
    flex: 1;
    min-height: 120px;
    background: rgba(255,255,255,0.06);
    border: 2px solid #C89B2A;
    border-radius: 12px;
    color: #F8F9FA;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Radjhani', sans-serif;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}
.create-post textarea:focus { border-color: #d4af37; }
.create-post textarea::placeholder { color: #F8F9FA; }

.upload-area {
    border: 2px dashed #d4af37;
    padding: 14px 16px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 10px;
    color: white;
    font-size: 14px;
}
.upload-area.dragover {
    background: black;
    border-color: #d4af37;
    color: #d4af37;
}
.upload-area p { margin: 0; }

.preview-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.preview-thumb {
    width: 76px;
    height: 76px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    position: relative;
    border: 2px solid #d4af37;
    overflow: hidden;
}
.preview-thumb video { width: 100%; height: 100%; object-fit: cover; }

.preview-remove {
    position: absolute;
    top: 3px; right: 3px;
    background: rgba(255,68,68,0.9);
    color: white;
    border-radius: 50%;
    width: 18px; height: 18px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    display: none;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #8B6A18, #f5d06b);
    transition: width 0.2s;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    gap: 12px;
}

.post-actions-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.composer-icon-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 2px solid #d4af37;
    border-radius: 20px;
    color: rgba(212,175,55,0.75);
    font-size: 14px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.composer-icon-btn:hover {
    background: rgba(212,175,55,0.1);
    border-color: #d4af37;
    color: #d4af37;
    transform: translateY(-1px);
}

.composer-clear-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 2px solid #d4af37;
    border-radius: 20px;
    color: rgba(248,113,113,0.65);
    font-size: 14px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.composer-clear-btn:hover {
    background: rgba(248,113,113,0.1);
    border-color: #f87171;
    color: #f87171;
    transform: translateY(-1px);
}

.post-btn {
    background: #d4af37;
    color: #0a0408;
    border: none;
    padding: 9px 28px;
    border-radius: 20px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    box-shadow: none;
}
.post-btn:hover    { background: #f5d06b; transform: translateY(-1px); }
.post-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── FEED CONTAINER ────────────────────────────── */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.feed-loading,
.feed-empty {
    text-align: center;
    color: white;
    font-size: 14px;
    padding: 40px 0;
    letter-spacing: 0.5px;
}

/* ── POST CARD ─────────────────────────────────── */
/* background, border, border-radius inherited from .comm-bubble */
.post-card {
    padding: 0;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.post-card:hover {
    border-color: rgba(212,175,55,0.5);
    box-shadow: 0 4px 24px rgba(0,0,0,0.45);
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px 10px;
}

.post-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #d4af37;
    flex-shrink: 0;
}

.post-card-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.post-card-username {
    font-size: 14px;
    font-weight: 700;
    color: #f5d06b;
    letter-spacing: 0.3px;
}

.post-card-time {
    font-size: 12px;
    color: #F8F9FA;
}

.post-delete-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.2);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.post-delete-btn:hover {
    color: #f87171;
    background: rgba(239,68,68,0.1);
}

.post-card-caption {
    padding: 0 16px 12px;
    font-family: 'Radjhani', sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: white;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── MEDIA CAROUSEL ────────────────────────────── */
.post-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 380px;
    background: #0a0408;
    cursor: pointer;
}

.post-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
    will-change: transform;
}

.post-media-slide {
    width: 100%;
    flex-shrink: 0;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    border: 2px solid #d4af37;
    color: #F8F9FA;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s;
}
.carousel-btn:hover { background: rgba(0,0,0,0.75); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}
.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active {
    background: white;
    transform: scale(1.3);
}

/* ── POST ACTIONS BAR ──────────────────────────── */
.post-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px 14px;
    border-top: 2px solid #d4af37;
}

.post-card-actions-left {
    display: flex;
    gap: 18px;
    align-items: center;
}

.post-like-btn,
.post-share-btn,
.post-save-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px;
    transition: transform 0.15s;
    color: white;
    line-height: 1;
}
.post-like-btn:hover,
.post-share-btn:hover,
.post-save-btn:hover   { transform: scale(1.2); }

.like-count {
    font-size: 14px;
    color: #F8F9FA;
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

.post-like-btn.liked .like-icon { filter: drop-shadow(0 0 4px rgba(255,60,60,0.6)); }
.post-save-btn.saved             { filter: drop-shadow(0 0 4px rgba(255,215,0,0.5)); }

/* ── SIDEBAR ───────────────────────────────────── */
.comm-side-col h4 {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    letter-spacing: 2px;
    color: #d4af37;
    margin: 0 0 12px;
}

.suggestion-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suggestion-list li {
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.suggestion-list li:hover {
    background: rgba(212,175,55,0.1);
    color: #f5d06b;
}

.suggestion-list li.active {
    background: rgba(212,175,55,0.15);
    color: #f5d06b;
    border: 1px solid rgba(212,175,55,0.35);
}

.topic-name { flex: 1; }
 
.topic-count {
    font-size: 14px;
    background: rgba(212,175,55,0.15);
    color: rgba(212,175,55,0.7);
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}
.suggestion-list li.active .topic-count {
    background: rgba(212,175,55,0.3);
    color: #F8F9FA;
}

@media (max-width: 900px) {
    .comm-side-col { display: none; }
    .community-columns {
        flex-direction: column;
        align-items: stretch;
    }
}
@media (max-width: 600px) {
    .community-main-wrapper { padding: 10px; margin: 20px auto; }

    /* ── POST CARD — scale carousel and spacing down for phones ── */
    .post-carousel {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .post-card-header {
        padding: 10px 12px 8px;
        gap: 8px;
    }

    .post-card-avatar {
        width: 32px;
        height: 32px;
    }

    .post-card-username { font-size: 13px; }
    .post-card-time { font-size: 11px; }

    .post-card-caption {
        padding: 0 12px 10px;
        font-size: 14px;
    }

    .post-card-actions {
        padding: 8px 12px 10px;
    }

    .post-card-actions-left { gap: 12px; }

    .post-like-btn,
    .post-share-btn,
    .post-save-btn {
        font-size: 17px;
    }

    .carousel-btn {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .feed-container { gap: 12px; }
}

/* ── LIGHTBOX ──────────────────────────────────── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.lightbox-overlay.open { opacity: 1; }

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(212,175,55,0.15);
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
}
.lightbox-overlay.open .lightbox-img { transform: scale(1); }

.lightbox-close {
    position: absolute;
    top: 20px; right: 24px;
    background: rgba(255,255,255,0.08);
    border: 2px solid #F8F9FA;
    color: white;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); }

/* ── ANIMATIONS ────────────────────────────────── */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
