/* Forum App CSS */
#forum {
    background-color: #fff;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}
#forum.active {
    display: flex;
}

.forum-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid #dbdbdb;
    position: relative;
}
.forum-top-nav .forum-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.forum-logo {
    font-family: 'Brush Script MT', 'Comic Sans MS', cursive;
    font-size: 26px;
    font-weight: 500;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.nav-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.forum-nav-icons {
    display: flex;
    gap: 20px;
    font-size: 24px;
}

.forum-stories-container {
    display: flex;
    overflow-x: auto;
    padding: 10px 0 10px 15px;
    background: #fff;
    border-bottom: 1px solid #dbdbdb;
    gap: 15px;
    flex-shrink: 0;
}
.forum-stories-container::-webkit-scrollbar {
    display: none;
}
.forum-story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
    cursor: pointer;
    position: relative;
}
.forum-story-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
}
body.forum-not-ins .forum-story-ring {
    background: #e0e0e0;
}
.forum-story-ring.my-story {
    background: transparent;
    border: none;
}
.forum-story-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #ccc;
    object-fit: cover;
}
.forum-story-name {
    font-size: 11px;
    color: #262626;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.forum-story-add {
    position: absolute;
    bottom: 15px;
    right: 0;
    width: 18px;
    height: 18px;
    background: #0095f6;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 10px;
}

.forum-tab-bar {
    display: flex;
    justify-content: space-between;
    background: #fff;
    border-top: 1px solid #eaeaea;
    padding: 10px 20px calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 10;
    flex-shrink: 0;
}
.forum-tab-item {
    color: #262626;
    font-size: 24px;
}
.forum-tab-item.active {
    color: #262626;
}
.forum-tab-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
}
.forum-tab-item.active .forum-tab-avatar {
    border: none;
}
.forum-post {
    background: #fff;
    border-bottom: 1px solid #dbdbdb;
    padding: 0 0 10px 0;
    margin-bottom: 0;
}
.forum-post-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
}
.forum-post-avatar-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    flex-shrink: 0;
}
.forum-post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    object-fit: cover;
    border: none;
}
.forum-post-author-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.forum-post-author {
    font-weight: 600;
    font-size: 13px;
    color: #262626;
}
.forum-post-music {
    font-size: 11px;
    color: #262626;
}
.forum-post-follow {
    font-size: 13px;
    font-weight: 600;
    color: #262626;
    background: #efefef;
    padding: 4px 12px;
    border-radius: 6px;
    margin-right: 10px;
}
.forum-post-more {
    font-size: 14px;
    color: #262626;
}
.forum-post-images {
    width: 100%;
    display: grid;
    gap: 2px;
    align-content: start;
}
.forum-post-images.img-count-1 {
    grid-template-columns: 1fr;
}
.forum-post-images.img-count-2 {
    grid-template-columns: 1fr 1fr;
}
.forum-post-images.img-count-3 {
    grid-template-columns: 1fr 1fr 1fr;
}
.forum-post-images.img-count-3 .forum-post-image-wrapper:first-child {
    grid-column: auto;
}
.forum-post-images.img-count-4 {
    grid-template-columns: 1fr 1fr;
}
.forum-post-image-wrapper {
    width: 100%;
    position: relative;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fafafa;
    overflow: hidden;
}
.forum-post-images.img-count-1 .forum-post-image-wrapper {
    padding-bottom: 0;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fafafa;
}
.forum-post-images.img-count-1 .forum-post-image-wrapper img {
    position: static;
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}
.forum-post-image-wrapper img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: contain;
}
.forum-post-actions {
    display: flex;
    padding: 10px 15px;
    gap: 15px;
    font-size: 24px;
    justify-content: space-between;
}
.forum-post-actions-left {
    display: flex;
    gap: 15px;
}
.forum-post-actions i {
    cursor: pointer;
    color: #262626;
}
.forum-post-actions .liked {
    color: #ff3040;
}
.forum-post-likes {
    font-weight: 600;
    padding: 0 15px 5px;
    font-size: 13px;
    color: #262626;
}
.forum-post-content {
    padding: 0 15px;
    font-size: 13px;
    line-height: 1.4;
    color: #262626;
}
.forum-post-content .author-name {
    font-weight: 600;
    margin-right: 5px;
}
.forum-post-time {
    color: #8e8e8e;
    font-size: 11px;
    padding: 5px 15px 0;
}

.forum-floating-add-btn {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s ease;
}

.forum-floating-add-btn:active {
    transform: scale(0.9);
}

.forum-share-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
}
.forum-share-panel {
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    max-height: 80%;
    overflow-y: auto;
    width: 100%;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.forum-post-content-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.forum-post-content-text.expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}
.forum-post-expand-btn {
    color: #8e8e8e;
    cursor: pointer;
    font-size: 13px;
    margin-top: 4px;
    display: inline-block;
}

.forum-msg-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #fafafa;
    min-height: 80px;
    flex-shrink: 0;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
