/* ==========================================================================
   SIKKHALAY STUDENT COMMUNITY POSTS & SOCIAL FEED ENGINE STYLESHEET
   Facebook-Grade Design Parity, 7-Emoji Reaction Dock, Rich Collages,
   Collapsible Comments, Full-Featured Composer & Lightbox
   ========================================================================== */

/* 1. Quick Composer Box */
.fb-post-composer {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fb-post-composer:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.fb-composer-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.fb-composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-primary);
    flex-shrink: 0;
}

.fb-composer-input-btn {
    flex: 1;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill, 9999px);
    padding: 9px 16px;
    text-align: left;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fb-composer-input-btn:hover {
    background: var(--bg-surface);
    border-color: var(--brand-primary);
    color: var(--text-main);
    box-shadow: 0 0 0 3px var(--brand-glow, rgba(79, 70, 229, 0.15));
}

.fb-composer-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding-top: 8px;
}

@media (max-width: 640px) {
    .fb-composer-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

.fb-quick-tool-btn {
    background: transparent;
    border: none;
    border-radius: var(--radius-sm, 6px);
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fb-quick-tool-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
}

.fb-quick-tool-btn i {
    font-size: 14px;
}

/* 2. Facebook Post Card */
.fb-post-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
    position: relative;
    margin-bottom: 12px;
}

.fb-post-card:hover {
    box-shadow: var(--shadow-md);
}

.fb-card-highlight {
    animation: highlightPost 1.8s ease;
}

@keyframes highlightPost {
    0% { border-color: var(--brand-primary); box-shadow: 0 0 16px rgba(67, 56, 202, 0.4); }
    100% { border-color: var(--border-color); box-shadow: var(--shadow-sm); }
}

.fb-card-hiding {
    opacity: 0;
    transform: scale(0.96) translateY(-10px);
    pointer-events: none;
}

/* Card Header */
.fb-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.fb-author-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.fb-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.fb-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border-color);
    display: block;
}

.fb-online-ring {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: #10B981;
    border: 2px solid var(--bg-surface);
    border-radius: 50%;
}

.fb-name-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.fb-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.fb-author-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-author-name:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

.fb-verified-badge {
    color: #2563EB;
    font-size: 12px;
    display: inline-flex;
}

[data-theme="dark"] .fb-verified-badge {
    color: #38BDF8;
}

.fb-sub-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

.fb-role-badge {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1px 7px;
    border-radius: var(--radius-pill, 9999px);
    border: 1px solid var(--border-color);
}

.fb-meta-bullet {
    color: var(--border-hover);
}

.fb-time-stamp {
    color: var(--text-muted);
}

.fb-audience-icon {
    color: var(--text-muted);
    font-size: 10.5px;
}

/* Right Actions: 3-dot menu and close button */
.fb-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    flex-shrink: 0;
}

.fb-icon-btn {
    background: transparent;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fb-icon-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
}

.fb-close-btn:hover {
    background: #FEE2E2;
    color: #DC2626;
}

/* 3-Dot Dropdown Menu */
.fb-dropdown-wrapper {
    position: relative;
}

.fb-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.16);
    width: 230px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 120;
    animation: fadeInTab 0.2s ease;
}

.fb-dropdown-menu.active {
    display: flex;
}

.fb-dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm, 6px);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
    width: 100%;
}

.fb-dropdown-item:hover {
    background: var(--bg-subtle);
}

.fb-dropdown-item i {
    font-size: 13px;
    color: var(--text-secondary);
    width: 16px;
    text-align: center;
}

.fb-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.fb-item-danger {
    color: #DC2626 !important;
}

.fb-item-danger i {
    color: #DC2626 !important;
}

.fb-item-danger:hover {
    background: #FEF2F2 !important;
}

/* Post Body & 120-Char Limit Expansion */
.fb-card-body {
    margin-bottom: 10px;
}

.fb-post-text {
    font-size: 13.5px;
    color: var(--text-main);
    line-height: 1.55;
    margin: 0;
    word-break: break-word;
}

.fb-post-text.is-clamped {
    display: inline;
}

.fb-ellipsis {
    color: var(--text-muted);
    letter-spacing: 1px;
}

.fb-see-more-btn {
    background: transparent;
    border: none;
    color: var(--brand-primary);
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 4px;
    display: inline-block;
    transition: text-decoration 0.15s ease;
}

.fb-see-more-btn:hover {
    text-decoration: underline;
}

.fb-hashtag {
    color: #2563EB;
    font-weight: 600;
    cursor: pointer;
}

