/* ========================================
   COMMUNITY VIEWER - ISOLATED STYLES
   Inspired by radha-v2.css design system
   No conflicts with main app styles
   ======================================== */

/* Namespace all community styles to prevent conflicts */
#communityModal,
#communityModal * {
    box-sizing: border-box;
}

/* Community Modal Variables - Light Mode */
#communityModal {
    --cm-primary: #5A4BDA;
    --cm-primary-hover: #4A3BC8;
    --cm-secondary: #6D61E7;
    --cm-accent: #F972B9;
    
    --cm-text-primary: #333333;
    --cm-text-secondary: #666666;
    --cm-text-tertiary: #999999;
    
    --cm-bg-primary: #FFFFFF;
    --cm-bg-secondary: #F5F7FA;
    --cm-bg-tertiary: #EAEDF3;
    
    --cm-card-bg: #FFFFFF;
    --cm-card-border: #EAEDF3;
    --cm-card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --cm-card-shadow-hover: 0 6px 16px rgba(90, 75, 218, 0.12);
    
    --cm-success: #10B981;
    --cm-error: #EF4444;
    --cm-warning: #F59E0B;
    --cm-info: #3B82F6;
    
    --cm-radius-sm: 0.375rem;
    --cm-radius: 0.5rem;
    --cm-radius-lg: 0.75rem;
    --cm-radius-xl: 1rem;
    
    --cm-transition: 300ms ease;
}

/* Dark Mode Variables */
.dark-mode #communityModal,
body.dark-mode #communityModal {
    --cm-primary: #6D62EE;
    --cm-primary-hover: #7C72F5;
    --cm-secondary: #5A4FCD;
    
    --cm-text-primary: #FFFFFF;
    --cm-text-secondary: #D0D0D0;
    --cm-text-tertiary: #A0A0A0;
    
    --cm-bg-primary: #000000;
    --cm-bg-secondary: #0A0A0A;
    --cm-bg-tertiary: #141414;
    
    --cm-card-bg: #0A0A0A;
    --cm-card-border: #1A1A1A;
    --cm-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(109, 98, 238, 0.15);
    --cm-card-shadow-hover: 0 12px 48px rgba(109, 98, 238, 0.4), 0 0 0 2px rgba(109, 98, 238, 0.5);
}

/* Modal Base */
#communityModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 0;
    animation: cmFadeIn 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#communityModal.active {
    display: flex;
}

@keyframes cmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Container */
#communityModal .community-container {
    background: var(--cm-bg-primary);
    width: 100%;
    height: 100%;
    max-width: 900px;
    max-height: 95vh;
    border-radius: var(--cm-radius-xl);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: cmSlideUp 0.3s ease;
    overflow: hidden;
}

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

/* Header */
#communityModal .community-header {
    background: linear-gradient(135deg, var(--cm-primary) 0%, var(--cm-secondary) 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#communityModal .header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

#communityModal .close-community-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--cm-transition);
    flex-shrink: 0;
}

#communityModal .close-community-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Channel Avatar - Telegram Style */
#communityModal .channel-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#communityModal .channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#communityModal .channel-info {
    min-width: 0;
    flex: 1;
}

#communityModal .channel-name-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

#communityModal .channel-info h2 {
    font-size: 1.125rem;
    margin: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

#communityModal .channel-name-wrapper .verified-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 4px;
}

#communityModal .channel-name-wrapper .verified-badge svg {
    width: 20px;
    height: 20px;
    fill: #FFFFFF;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    opacity: 0.95;
}

#communityModal .channel-subtitle {
    font-size: 0.8125rem;
    opacity: 0.85;
    margin: 2px 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

#communityModal .header-right {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

#communityModal .header-action-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--cm-transition);
}

#communityModal .header-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

#communityModal .header-action-btn:active {
    transform: rotate(180deg);
}

/* Content Area */
#communityModal .community-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    background: var(--cm-bg-secondary);
}

#communityModal .community-content::-webkit-scrollbar {
    width: 8px;
}

#communityModal .community-content::-webkit-scrollbar-track {
    background: transparent;
}

#communityModal .community-content::-webkit-scrollbar-thumb {
    background: var(--cm-card-border);
    border-radius: 4px;
}

#communityModal .community-content::-webkit-scrollbar-thumb:hover {
    background: var(--cm-text-tertiary);
}

/* Post Card */
#communityModal .community-post {
    background: var(--cm-card-bg);
    border-radius: var(--cm-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--cm-card-shadow);
    transition: var(--cm-transition);
    border: 1px solid var(--cm-card-border);
}

