/* ===== COMMUNITY SPECIFIC STYLES ===== */

/* Import Hack Club gradient variables */
:root {
    --gradient-electric: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);
    --gradient-sunset: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    --gradient-cosmic: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    --gradient-neon: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
    --font-display: 'Kanit', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

/* Community Layout */
.community-container {
    padding: 24px;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
}

.community-layout {
    display: grid;
    grid-template-columns: 250px 1fr 320px;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Community Sidebar */
.community-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: calc(var(--topbar-height) + 24px);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.1);
}

.community-nav .nav-section {
    margin-bottom: 32px;
}

.community-nav .nav-section:last-child {
    margin-bottom: 0;
}

.community-nav h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--gradient-electric);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-list {
    list-style: none;
}

.nav-list li {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid transparent;
}

.nav-link:hover {
    background: var(--gradient-electric);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.nav-link.active {
    background: var(--gradient-electric);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.25);
}

.nav-link i {
    width: 20px;
    font-size: 1rem;
}

/* Community Main Feed */
.community-main {
    min-height: 100vh;
}

/* Create Post Card */
.create-post-card {
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 32px;
    background-image: linear-gradient(var(--card-bg), var(--card-bg)), var(--gradient-electric);
    background-origin: border-box;
    background-clip: content-box, border-box;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.create-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.15);
}

.create-post-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.create-post-btn {
    flex: 1;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 16px 20px;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Space Grotesk', sans-serif;
    transition: all 0.3s ease;
}

.create-post-btn:hover {
    background: var(--gradient-electric);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.create-post-actions {
    display: flex;
    gap: 12px;
    justify-content: space-around;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-btn:hover {
    background: var(--gradient-electric);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.action-btn.liked {
    background: var(--gradient-sunset);
    color: white;
    border-color: transparent;
}

.action-btn i {
    font-size: 1.1rem;
}

/* Posts Feed */
.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Post Styles */
.post {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-electric);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.15);
}

.post:hover::before {
    opacity: 1;
}

.featured-post {
    border: 2px solid transparent;
    background-image: linear-gradient(var(--card-bg), var(--card-bg)), var(--gradient-electric);
    background-origin: border-box;
    background-clip: content-box, border-box;
}

.featured-post::before {
    opacity: 1;
    height: 4px;
    background: var(--gradient-cosmic);
}

/* Right Sidebar Enhancements */
.community-right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: fit-content;
    position: sticky;
    top: calc(var(--topbar-height) + 24px);
}

.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.sidebar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.1);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gradient-icon {
    background: var(--gradient-electric);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Live Chat Styles */
.live-chat-card {
    border: 2px solid transparent;
    background-image: linear-gradient(var(--card-bg), var(--card-bg)), var(--gradient-neon);
    background-origin: border-box;
    background-clip: content-box, border-box;
}

.card-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 16px;
}

.online-count {
    background: var(--gradient-neon);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
}

.chat-container {
    height: 300px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scroll-behavior: smooth;
}

.chat-message {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeInUp 0.3s ease forwards;
}