[data-theme="dark"] .fb-hashtag {
    color: #38BDF8;
}

.fb-hashtag:hover {
    text-decoration: underline;
}

.fb-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.fb-tag-pill {
    background: rgba(67, 56, 202, 0.08);
    border: 1px solid rgba(67, 56, 202, 0.18);
    color: var(--brand-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 2.5px 8px;
    border-radius: var(--radius-pill, 9999px);
    cursor: pointer;
    transition: all 0.2s ease;
}

[data-theme="dark"] .fb-tag-pill {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.28);
    color: #818CF8;
}

.fb-tag-pill:hover {
    background: var(--brand-primary);
    color: #FFFFFF;
}

/* 3. Media Showcase */
.fb-card-media {
    margin: 8px -16px 10px -16px;
    background: #000000;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 641px) {
    .fb-card-media {
        margin: 8px 0 10px 0;
        border-radius: var(--radius-md, 8px);
        border: 1px solid var(--border-color);
    }
}

.fb-media-single img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.fb-media-single img:hover {
    opacity: 0.96;
}

/* Multi-Photo Collage */
.fb-media-collage {
    display: grid;
    gap: 3px;
    background: var(--border-color);
}

.fb-grid-2 {
    grid-template-columns: 1fr 1fr;
    height: 280px;
}

.fb-grid-3 {
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: 140px 140px;
    height: 283px;
}

.fb-grid-3 .fb-collage-item:first-child {
    grid-row: span 2;
}

.fb-grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 140px 140px;
    height: 283px;
}

.fb-collage-item {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
    background: #1E293B;
}

.fb-collage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.fb-collage-item:hover img {
    transform: scale(1.03);
}

.fb-more-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 24px;
    font-weight: 800;
}

/* Video Player */
.fb-video-container {
    position: relative;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    max-height: 400px;
}

.fb-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.fb-video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.fb-video-container.is-playing .fb-video-play-overlay {
    opacity: 0;
    pointer-events: none;
}

.fb-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    font-size: 18px;
    padding-left: 3px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.fb-play-btn:hover {
    transform: scale(1.1);
    background: #FFFFFF;
}

.fb-video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    padding: 2.5px 7px;
    border-radius: 4px;
}

/* 4. Reaction Summary Bar (Fully Responsive) */
.fb-reaction-bar,
.fb-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

.fb-reaction-icons-group,
.fb-summary-reactions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.fb-reaction-emojis-stack,
.fb-emoji-stack {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.fb-stacked-emoji,
.fb-stack-emoji {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin-right: -4px;
    background: var(--bg-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--bg-surface);
}

.fb-reaction-counter,
.fb-reaction-count {
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 6px;
    font-size: 13px;
}

.fb-no-reactions {
    font-size: 12px;
    color: var(--text-muted);
}

.fb-stats-right,
.fb-summary-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.fb-stat-item {
    cursor: pointer;
    transition: color 0.15s ease;
}

.fb-stat-item:hover {
    color: var(--text-main);
    text-decoration: underline;
}

.fb-stat-bullet {
    font-size: 7px;
}

/* 5. Three Interactive Buttons Bar */
.fb-card-action-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 3px 0;
    margin-top: 2px;
    gap: 2px;
}

.fb-action-btn {
    background: transparent;
    border: none;
    padding: 7px 8px;
    border-radius: var(--radius-sm, 6px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.fb-action-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
}

.fb-action-btn i {
    font-size: 14.5px;
}

.fb-btn-emoji {
    font-size: 16px;
    line-height: 1;
}

/* SMART FACEBOOK REACTION SYSTEM WITH POPPING DOCK */
.fb-react-wrapper {
    position: relative;
    width: 100%;
}

.fb-reactions-dock {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill, 9999px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.85);
    transform-origin: bottom left;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reveal on desktop hover or touch class */
.fb-react-wrapper:hover .fb-reactions-dock,
.fb-reactions-dock.dock-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.fb-dock-item {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fb-dock-emoji {
    font-size: 24px;
    line-height: 1;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

.fb-dock-label {
    position: absolute;
    bottom: 100%;
    margin-bottom: 6px;
    background: rgba(15, 23, 42, 0.9);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.fb-dock-item:hover {
    transform: scale(1.4) translateY(-8px);
}

.fb-dock-item:hover .fb-dock-label {
    opacity: 1;
}

/* Share dropdown */
.fb-share-wrapper {
    position: relative;
    width: 100%;
}

.fb-share-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.16);
    width: 220px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 120;
    animation: fadeInTab 0.2s ease;
}

.fb-share-dropdown.active {
    display: flex;
}

/* 6. Production Facebook Comment System */
.fb-comments-section {
    padding-top: 10px;
}

.fb-comments-divider {
    height: 1px;
    background: var(--border-color);
    margin-bottom: 12px;
}

.fb-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

/* Comment Item / Bubble */
.fb-comment-bubble {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.fb-comment-author-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid var(--border-color);
    background: var(--bg-subtle);
}

.fb-comment-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: calc(100% - 44px);
    min-width: 0;
}

.fb-comment-bubble-box {
    background: var(--bg-subtle);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    padding: 8px 14px;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.45;
    position: relative;
}

.fb-comment-author-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}

