* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --accent-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-nav {
    background: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
}

.logo-brand {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.logo-tagline {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: var(--primary-dark);
}

.main-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.community-header {
    text-align: center;
    margin-bottom: 2rem;
}

.community-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.community-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filters-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
}

.search-box {
    display: flex;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    font-size: 0.875rem;
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary-color);
}

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.625rem 1rem;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.category-select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    min-width: 160px;
    background: white;
    cursor: pointer;
}

.new-post-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
}

.new-post-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.post-card.pinned {
    border-left: 4px solid var(--warning-color);
    background: linear-gradient(135deg, #fffbeb 0%, white 50%);
}

.post-card.announcement {
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, #eef2ff 0%, white 50%);
}

.post-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.badge-pinned {
    background: #fef3c7;
    color: #92400e;
}

.badge-announcement {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-beta {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 0.25rem;
    display: inline-block;
    vertical-align: middle;
}

.post-card .post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-category {
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--primary-color);
    font-weight: 500;
}

.post-navigation {
    margin-bottom: 1.5rem;
}

.back-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.625rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.back-btn:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.post-detail {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.post-full .post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.post-meta-full {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post-body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.comments-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.comments-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.comments-list {
    margin-bottom: 1.5rem;
}

.comment {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.comment.admin-comment {
    background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
    border-left: 3px solid var(--primary-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-author {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Bobby AI Response Styles */
.comment.bobby-comment {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 3px solid #0ea5e9;
}

.bobby-avatar {
    font-size: 1.2rem;
    margin-right: 0.25rem;
}

.bobby-badge {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    color: white;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-body {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.add-comment-form {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.add-comment-form h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.add-comment-form input,
.add-comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    font-family: inherit;
}

.add-comment-form input:focus,
.add-comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: var(--primary-dark);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

#new-post-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.no-posts {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.no-posts p {
    margin-bottom: 1rem;
}

.no-comments {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.error {
    text-align: center;
    padding: 2rem;
    color: var(--danger-color);
}

.footer {
    background: var(--text-primary);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.footer p {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
}

.admin-link {
    opacity: 0.4 !important;
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.5rem 1rem;
    }
    
    .logo-brand {
        display: none;
    }
    
    .nav-links {
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
    
    .main-content {
        padding: 1.5rem 1rem;
    }
    
    .community-header h1 {
        font-size: 1.5rem;
    }
    
    .community-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .new-post-btn {
        width: 100%;
        text-align: center;
    }
    
    .post-meta {
        gap: 0.5rem;
    }
}

@media (max-width: 600px) {
    .post-card {
        padding: 1rem;
    }
    
    .post-title {
        font-size: 1rem;
    }
    
    .post-content {
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
    }
    
    .nav-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .community-header h1 {
        font-size: 1.25rem;
    }
    
    .header-subtitle {
        font-size: 0.875rem;
    }
    
    .post-full .post-title {
        font-size: 1.25rem;
    }
}

/* B|CHAT Promo Banner */
.bchat-promo {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(0, 168, 132, 0.15));
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.bchat-promo-icon {
    font-size: 1.5rem;
}

.bchat-promo-text {
    flex: 1;
    color: #e8e8e8;
    font-size: 0.95rem;
}

.bchat-promo-text strong {
    color: #00d4aa;
}

.bchat-promo-btn {
    background: linear-gradient(135deg, #00d4aa, #00a884);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.bchat-promo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
}

.bchat-link {
    background: linear-gradient(135deg, #00d4aa, #00a884) !important;
    color: white !important;
    border-radius: 6px;
}

@media (max-width: 600px) {
    .bchat-promo {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .bchat-promo-btn {
        width: 100%;
    }
}
