:root {
    /* Color Palette */
    --bg-base: #eef2f9;
    --bg-glass: rgba(255, 255, 255, 0.45);
    --bg-glass-hover: rgba(255, 255, 255, 0.65);
    --bg-glass-active: rgba(255, 255, 255, 0.85);
    
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.4);
    
    --accent: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-dark: #94a3b8;
    
    --border: rgba(255, 255, 255, 0.8);
    --border-highlight: rgba(255, 255, 255, 1);
    
    /* Layout */
    --sidebar-width: 260px;
    --members-width: 240px;
    --header-height: 70px;
    
    /* Shadows & Effects */
    --shadow-sm: 0 4px 6px -1px rgba(255, 255, 255, 0.7);
    --shadow-md: 0 10px 15px -3px rgba(255, 255, 255, 0.9);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --backdrop-blur: blur(16px);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    background-image: radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 40%), radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15) 0%, transparent 40%), radial-gradient(circle at 50% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 40%);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 2px solid var(--border);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
    border-radius: 20px;
}

/* Typography & Basics */
h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--text-main);
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

input, button, textarea {
    font-family: inherit;
    outline: none;
    border: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 4px 15px var(--primary-glow), 0 0 0 4px rgba(255, 255, 255, 0.4), inset 0 1px 1px rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-icon {
    background: transparent;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1.1rem;
}

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

/* Avatars */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
}

/* Login Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.login-modal {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.2);
}

.overlay.active .login-modal {
    transform: translateY(0);
}

.login-modal .logo {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.login-modal p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dark);
    transition: color var(--transition-fast);
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    padding: 14px 14px 14px 44px;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition-normal);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: rgba(255, 255, 255, 0.9);
}

.input-group input:focus + i {
    color: var(--primary);
}

.login-modal .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
    border-radius: 12px;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    opacity: 0;
    transition: opacity 0.5s ease;
    padding: 20px;
    gap: 20px;
}

.app-container.visible {
    opacity: 1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border);
    border-radius: 24px;
    z-index: 10;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .logo {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.sidebar-header .logo i {
    color: var(--primary);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dark);
    margin-bottom: 12px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    gap: 12px;
}

.nav-links a i, .nav-links a .hash {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-dark);
    transition: var(--transition-fast);
}

.nav-links li:hover a {
    background: var(--bg-glass-hover);
    color: var(--text-main);
}

.nav-links li:hover a i, .nav-links li:hover a .hash {
    color: var(--text-muted);
}

.nav-links li.active a {
    background: var(--bg-glass-active);
    color: var(--text-main);
    font-weight: 500;
}

.nav-links li.active a i, .nav-links li.active a .hash {
    color: var(--primary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    transition: var(--transition-fast);
}

.user-profile:hover {
    background: var(--bg-glass-hover);
}

.user-profile .avatar {
    width: 36px;
    height: 36px;
    font-size: 1rem;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-info .username {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .status {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dark);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--bg-glass);
    backdrop-filter: var(--backdrop-blur);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
    overflow: hidden;
}

.main-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 2px solid var(--border);
    z-index: 5;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left h1 i {
    color: var(--text-dark);
}

.mobile-only {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar i {
    position: absolute;
    left: 12px;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.search-bar input {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    padding: 8px 16px 8px 36px;
    border-radius: 20px;
    color: var(--text-main);
    font-size: 0.9rem;
    width: 200px;
    transition: var(--transition-normal);
}

.search-bar input:focus {
    width: 260px;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
}

/* Feed Area (Community Posts) */
.feed-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-behavior: smooth;
}

.create-post-box {
    width: 100%;
    max-width: 700px;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.post-creator-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.post-creator-header .avatar {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.post-creator-header h3 {
    font-size: 1.1rem;
    color: var(--text-main);
}

#create-post-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-main);
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 16px;
    transition: var(--transition-normal);
}

#create-post-form textarea:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
}

.post-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-input-group {
    position: relative;
    width: 250px;
}

.tag-input-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dark);
}

.tag-input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    padding: 10px 14px 10px 40px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.tag-input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
}

/* Posts List */
#posts-list {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    padding: 20px;
    border-radius: 16px;
    animation: slideIn 0.4s ease;
}

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

.post-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-time {
    font-size: 0.8rem;
    color: var(--text-dark);
}

.post-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 16px;
    text-transform: lowercase;
}

.post-content {
    color: #e2e8f0;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.post-interact-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.interact-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.interact-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-main);
}

.interact-btn.like-btn:hover, .interact-btn.like-btn.active {
    color: var(--success);
}
.interact-btn.dislike-btn:hover, .interact-btn.dislike-btn.active {
    color: var(--danger);
}
.interact-btn.reply-btn:hover {
    color: var(--primary);
}

/* Replies Area */
.replies-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: none;
}

.replies-section.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.reply-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.reply-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.reply-item .avatar {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
}

.reply-content {
    flex: 1;
}

.reply-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.reply-author {
    font-weight: 500;
    font-size: 0.85rem;
}

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

.reply-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.reply-input-wrapper {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.reply-input-wrapper input {
    flex: 1;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
}

.reply-input-wrapper input:focus {
    border-color: var(--primary);
}

/* Members Sidebar */
.members-sidebar {
    width: var(--members-width);
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border);
    border-radius: 24px;
    z-index: 10;
}

.members-sidebar .sidebar-header {
    border-bottom: 1px solid var(--border);
}

.members-sidebar .sidebar-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.members-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
}

.member-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    padding: 0 8px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition-fast);
    cursor: pointer;
    margin-bottom: 4px;
}

.member-item:hover {
    background: var(--bg-glass-hover);
}

.member-item .avatar {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}

.member-info {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge.admin {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .members-sidebar {
        position: absolute;
        right: -100%;
        height: 100%;
        transition: right 0.3s ease;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: -100%;
        height: 100%;
        transition: left 0.3s ease;
    }
    
    .mobile-only {
        display: flex;
    }
    
    .search-bar input {
        width: 140px;
    }
    
    .search-bar input:focus {
        width: 180px;
    }
}