#communityModal .community-post:hover {
    box-shadow: var(--cm-card-shadow-hover);
    transform: translateY(-2px);
}

#communityModal .community-post:last-child {
    margin-bottom: 0;
}

/* Post Header */
#communityModal .post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#communityModal .post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#communityModal .author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cm-primary) 0%, var(--cm-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

#communityModal .author-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#communityModal .author-name {
    font-weight: 600;
    color: var(--cm-text-primary);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

#communityModal .verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1DA1F2;
    margin-left: 0.25rem;
    line-height: 1;
    vertical-align: middle;
}

#communityModal .verified-badge svg {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 1px 3px rgba(29, 161, 242, 0.4));
    transition: all 0.2s ease;
}

#communityModal .verified-badge:hover svg {
    filter: drop-shadow(0 2px 6px rgba(29, 161, 242, 0.6));
    transform: scale(1.1);
}

.dark-mode #communityModal .verified-badge,
body.dark-mode #communityModal .verified-badge {
    color: #1DA1F2;
}

.dark-mode #communityModal .verified-badge svg,
body.dark-mode #communityModal .verified-badge svg {
    filter: drop-shadow(0 2px 6px rgba(29, 161, 242, 0.6));
}

.dark-mode #communityModal .verified-badge:hover svg,
body.dark-mode #communityModal .verified-badge:hover svg {
    filter: drop-shadow(0 3px 8px rgba(29, 161, 242, 0.8));
}

#communityModal .post-time {
    font-size: 0.8125rem;
    color: var(--cm-text-tertiary);
}

#communityModal .edited-badge {
    font-size: 0.75rem;
    color: var(--cm-text-tertiary);
    font-style: italic;
    padding: 0.125rem 0.5rem;
    background: var(--cm-bg-tertiary);
    border-radius: var(--cm-radius-sm);
}

/* Post Body */
#communityModal .post-body {
    margin-bottom: 1rem;
}

#communityModal .post-content {
    color: var(--cm-text-secondary);
    line-height: 1.7;
    font-size: 0.9375rem;
}

#communityModal .post-content p {
    margin: 0 0 0.75rem 0;
}

#communityModal .post-content p:last-child {
    margin-bottom: 0;
}

#communityModal .post-content strong,
#communityModal .post-content b {
    font-weight: 600;
    color: var(--cm-text-primary);
}

#communityModal .post-content em,
#communityModal .post-content i {
    font-style: italic;
}

#communityModal .post-content u {
    text-decoration: underline;
}

#communityModal .post-content a {
    color: var(--cm-primary);
    text-decoration: none;
    transition: var(--cm-transition);
}

#communityModal .post-content a:hover {
    text-decoration: underline;
    color: var(--cm-primary-hover);
}

#communityModal .post-content ul,
#communityModal .post-content ol {
    margin: 0.75rem 0;
    padding-left: 1.75rem;
}

#communityModal .post-content li {
    margin: 0.375rem 0;
}

#communityModal .post-image-container {
    margin-top: 1rem;
    border-radius: var(--cm-radius);
    overflow: hidden;
    background: var(--cm-bg-tertiary);
    position: relative;
    max-width: 400px;
    max-height: 300px;
}

/* Loading spinner - only show when image is loading */
#communityModal .post-image-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--cm-card-border);
    border-top-color: var(--cm-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

#communityModal .post-image {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    transition: opacity 0.3s ease, transform 0.2s ease;
    position: relative;
    z-index: 2;
    background: var(--cm-bg-tertiary);
    /* Override any global blur filters */
    filter: none !important;
    transform: scale(1) !important;
}

#communityModal .post-image:hover {
    transform: scale(1.02) !important;
}

#communityModal .post-image-error {
    padding: 40px 20px;
    text-align: center;
    color: var(--cm-text-secondary);
    background: var(--cm-bg-secondary);
    border-radius: var(--cm-radius);
}

#communityModal .post-image-error i {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Post Footer */
#communityModal .post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--cm-card-border);
    gap: 1rem;
    flex-wrap: wrap;
}

#communityModal .post-stats {
    display: flex;
    gap: 1.25rem;
    font-size: 0.8125rem;
    color: var(--cm-text-tertiary);
}

#communityModal .post-stats span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

#communityModal .post-stats i {
    font-size: 0.875rem;
}

/* Reactions */
#communityModal .post-reactions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#communityModal .reactions-list {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

