/* Community Hub Styles */

/* Reuse some modern-ui.css vars if available, else define defaults */
:root {
    --nexus-bg: #0a0e17;
    --nexus-panel: rgba(20, 25, 40, 0.7);
    --nexus-border: rgba(64, 224, 208, 0.2);
    --nexus-accent: #40e0d0; /* Turquoise/Cyan */
    --nexus-text: #e0e0e0;
    --nexus-text-dim: #a0a0a0;
}

body.nexus-theme {
    background-color: var(--nexus-bg);
    background-image: radial-gradient(circle at 10% 20%, rgba(64, 224, 208, 0.05) 0%, transparent 20%),
                      radial-gradient(circle at 90% 80%, rgba(138, 43, 226, 0.05) 0%, transparent 20%);
    color: var(--nexus-text);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    min-height: 100vh;
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--nexus-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--nexus-border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 24px;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 20px;
    margin: 0 20px 20px 20px;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.nav-brand a {
    color: var(--nexus-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
}
.nav-brand .divider { margin: 0 8px; color: var(--nexus-text-dim); }
.nav-brand .active { color: var(--nexus-accent); }

.search-bar {
    position: relative;
    width: 300px;
}
.search-bar input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--nexus-border);
    padding: 10px 15px 10px 40px;
    border-radius: 20px;
    color: white;
}
.search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nexus-text-dim);
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-btn.primary { background: var(--nexus-accent); color: #000; }
.nav-btn.secondary { background: transparent; border: 1px solid var(--nexus-border); color: var(--nexus-text); }
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: white; }
.user-avatar-small { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--nexus-accent); }

/* Sidebar */
.sidebar { padding: 20px; height: fit-content; }
.btn-primary.full-width {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: var(--nexus-accent);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    color: #000;
}
.category-item {
    display: block;
    padding: 10px 15px;
    margin: 4px 0;
    border-radius: 8px;
    color: var(--nexus-text-dim);
    text-decoration: none;
    transition: all 0.2s;
}
.category-item:hover, .category-item.active {
    background: rgba(64, 224, 208, 0.1);
    color: var(--nexus-accent);
}
.category-item i { width: 20px; margin-right: 8px; }

/* Feed */
.feed-header {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 20px;
    align-items: center;
}
.sort-controls select {
    background: transparent;
    border: none;
    color: var(--nexus-accent);
    font-weight: bold;
    cursor: pointer;
}
.icon-btn {
    background: transparent;
    border: none;
    color: var(--nexus-text-dim);
    cursor: pointer;
    margin-left: 5px;
}
.icon-btn.active { color: var(--nexus-accent); }

.discussion-card {
    padding: 20px;
    margin-bottom: 16px;
    transition: transform 0.2s;
    cursor: pointer;
}
.discussion-card:hover { transform: translateY(-2px); border-color: var(--nexus-accent); }
.card-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.user-info { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.user-info img { width: 24px; height: 24px; border-radius: 50%; }
.user-info .time { color: var(--nexus-text-dim); font-size: 0.8rem; }
.category-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}
.category-badge.ai-ml { color: #f0f; background: rgba(255, 0, 255, 0.1); }
.category-badge.gaming { color: #0ff; background: rgba(0, 255, 255, 0.1); }
/* Add more category colors */

.card-title { margin: 0 0 8px 0; font-size: 1.2rem; }
.card-preview { color: var(--nexus-text-dim); font-size: 0.95rem; line-height: 1.5; }
.card-stats { margin-top: 15px; display: flex; gap: 20px; color: var(--nexus-text-dim); font-size: 0.9rem; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.modal.show { display: flex; opacity: 1; }
.modal-content {
    width: 600px;
    max-width: 90%;
    padding: 30px;
    background: #0f1422; /* Opaque background for modal */
    border: 1px solid var(--nexus-border);
}
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
.close-btn { background: none; border: none; font-size: 1.5rem; color: #fff; cursor: pointer; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: var(--nexus-text-dim); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--nexus-border);
    border-radius: 8px;
    color: white;
}
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* Responsive */
@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; }
    .sidebar, .sidebar-right { display: none; } /* Show/Hide logic for mobile needed */
}