.fb-comment-author-name {
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text-main);
    text-decoration: none;
}

.fb-comment-badge {
    font-size: 10px;
    background: rgba(37, 99, 235, 0.1);
    color: #2563EB;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-pill, 9999px);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.fb-comment-text {
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
    white-space: pre-wrap;
}

.fb-comment-footer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-muted);
    padding-left: 8px;
    flex-wrap: wrap;
}

.fb-comment-action-btn {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s ease;
}

.fb-comment-action-btn:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

.fb-comment-action-btn.liked {
    color: var(--brand-primary);
}

.fb-comment-delete-btn {
    color: #ef4444 !important;
    opacity: 0.8;
}

.fb-comment-delete-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

.fb-comment-footer-bullet {
    font-size: 6px;
    color: var(--border-hover);
}

.fb-comment-time {
    color: var(--text-muted);
}

.fb-comment-likes-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    margin-left: 4px;
}

/* Threaded Reply Indicator */
.fb-reply-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--brand-primary);
    margin-bottom: 6px;
}

.fb-reply-indicator button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 0 4px;
}

.fb-reply-indicator button:hover {
    color: #ef4444;
}

/* Live Comment Composer */
.fb-comment-composer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
    position: relative;
}

.fb-comment-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.fb-comment-input-box {
    flex: 1;
    position: relative;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.fb-comment-input-box:focus-within {
    border-color: var(--brand-primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--brand-glow, rgba(79, 70, 229, 0.15));
}

.fb-comment-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.45;
    min-height: 24px;
    max-height: 120px;
    overflow-y: auto;
    padding: 2px 0;
}

.fb-comment-textarea::placeholder {
    color: var(--text-muted);
}

.fb-composer-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.fb-tool-btn {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
}

.fb-tool-btn:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.fb-submit-comment-btn {
    background: var(--brand-primary);
    color: #FFFFFF;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px var(--brand-glow, rgba(79, 70, 229, 0.25));
}

.fb-submit-comment-btn:hover {
    background: var(--brand-primary-hover);
    transform: scale(1.06);
}

/* Floating Math & Emoji Picker Trays */
.fb-symbols-tray {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    width: 280px;
    max-width: calc(100vw - 32px);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.2);
    z-index: 160;
    padding: 10px;
    animation: fadeInTab 0.2s ease;
}

.fb-tray-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    padding-bottom: 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.fb-tray-close-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.fb-tray-close-btn:hover {
    color: var(--text-main);
}

.fb-symbols-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}

.fb-symbol-btn {
    width: 38px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle);
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-main);
}

.fb-symbol-btn:hover {
    background: var(--brand-primary);
    color: #FFFFFF;
    border-color: var(--brand-primary);
    transform: scale(1.1);
}

/* 7. Create Post Modal */
.community-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.community-modal.active {
    display: flex;
}

.community-modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl, 16px);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.25);
    animation: fadeInTab 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.community-modal-header {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.community-modal-title {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 auto;
}

.community-modal-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-subtle);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.community-modal-close:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.community-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-primary);
}

.modal-audience-select {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 6px);
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
}

.modal-textarea-box {
    position: relative;
}

.modal-post-textarea {
    width: 100%;
    min-height: 110px;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.5;
    resize: vertical;
}

.modal-post-textarea::placeholder {
    color: var(--text-muted);
}

.modal-char-counter {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: right;
    margin-top: 3px;
}

.modal-char-counter.exceeds-120 {
    color: #D97706;
}

/* Attachment preview inside modal */
.modal-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md, 8px);
    border: 1px dashed var(--border-color);
}

.modal-photo-thumb {
    position: relative;
    width: 75px;
    height: 75px;
    border-radius: var(--radius-sm, 6px);
    overflow: hidden;
}