#communityModal .reaction-item {
    background: var(--cm-bg-tertiary);
    border: 2px solid var(--cm-card-border);
    border-radius: var(--cm-radius-lg);
    padding: 0.375rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: var(--cm-transition);
    user-select: none;
    position: relative;
    min-width: 0;
    flex-shrink: 0;
}

#communityModal .reaction-item:hover {
    background: var(--cm-bg-secondary);
    transform: scale(1.1);
    border-color: var(--cm-primary);
    box-shadow: 0 2px 8px rgba(90, 75, 218, 0.2);
}

#communityModal .reaction-item.active {
    background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    border-color: #FF6B9D;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.2), 0 4px 12px rgba(196, 69, 105, 0.4);
    animation: reactionPulse 0.3s ease;
    position: relative;
}

#communityModal .reaction-item.active::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--cm-radius-lg);
    background: linear-gradient(135deg, #FF6B9D, #C44569);
    z-index: -1;
    opacity: 0.3;
    filter: blur(8px);
}

#communityModal .reaction-item.active .reaction-emoji {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: emojiFloat 2s ease-in-out infinite;
}

#communityModal .reaction-item.active .reaction-count {
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#communityModal .reaction-item.active:hover {
    background: linear-gradient(135deg, #FF7BA9 0%, #D55579 100%);
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.3), 0 6px 16px rgba(196, 69, 105, 0.5);
}

@keyframes reactionPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes emojiFloat {
    0%, 100% {
        transform: scale(1.15) translateY(0);
    }
    50% {
        transform: scale(1.15) translateY(-2px);
    }
}

#communityModal .reaction-emoji {
    font-size: 1.125rem;
    line-height: 1;
    flex-shrink: 0;
}

#communityModal .reaction-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cm-text-primary);
    min-width: 1ch;
    text-align: center;
    white-space: nowrap;
}

#communityModal .add-reaction-btn {
    background: var(--cm-bg-tertiary);
    border: 2px solid var(--cm-card-border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--cm-transition);
    color: var(--cm-text-tertiary);
    font-size: 1.125rem;
}

#communityModal .add-reaction-btn:hover {
    background: var(--cm-bg-secondary);
    color: var(--cm-primary);
    transform: scale(1.1);
    border-color: var(--cm-primary);
    box-shadow: 0 2px 8px rgba(90, 75, 218, 0.2);
}

/* Reaction Picker */
#communityModal .reaction-picker {
    position: relative;
    background: var(--cm-bg-secondary);
    border-radius: var(--cm-radius-lg);
    padding: 0.875rem;
    margin: 0.75rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: cmSlideDown 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--cm-card-border);
}

#communityModal .reaction-picker-scroll {
    display: flex;
    gap: 0.625rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 0.25rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
}

#communityModal .reaction-picker-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

@keyframes cmSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#communityModal .reaction-emoji-btn {
    background: var(--cm-bg-tertiary);
    border: 2px solid transparent;
    min-width: 52px;
    height: 52px;
    border-radius: var(--cm-radius-lg);
    font-size: 1.875rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

#communityModal .reaction-emoji-btn:hover {
    background: var(--cm-primary);
    transform: scale(1.25);
    border-color: var(--cm-primary);
    box-shadow: 0 4px 12px rgba(90, 75, 218, 0.4);
    z-index: 1;
}

#communityModal .reaction-emoji-btn:active {
    transform: scale(1.15);
}

/* Dark mode picker */
.dark-mode #communityModal .reaction-picker,
body.dark-mode #communityModal .reaction-picker {
    background: var(--cm-bg-tertiary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-color: var(--cm-card-border);
}

.dark-mode #communityModal .reaction-emoji-btn,
body.dark-mode #communityModal .reaction-emoji-btn {
    background: #1a1a1a;
}

.dark-mode #communityModal .reaction-emoji-btn:hover,
body.dark-mode #communityModal .reaction-emoji-btn:hover {
    background: var(--cm-primary);
    box-shadow: 0 4px 12px rgba(109, 98, 238, 0.6);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    #communityModal .reaction-picker {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }
    
    #communityModal .reaction-picker-scroll {
        gap: 0.5rem;
    }
    
    #communityModal .reaction-emoji-btn {
        min-width: 48px;
        height: 48px;
        font-size: 1.75rem;
    }
}

/* Loading States */
#communityModal .posts-loading,
#communityModal .empty-state,
#communityModal .error-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--cm-text-tertiary);
}

