/* community.css - Community and Trip Story Styles */

.community-hero {
    padding: 8rem 2rem 4rem;
    text-align: center;
    background: linear-gradient(135deg, var(--dark) 0%, #1e293b 100%);
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.community-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    margin: 2rem auto;
    backdrop-filter: blur(10px);
}

.locked-content {
    text-align: center;
    padding: 4rem 2rem;
}

.lock-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Trip Story Viewport Layout */
.story-container {
    display: flex;
    flex: 1;
    height: calc(100vh - 80px);
    position: relative;
}

.story-content {
    flex: 1;
    max-width: 500px;
    background: var(--dark-lighter);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    position: relative;
    z-index: 10;
}

#story-map {
    flex: 1;
    height: 100%;
    z-index: 1;
}

/* Timeline */
.timeline {
    padding: 2rem;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 2rem;
    bottom: 2rem;
    left: 2rem;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-entry {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 3rem;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
}

.timeline-entry:hover,
.timeline-entry.active {
    opacity: 1;
}

.timeline-dot {
    position: absolute;
    left: -5px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid var(--dark);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    transition: transform 0.3s;
}

.timeline-entry.active .timeline-dot {
    transform: scale(1.5);
    background: #fff;
}

.entry-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s;
}

.entry-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.entry-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: zoom-in;
}

.story-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
}

/* Social & Reactions */
.stat-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.reaction-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .story-container {
        flex-direction: column-reverse;
    }

    .story-content {
        max-width: 100%;
        height: 50%;
    }

    #story-map {
        height: 50%;
    }
}

/* Forum Styles */
.forum-category-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.theme-light .forum-category-card,
.light-mode .forum-category-card {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-color: rgba(15, 23, 42, 0.08);
}

.forum-category-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.sub-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.sub-cat-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 0.8rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s, color 0.2s;
}

.theme-light .sub-cat-item,
.light-mode .sub-cat-item {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.sub-cat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

.theme-light .sub-cat-item:hover,
.light-mode .sub-cat-item:hover {
    background: #e2e8f0;
    color: var(--primary);
}

/* Thread Lists */
.thread-row {
    display: grid;
    grid-template-columns: 1fr 150px 100px;
    /* Title, Author, Replies */
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: var(--light);
}

.theme-light .thread-row,
.light-mode .thread-row {
    border-bottom-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.thread-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.theme-light .thread-row:hover,
.light-mode .thread-row:hover {
    background: rgba(15, 23, 42, 0.03);
}

.thread-header {
    font-weight: 600;
    opacity: 0.7;
    font-size: 0.85rem;
    border-bottom: 2px solid var(--border);
}

.thread-title {
    font-weight: 500;
    color: var(--primary);
    font-size: 1.05rem;
}

.pinned {
    border-left: 3px solid var(--gold);
}

/* Forum Posts */
.post-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1.5rem;
}

.theme-light .post-card,
.light-mode .post-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.post-author {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.post-content {
    flex: 1;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--light);
    white-space: pre-wrap;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.edit-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 0.5rem;
    display: block;
    font-style: italic;
}

.post-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

/* Activity Feed */
.activity-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.theme-light .activity-card,
.light-mode .activity-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.activity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    border-color: var(--primary) !important;
}

.image-carousel {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.image-carousel::-webkit-scrollbar {
    height: 6px;
}

.image-carousel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.image-carousel img {
    transition: transform 0.2s;
}

.image-carousel img:hover {
    transform: scale(1.02);
}

.mention-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.mention-link:hover {
    text-decoration: underline;
}

/* Forum Tabs & Navigation */
.forum-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.forum-tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: 0.3s;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.forum-tab:hover {
    color: var(--light);
}

.forum-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.forum-tab .badge {
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

/* Inbox Layout */
.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inbox-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.theme-light .inbox-item,
.light-mode .inbox-item {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.inbox-item:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: var(--primary);
}

.theme-light .inbox-item:hover,
.light-mode .inbox-item:hover {
    background: #f8fafc;
    border-color: var(--primary);
}

.inbox-item.unread {
    border-left: 4px solid var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

.inbox-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.theme-light .inbox-icon,
.light-mode .inbox-icon {
    background: rgba(16, 185, 129, 0.1);
}

/* Story & Post Signatures */
.post-signature {
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.4;
}

.post-signature p {
    margin-bottom: 0.5rem;
}

.post-signature p:last-child {
    margin-bottom: 0;
}

.story-tabs {
    display: flex;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--dark-lighter);
}

.story-tab {
    padding: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.story-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scrollbar-width: thin;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Story Layout Light Mode Adjustments */
.theme-light .story-container,
.light-mode .story-container {
    background: #f8fafc;
}

.theme-light .story-content,
.light-mode .story-content {
    background: #ffffff;
    border-right-color: rgba(15, 23, 42, 0.08);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
}

.theme-light .story-header,
.light-mode .story-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.theme-light .trip-info-card,
.light-mode .trip-info-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.theme-light .story-tabs,
.light-mode .story-tabs {
    background: #ffffff;
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.theme-light .story-tab,
.light-mode .story-tab {
    color: #64748b;
}

.theme-light .story-tab.active,
.light-mode .story-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ==========================================================================
   COMMUNITY & FORUM MOBILE RESPONSIVENESS (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .community-hero {
        padding: 5rem 1rem 2rem;
        min-height: 40vh;
    }

    .community-card {
        padding: 1.25rem;
        margin: 1rem auto;
        border-radius: 16px;
    }

    .forum-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
        margin-bottom: 1.2rem;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .forum-tabs::-webkit-scrollbar {
        display: none;
    }

    .forum-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .sub-cat-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .thread-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.85rem 1rem;
    }

    .thread-header {
        display: none;
    }

    .thread-title {
        font-size: 0.98rem;
    }

    .post-card {
        flex-direction: column;
        gap: 1rem;
        padding: 1.2rem;
    }

    .post-author {
        width: 100%;
        flex-direction: row;
        text-align: left;
        align-items: center;
        gap: 0.8rem;
        padding-bottom: 0.8rem;
        border-bottom: 1px solid var(--border);
    }

    .post-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .inbox-item {
        padding: 1rem;
        gap: 0.8rem;
    }

    .inbox-icon {
        width: 38px;
        height: 38px;
    }

    .story-container {
        flex-direction: column-reverse;
        height: auto;
        min-height: calc(100vh - 70px);
        margin-top: 70px;
    }

    .story-content {
        flex: 1 1 auto;
        max-width: 100%;
        height: 50vh;
        border-right: none;
        border-top: 1px solid var(--border);
    }

    #story-map {
        height: 40vh;
        min-height: 250px;
    }

    .trip-info-card {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        border-radius: 12px;
        margin-bottom: 1rem;
        box-shadow: none;
    }
}