.chat-message.system {
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-electric);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.message-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 2px 0;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chat-input-area {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.chat-emoji-picker {
    display: none;
    gap: 4px;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--secondary-bg);
    border-radius: 12px;
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.emoji-btn:hover {
    background: var(--hover-bg);
}

.chat-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    background: var(--gradient-electric);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.chat-send-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

/* Trending Topics Enhanced */
.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.trending-item:hover {
    background: var(--gradient-electric);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.trending-rank {
    font-weight: 700;
    background: var(--gradient-electric);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1rem;
    min-width: 24px;
}

.trending-item:hover .trending-rank {
    -webkit-text-fill-color: white;
}

.trending-sparkline {
    display: flex;
    align-items: end;
    gap: 2px;
    height: 20px;
}

.sparkline-bar {
    width: 3px;
    background: var(--gradient-electric);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.trending-item:hover .sparkline-bar {
    background: white;
}

.trend-up {
    color: #10B981;
}

.trend-down {
    color: #EF4444;
}

/* Daily Progress Tracker */
.progress-card {
    border: 2px solid transparent;
    background-image: linear-gradient(var(--card-bg), var(--card-bg)), var(--gradient-cosmic);
    background-origin: border-box;
    background-clip: content-box, border-box;
}

.daily-progress {
    margin-bottom: 20px;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.progress-item.completed {
    background: rgba(16, 185, 129, 0.1);
}

.progress-item.active {
    background: var(--gradient-electric);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.progress-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.progress-item.completed .progress-icon {
    background: #10B981;
    color: white;
}

.progress-item.active .progress-icon {
    background: white;
    color: var(--accent-primary);
}

.progress-item:not(.completed):not(.active) .progress-icon {
    background: var(--border-color);
    color: var(--text-secondary);
}

.daily-streak {
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: 12px;
    text-align: center;
}

.streak-number {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-cosmic);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.streak-calendar {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 8px;
}

.streak-day {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
}

.streak-day.completed {
    background: var(--gradient-neon);
}

.streak-day.today {
    background: var(--gradient-cosmic);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* Active Users Enhanced */
.pulse-indicator {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.active-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.active-user:hover {
    background: var(--gradient-electric);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.user-avatar.online::after,
.user-avatar.available::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border: 3px solid var(--card-bg);
    border-radius: 50%;
}

.user-avatar.online::after {
    background: #00ff88;
}

.user-avatar.available::after {
    background: #F59E0B;
}

.user-status i {
    margin-right: 4px;
}

.quick-message-btn {
    background: var(--gradient-electric);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.active-user:hover .quick-message-btn {
    opacity: 1;
    transform: scale(1.1);
}

/* Study Groups Enhanced */
.study-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.study-group:hover {
    background: var(--gradient-electric);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.group-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient-electric);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.activity-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gradient-neon);
}

.activity-dot.new-messages {
    animation: pulse 2s infinite;
}

.gradient-btn {
    background: var(--gradient-electric);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gradient-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

/* Enhanced Modal Styles */
.create-post-modal {
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-electric);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.optional {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.content-editor {
    position: relative;
}

.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

.toolbar-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: var(--gradient-electric);
    color: white;
}

.toolbar-divider {
    width: 1px;
    background: var(--border-color);
    margin: 4px 4px;
}

.content-textarea {
    border-radius: 0 0 8px 8px;
    border-top: none;
    resize: vertical;
}

.character-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tags-input-container {
    position: relative;
}

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 20px;
}

.tag-item {
    background: var(--gradient-electric);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-remove {
    cursor: pointer;
    opacity: 0.7;
}

.tag-remove:hover {
    opacity: 1;
}

.suggested-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag-suggestion {
    background: var(--secondary-bg);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-suggestion:hover {
    background: var(--gradient-electric);
    color: white;
}

.post-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-card:hover {
    border-color: var(--accent-primary);
    background: var(--gradient-electric);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.option-icon {
    width: 40px;
    height: 40px;
    background: var(--secondary-bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.option-card:hover .option-icon {
    background: white;
    color: var(--accent-primary);
}

.option-info {
    flex: 1;
}

.option-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.option-subtitle {
    font-size: 0.8rem;
    opacity: 0.7;
}

.option-btn {
    width: 32px;
    height: 32px;
    background: var(--gradient-electric);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.option-btn:hover {
    transform: scale(1.1);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.footer-left, .footer-right {
    display: flex;
    gap: 12px;
}

.publish-btn {
    background: var(--gradient-electric);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.publish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

/* Chat Modal Styles */
.chat-modal .modal-content {
    width: 95vw;
    height: 90vh;
    max-width: none;
    max-height: none;
    border-radius: 20px;
}

.chat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--gradient-electric);
    color: white;
    border-radius: 20px 20px 0 0;
}

.chat-modal-body {
    display: flex;
    height: calc(100% - 80px);
}

.chat-sidebar {
    width: 250px;
    background: var(--secondary-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
}

.chat-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-tabs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}

.chat-tab {
    background: none;
    border: none;
    text-align: left;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.chat-tab:hover, .chat-tab.active {
    background: var(--gradient-electric);
    color: white;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .community-layout {
        grid-template-columns: 220px 1fr 280px;
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .community-layout {
        grid-template-columns: 1fr 280px;
    }
    
    .community-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .community-container {
        padding: 16px;
    }
    
    .community-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .community-right-sidebar {
        display: none;
    }
    
    .create-post-actions {
        flex-wrap: wrap;
    }
    
    .post {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .post-options-grid {
        grid-template-columns: 1fr;
    }
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.verified-badge {
    color: var(--accent-primary);
    font-size: 0.8rem;
}

.post-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.post-category {
    background: rgba(98, 100, 167, 0.2);
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.post-menu {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.post-menu:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Post Content */
.post-content h3,
.post-content h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.post-content h3 {
    font-size: 1.3rem;
}

.post-content h4 {
    font-size: 1.1rem;
}

.post-content p {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* Post Highlights */
.post-highlights {
    background: var(--secondary-bg);
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.highlight-item:last-child {
    margin-bottom: 0;
}

.highlight-item i {
    color: var(--accent-primary);
    font-size: 0.8rem;
}

/* Code Styles */
.code-preview,
.code-block {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 16px 0;
    overflow-x: auto;
}

.code-title {
    background: var(--secondary-bg);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.code-preview pre,
.code-block pre {
    margin: 0;
    padding: 16px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
}

.code-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

/* Post Image */
.post-image {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.tag {
    background: rgba(98, 100, 167, 0.1);
    color: var(--accent-primary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag:hover {
    background: rgba(98, 100, 167, 0.2);
    color: var(--accent-primary);
    text-decoration: none;
}

/* Content Lists */
.content-list {
    margin: 16px 0;
    padding-left: 20px;
    color: var(--text-primary);
}

.content-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Event Details */
.event-details {
    background: var(--secondary-bg);
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.event-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.event-info:last-child {
    margin-bottom: 0;
}

.event-info i {
    color: var(--accent-primary);
    width: 16px;
}

.join-event-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    transition: all 0.2s ease;
}

.join-event-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Post Footer */
.post-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.post-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-actions {
    display: flex;
    gap: 8px;
}

/* Comments Section */
.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.comment {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--secondary-bg);
    border-radius: 8px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-info {
    display: flex;
    flex-direction: column;
}

.comment-author-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.comment-content p {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.comment-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.comment-action:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.add-comment {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.comment-input {
    flex: 1;
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.comment-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.send-comment {
    background: var(--accent-primary);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-comment:hover {
    background: var(--accent-secondary);
}

.send-comment:disabled {
    background: var(--hover-bg);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Load More */
.load-more {
    text-align: center;
    margin-top: 32px;
}

.load-more-btn {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
}

/* Right Sidebar */
.community-right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: fit-content;
    position: sticky;
    top: calc(var(--topbar-height) + 24px);
}

.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Trending Topics */
.trending-topics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.trending-item:hover {
    background: var(--hover-bg);
}

.trending-rank {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 0.9rem;
    min-width: 20px;
}

.trending-info {
    flex: 1;
}

.trending-topic {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.trending-posts {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Active Users */
.active-users {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.active-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.active-user:hover {
    background: var(--hover-bg);
}

.user-avatar.online {
    position: relative;
}

.user-avatar.online::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: #00ff88;
    border: 2px solid var(--card-bg);
    border-radius: 50%;
}

.active-user .user-info {
    flex: 1;
}

.active-user .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Study Groups */
.study-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.study-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.study-group:hover {
    background: var(--hover-bg);
}

.group-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.group-members {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.group-activity {
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.see-all-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    width: 100%;
    transition: all 0.2s ease;
}

.see-all-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* Form Styles */
.post-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(98, 100, 167, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: var(--font-primary);
    line-height: 1.5;
}

.post-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.option-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .community-layout {
        grid-template-columns: 200px 1fr 240px;
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .community-layout {
        grid-template-columns: 1fr 260px;
    }
    
    .community-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .community-container {
        padding: 16px;
    }
    
    .community-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .community-right-sidebar {
        display: none;
    }
    
    .create-post-actions {
        flex-wrap: wrap;
    }
    
    .post {
        padding: 16px;
    }
    
    .code-comparison {
        grid-template-columns: 1fr;
    }
    
    .post-actions {
        flex-wrap: wrap;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .post-options {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .create-post-actions {
        grid-template-columns: 1fr 1fr;
        display: grid;
        gap: 8px;
    }
    
    .post-stats {
        flex-wrap: wrap;
    }
    
    .trending-item,
    .active-user,
    .study-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* Message Form and Auth Prompt Styles */
.message-form {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: rgba(17, 24, 39, 0.3);
}

.message-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.5);
    color: var(--text-color);
    font-size: 0.9rem;
}

.message-form input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(31, 41, 55, 0.3);
}

.message-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.message-form .btn-primary {
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
}

.message-form .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Auth Prompt Styles */
.auth-prompt {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-prompt-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.auth-prompt-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.5rem;
}

.auth-prompt h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.auth-prompt p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-prompt-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.auth-prompt-buttons .btn-primary,
.auth-prompt-buttons .btn-secondary {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.auth-prompt-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.feature-item i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Auth Prompt Modal */
.auth-prompt-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.auth-prompt-modal-content {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(31, 41, 55, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0;
    max-width: 400px;
    width: 100%;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.auth-prompt-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.auth-prompt-header .auth-prompt-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.75rem;
}

.auth-prompt-header h3 {
    margin: 0;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

.close-auth-prompt {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.close-auth-prompt:hover {
    background: rgba(255, 255, 255, 0.2);
}

.auth-prompt-body {
    padding: 1.5rem;
    text-align: center;
}

.auth-prompt-body p {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    line-height: 1.5;
}

.auth-prompt-benefits {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.benefit-item i {
    color: #10b981;
    font-size: 1rem;
}

.auth-prompt-footer {
    padding: 1.5rem;
    background: rgba(17, 24, 39, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 0.75rem;
}

.auth-prompt-footer .btn-primary,
.auth-prompt-footer .btn-secondary {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.9rem;
    text-align: center;
    border-radius: 8px;
}

/* Sample message styling */
.sample-message {
    opacity: 0.8;
}

.sample-message::after {
    content: ' (sample)';
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* Offline message */
.offline-message {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(17, 24, 39, 0.3);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}

.offline-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.offline-message h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.offline-message p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(2rem);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