.modal-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-attach {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #FFFFFF;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-add-more-photo {
    width: 75px;
    height: 75px;
    border-radius: var(--radius-sm, 6px);
    border: 1.5px dashed var(--border-hover);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-secondary);
    font-size: 10.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-add-more-photo:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(79, 70, 229, 0.06);
}

.modal-video-preview {
    padding: 10px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md, 8px);
    border: 1px dashed var(--border-color);
    position: relative;
}

.preview-badge {
    font-size: 11px;
    font-weight: 700;
    color: #DC2626;
    background: #FEF2F2;
    padding: 2px 7px;
    border-radius: var(--radius-pill, 9999px);
}

/* Tag selectors */
.fb-tag-selector-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.fb-modal-tag-chip {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill, 9999px);
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.fb-modal-tag-chip.selected {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #FFFFFF;
}

/* Modal Add Tools Row */
.modal-add-toolbar {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-add-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.modal-tools-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-tool-icon-btn {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-tool-icon-btn:hover {
    background: var(--bg-subtle);
    transform: scale(1.08);
}

.community-modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
}

.btn-publish-post {
    width: 100%;
    background: var(--brand-primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md, 8px);
    padding: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px var(--brand-glow, rgba(79, 70, 229, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.btn-publish-post:hover:not(:disabled) {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
}

.btn-publish-post:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 8. Lightbox for enlarged photo view */
.community-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.community-lightbox.active {
    display: flex;
}

.community-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
}

.community-lightbox-content {
    position: relative;
    z-index: 10;
    max-width: 90vw;
    max-height: 90vh;
}

.community-lightbox-content img {
    max-width: 100%;
    max-height: 88vh;
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.community-lightbox-close {
    position: absolute;
    top: -38px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.community-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* 9. Toast Notification System */
.community-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 99999;
    pointer-events: none;
}

.community-toast {
    background: #0F172A;
    color: #FFFFFF;
    padding: 9px 16px;
    border-radius: var(--radius-pill, 9999px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    animation: toastFadeIn 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.community-toast i {
    color: #38BDF8;
    font-size: 14px;
}

.toast-fade-out {
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.25s ease;
}

@keyframes toastFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 10. Empty State */
.fb-empty-state {
    text-align: center;
    padding: 36px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    margin: 8px 0;
}

.fb-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(67, 56, 202, 0.1);
    color: var(--brand-primary);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
}

.fb-empty-state h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 6px 0;
}

.fb-empty-state p {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 0 0 14px 0;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

/* 11. Profile Showcase Specific Styles */
.profile-posts-header {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-posts-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.profile-posts-count-badge {
    font-size: 11px;
    font-weight: 700;
    background: rgba(79, 70, 229, 0.1);
    color: var(--brand-primary);
    padding: 2px 8px;
    border-radius: var(--radius-pill, 9999px);
}

.profile-posts-filters {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.profile-posts-filters::-webkit-scrollbar {
    display: none;
}

.profile-filter-pill {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill, 9999px);
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.profile-filter-pill:hover {
    background: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--border-hover);
}

.profile-filter-pill.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.profile-posts-stream {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

/* 12. Complete Mobile & Tablet Responsiveness */
@media (max-width: 640px) {
    .fb-post-card {
        padding: 12px 14px;
        border-radius: var(--radius-md, 8px);
        margin-bottom: 12px;
    }

    .fb-reaction-bar,
    .fb-summary-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px 10px;
        padding: 8px 0;
    }

    .fb-reaction-icons-group {
        min-width: 0;
        flex-shrink: 1;
    }

    .fb-reaction-counter {
        font-size: 12px;
    }

    .fb-stats-right {
        font-size: 11.5px;
        gap: 4px;
    }

    .fb-card-action-bar {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 2px;
        padding: 2px 0;
    }

    .fb-action-btn {
        padding: 7px 4px;
        font-size: 11.5px;
        gap: 4px;
    }

    .fb-action-btn i {
        font-size: 13px;
    }

    .fb-btn-emoji {
        font-size: 14px;
    }

    .fb-reactions-dock {
        left: 0;
        right: auto;
        transform-origin: bottom left;
        padding: 4px 6px;
        gap: 2px;
        max-width: calc(100vw - 28px);
    }

    .fb-dock-item {
        width: 32px;
        height: 32px;
    }

    .fb-dock-emoji {
        font-size: 20px;
    }

    .fb-comment-bubble-box {
        padding: 7px 11px;
        font-size: 12.5px;
    }

    .fb-comment-content-wrapper {
        max-width: calc(100% - 40px);
    }

    .fb-symbols-tray {
        width: 250px;
        right: -10px;
    }

    .fb-symbols-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .fb-symbol-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
}