#communityModal .load-more-indicator {
    text-align: center;
    padding: 2rem;
    color: var(--cm-text-tertiary);
}

#communityModal .loader,
#communityModal .loader-small {
    border: 4px solid var(--cm-card-border);
    border-top-color: var(--cm-primary);
    border-radius: 50%;
    animation: cmSpin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

#communityModal .loader {
    width: 48px;
    height: 48px;
}

#communityModal .loader-small {
    width: 32px;
    height: 32px;
    border-width: 3px;
    margin: 0 auto 1rem;
}

@keyframes cmSpin {
    to { transform: rotate(360deg); }
}

#communityModal .empty-state i,
#communityModal .error-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
    color: var(--cm-text-tertiary);
}

#communityModal .empty-state p,
#communityModal .error-state p {
    font-size: 1.125rem;
    color: var(--cm-text-secondary);
}

/* Community Badge (on main UI) */
.community-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #EF4444;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: cmPulse 2s infinite;
    z-index: 1;
}

@keyframes cmPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    #communityModal .community-container {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    #communityModal .community-header {
        padding: 1rem;
    }

    #communityModal .channel-info h2 {
        font-size: 1.125rem;
    }

    #communityModal .community-content {
        padding: 1rem;
    }

    #communityModal .community-post {
        padding: 1.25rem;
    }

    #communityModal .post-title {
        font-size: 1.125rem;
    }

    #communityModal .post-content {
        font-size: 0.875rem;
    }
    
    /* Mobile reaction optimizations */
    #communityModal .reactions-list {
        gap: 0.25rem;
    }
    
    #communityModal .reaction-item {
        padding: 0.25rem 0.375rem;
        gap: 0.2rem;
        border-width: 1.5px;
    }
    
    #communityModal .reaction-emoji {
        font-size: 1rem;
    }
    
    #communityModal .reaction-count {
        font-size: 0.75rem;
        min-width: auto;
    }
    
    #communityModal .add-reaction-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    #communityModal .post-footer {
        gap: 0.5rem;
    }
    }

    #communityModal .post-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    #communityModal .post-reactions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Accessibility */
#communityModal *:focus-visible {
    outline: 2px solid var(--cm-primary);
    outline-offset: 2px;
}

#communityModal button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dark Mode Reaction Enhancements */
.dark-mode #communityModal .reaction-item,
body.dark-mode #communityModal .reaction-item {
    background: #374151;
    border-color: #4b5563;
}

.dark-mode #communityModal .reaction-item:hover,
body.dark-mode #communityModal .reaction-item:hover {
    background: #4b5563;
    border-color: var(--cm-primary);
    box-shadow: 0 2px 8px rgba(109, 98, 238, 0.3);
}

.dark-mode #communityModal .reaction-item.active,
body.dark-mode #communityModal .reaction-item.active {
    background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    border-color: #FF6B9D;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.3), 0 4px 12px rgba(196, 69, 105, 0.6);
}

.dark-mode #communityModal .reaction-item.active::before,
body.dark-mode #communityModal .reaction-item.active::before {
    opacity: 0.5;
    filter: blur(12px);
}

.dark-mode #communityModal .reaction-item.active .reaction-emoji,
body.dark-mode #communityModal .reaction-item.active .reaction-emoji {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.dark-mode #communityModal .reaction-item.active .reaction-count,
body.dark-mode #communityModal .reaction-item.active .reaction-count {
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.dark-mode #communityModal .reaction-item.active:hover,
body.dark-mode #communityModal .reaction-item.active:hover {
    background: linear-gradient(135deg, #FF7BA9 0%, #D55579 100%);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.4), 0 6px 16px rgba(196, 69, 105, 0.7);
}

/* New Posts Notification */
#communityModal .new-posts-notification {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: var(--cm-radius-lg);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

#communityModal .new-posts-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

#communityModal .new-posts-notification i {
    font-size: 1.125rem;
    animation: sparkle 1s ease infinite;
}

@keyframes sparkle {
    0%, 100% { 
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    50% { 
        transform: rotate(180deg) scale(1.2);
        opacity: 0.8;
    }
}

/* Toast Notifications */
.community-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 0.95rem;
    font-weight: 500;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.community-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.community-toast i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.community-toast-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.community-toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.community-toast-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(217, 119, 6, 0.95) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.community-toast-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile responsive toasts */
@media (max-width: 768px) {
    .community-toast {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        top: 70px;
    }
}

/* Print Styles */
@media print {
    #communityModal {
        display: none !important;
    }
}
