* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-deep: #0a0a12;
    --bg-card: #12121f;
    --bg-card-2: #1a1a2e;
    --bg-hover: rgba(255,255,255,0.03);
    --glass: rgba(18, 18, 31, 0.7);
    --glass-border: rgba(255, 255, 255, 0.06);
    --accent-pink: #e94560;
    --accent-purple: #a855f7;
    --accent-cyan: #06b6d4;
    --accent-green: #4ade80;
    --accent-yellow: #fbbf24;
    --accent-gradient: linear-gradient(135deg, #e94560 0%, #a855f7 100%);
    --accent-gradient-2: linear-gradient(135deg, #f472b6 0%, #a855f7 100%);
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --text-muted: #64748b;
    --success: #4ade80;
    --warning: #fbbf24;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(233, 69, 96, 0.15);
}

[data-theme="light"] {
    --bg-deep: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-2: #f8fafc;
    --bg-hover: rgba(0,0,0,0.03);
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --text: #1e293b;
    --text-dim: #475569;
    --text-muted: #94a3b8;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(233, 69, 96, 0.1);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-deep);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    position: relative;
    transition: background 0.3s, color 0.3s;
}

#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============ SCREENS ============ */
.screen {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
}
.screen.active { display: flex; }

/* ============ LANDING ============ */
.landing-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    text-align: center;
    z-index: 10;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hub-badge {
    display: inline-block;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 8px 24px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.main-title {
    font-size: clamp(4rem, 12vw, 9rem);
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: 0.5rem;
    letter-spacing: -4px;
}

.title-lewis {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-hub {
    background: linear-gradient(135deg, #ec4899 0%, #f472b6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.landing-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn-glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 14px 36px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 140px;
}

.btn-glass:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

[data-theme="light"] .btn-glass:hover {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.15);
}

.btn-gradient {
    background: var(--accent-gradient-2);
    border: none;
    color: white;
    padding: 14px 36px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: all 0.3s ease;
    min-width: 160px;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 60px rgba(233, 69, 96, 0.3);
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--accent-pink);
    box-shadow: 0 0 8px var(--accent-pink);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.landing-footer {
    margin-top: 2rem;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.system-status {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--accent-pink);
    letter-spacing: 1px;
}

.system-status.online {
    color: var(--success);
}

/* ============ AUTH SCREENS ============ */
#signup-screen, #login-screen {
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.auth-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 90%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    animation: fadeInUp 0.5s ease;
    z-index: 10;
}

.auth-title {
    font-size: 2rem;
    text-align: center;
    background: var(--accent-gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(233, 69, 96, 0.1);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.connection-status.connected {
    background: rgba(74, 222, 128, 0.1);
}

.connection-status.error {
    background: rgba(233, 69, 96, 0.2);
}

.status-indicator {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent-pink);
}

.connection-status.connected .status-indicator {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.input-group {
    margin-bottom: 1.2rem;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    transition: border-color 0.2s;
}

.input-wrap:focus-within {
    border-color: var(--accent-pink);
}

.input-icon {
    width: 18px; height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.input-wrap input, .input-wrap select, .input-wrap textarea {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 10px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

.input-wrap input::placeholder, .input-wrap textarea::placeholder {
    color: var(--text-muted);
}

.input-wrap select {
    cursor: pointer;
}

.btn-toggle-pw {
    width: 36px; height: 36px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-width: auto;
}

.btn-toggle-pw:hover {
    color: var(--text);
}

.btn-toggle-pw svg {
    width: 18px; height: 18px;
}

.btn-signin {
    width: 100%;
    background: var(--accent-gradient-2);
    border: none;
    color: white;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.btn-signin:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 50px rgba(233, 69, 96, 0.25);
}

.btn-signin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.auth-footer {
    text-align: center;
}

.auth-footer p {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.auth-footer a {
    color: var(--accent-pink);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.btn-back {
    position: fixed;
    top: 20px; left: 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: all 0.2s;
    width: auto;
}

.btn-back:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}

[data-theme="light"] .btn-back:hover {
    background: rgba(0,0,0,0.05);
}

/* ============ MODAL ============ */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    z-index: 1001;
    box-shadow: var(--shadow);
}

.modal-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ============ HUB LAYOUT ============ */
#hub-screen {
    flex-direction: row;
    background: var(--bg-deep);
}

.hub-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar */
.hub-sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    z-index: 20;
}

.hub-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1rem;
}

.hub-logo {
    width: 40px; height: 40px;
    border-radius: var(--radius-xs);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 900;
    color: white;
}

.hub-brand span {
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--accent-gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-section {
    padding: 0.5rem 0;
}

.nav-label {
    padding: 0 1.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 1.5rem;
    margin: 2px 0.75rem;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    width: calc(100% - 1.5rem);
    position: relative;
    font-family: inherit;
}

.nav-item svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-item.active {
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent-pink);
    border-left: 3px solid var(--accent-pink);
    margin-left: calc(0.75rem - 3px);
    width: calc(100% - 1.5rem + 3px);
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-pink);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 100px;
    min-width: 18px;
    text-align: center;
}

.hub-user {
    margin-top: auto;
    padding: 1rem 1.5rem 0;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hub-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.hub-user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.hub-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hub-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.hub-logout {
    width: 32px; height: 32px;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    min-width: auto;
}

.hub-logout:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.hub-logout svg {
    width: 16px; height: 16px;
}

/* Main Content */
.hub-main {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    margin-bottom: 2rem;
}

.view-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.view-header p {
    color: var(--text-dim);
    font-size: 1rem;
}

/* ============ HOME / POSTS ============ */
.online-now-section {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.online-now-section h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dim);
}

.online-avatars {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.online-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.online-avatar-img {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 5px var(--accent-green);
}

.online-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    transition: all 0.2s;
}

.post-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.post-type {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.post-content {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.post-author {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 2rem;
    font-style: italic;
}

/* ============ CHAT ============ */
.chat-view-layout {
    display: grid;
    grid-template-columns: 220px 1fr 200px;
    height: calc(100vh - 4rem);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.chat-rooms {
    background: var(--bg-card-2);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.rooms-header {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rooms-header h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.rooms-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.room-item {
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.room-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.room-item.active {
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent-pink);
    font-weight: 600;
}

.chat-area {
    display: flex;
    flex-direction: column;
    background: var(--bg-deep);
}

.chat-top-bar {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    background: var(--bg-card);
}

.chat-top-bar h3 {
    font-size: 1rem;
    font-weight: 700;
}

.chat-top-bar span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-message {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    animation: msgIn 0.2s ease;
    word-wrap: break-word;
}

@keyframes msgIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.chat-message.own {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.other {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
}

.chat-message.system {
    align-self: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 100px;
}

.chat-message.whisper {
    align-self: flex-start;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-bottom-left-radius: 4px;
}

.chat-message.whisper.own {
    align-self: flex-end;
    background: rgba(233, 69, 96, 0.15);
    border-color: rgba(233, 69, 96, 0.3);
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: var(--radius-xs);
}

.chat-msg-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 3px;
    font-size: 0.75rem;
    opacity: 0.85;
}

.chat-message.own .chat-msg-meta {
    justify-content: flex-end;
}

.chat-msg-name {
    font-weight: 700;
}

.chat-msg-time {
    opacity: 0.6;
}

.chat-msg-content {
    line-height: 1.4;
    font-size: 0.9rem;
}

.typing-indicator {
    height: 20px;
    padding: 0 1.5rem;
    font-size: 0.8rem;
    color: var(--accent-pink);
    font-style: italic;
}

.chat-input-bar {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
}

#chat-input:focus {
    border-color: var(--accent-pink);
}

#chat-input::placeholder {
    color: var(--text-muted);
}

#chat-send-btn {
    width: 40px; height: 40px;
    border-radius: var(--radius-xs);
    background: var(--accent-gradient);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    min-width: auto;
}

#chat-send-btn:hover {
    transform: scale(1.05);
}

#chat-send-btn svg {
    width: 16px; height: 16px;
}

.chat-members-panel {
    background: var(--bg-card-2);
    border-left: 1px solid var(--glass-border);
    padding: 1rem;
    overflow-y: auto;
}

.chat-members-panel h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.panel-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
}

.panel-member-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.panel-member-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============ MEMBERS ============ */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.member-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.member-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
}

.member-avatar-large {
    width: 64px; height: 64px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    overflow: hidden;
}

.member-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.member-role {
    font-size: 0.8rem;
    color: var(--accent-pink);
    text-transform: capitalize;
    margin-bottom: 0.5rem;
}

.member-bio {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.member-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.member-skill {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: var(--bg-card-2);
    border-radius: 100px;
    color: var(--text-muted);
}

.member-status {
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

.member-status.online {
    color: var(--accent-green);
}

/* ============ PROFILE ============ */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 2rem;
    max-width: 600px;
}

.profile-avatar-section {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.current-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    overflow: hidden;
}

.profile-avatar-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-dim);
}

.avatar-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.avatar-preset-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
}

.avatar-preset {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    border: 3px solid transparent;
}

.avatar-preset:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.avatar-preset.selected {
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px var(--bg-card), 0 0 0 5px var(--accent-pink);
}

.avatar-custom {
    margin-top: 0.5rem;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 10px 20px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:hover {
    border-color: var(--accent-pink);
    color: var(--text);
}

.btn-upload svg {
    width: 18px; height: 18px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.profile-form .input-group input,
.profile-form .input-group textarea {
    width: 100%;
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 12px 14px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
}

.profile-form .input-group input:focus,
.profile-form .input-group textarea:focus {
    border-color: var(--accent-pink);
}

.theme-toggle {
    display: flex;
    gap: 0.5rem;
}

.theme-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--glass-border);
    background: var(--bg-card-2);
    color: var(--text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.theme-btn:hover {
    border-color: var(--accent-pink);
    color: var(--text);
}

.theme-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

/* ============ CODE PLAYGROUND ============ */
.playground-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - 10rem);
}

.playground-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 0.75rem 1rem;
}

.playground-toolbar select {
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.btn-run {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-green);
    border: none;
    color: #0a0a12;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-run:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

.btn-run svg {
    width: 16px; height: 16px;
}

.btn-clear {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-clear:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.playground-panes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.code-pane, .output-pane {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-label {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    background: var(--bg-card-2);
}

#code-editor {
    flex: 1;
    background: var(--bg-deep);
    border: none;
    padding: 1rem;
    color: var(--text);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    outline: none;
}

#code-output {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

#code-output pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-dim);
}

.output-loading {
    color: var(--accent-yellow);
    font-style: italic;
}

.output-success {
    color: var(--accent-green);
}

.output-error {
    color: var(--accent-pink);
}

.output-info {
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.output-info p {
    margin-bottom: 0.5rem;
}

.html-preview {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    height: 300px;
    overflow: hidden;
}

#html-preview {
    flex: 1;
    border: none;
    background: white;
    width: 100%;
}

/* ============ ADMIN ============ */
.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    max-width: 600px;
    margin-bottom: 2rem;
}

.admin-card .input-group select,
.admin-card .input-group input,
.admin-card .input-group textarea {
    width: 100%;
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 12px 14px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
}

.admin-card .input-group textarea {
    resize: vertical;
    min-height: 120px;
}

.admin-section {
    margin-top: 2rem;
}

.admin-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dim);
}

.posts-manage-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.manage-post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 1rem;
}

.manage-post-item strong {
    font-size: 0.95rem;
    margin-right: 0.5rem;
}

.post-type-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--bg-card-2);
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.post-date-small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-delete-post {
    background: transparent;
    border: 1px solid var(--accent-pink);
    color: var(--accent-pink);
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-delete-post:hover {
    background: var(--accent-pink);
    color: white;
}

.pending-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pending-user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    transition: all 0.2s;
}

.pending-user-card:hover {
    border-color: var(--accent-purple);
}

.pending-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.pending-username {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.pending-time {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.pending-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-approve {
    background: var(--accent-green);
    border: none;
    color: #0a0a12;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-approve:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

.btn-reject {
    background: transparent;
    border: 1px solid var(--accent-pink);
    color: var(--accent-pink);
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-reject:hover {
    background: var(--accent-pink);
    color: white;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .hub-sidebar { width: 200px; }
    .chat-view-layout { grid-template-columns: 180px 1fr 160px; }
    .playground-panes { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hub-sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
        transition: left 0.3s;
    }
    .hub-sidebar.open { left: 0; }
    .chat-view-layout { grid-template-columns: 1fr; }
    .chat-rooms, .chat-members-panel { display: none; }
    .playground-panes { grid-template-columns: 1fr; height: auto; }
    .playground-layout { height: auto; }
    .main-title { font-size: 3.5rem; }
    .subtitle { font-size: 0.9rem; }
    .landing-actions { flex-direction: column; }
    .avatar-preset-grid { grid-template-columns: repeat(4, 1fr); }
    .pending-user-card { flex-direction: column; gap: 1rem; align-items: flex-start; }
}

/* ============ ENHANCED CHAT SIDEBAR ============ */
.chat-sidebar {
    background: var(--bg-card-2);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    min-width: 240px;
    max-width: 280px;
}

.chat-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-sidebar-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.chat-sidebar-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.chat-sidebar-section h4 {
    padding: 0 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.chat-list {
    max-height: 200px;
    overflow-y: auto;
}

.chat-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.chat-list-item:hover {
    background: var(--bg-hover);
}

.chat-list-item.active {
    background: rgba(233, 69, 96, 0.1);
    border-left: 3px solid var(--accent-pink);
}

.chat-list-item.unread {
    background: rgba(233, 69, 96, 0.05);
}

.chat-list-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.chat-list-info {
    flex: 1;
    min-width: 0;
}

.chat-list-name {
    font-size: 0.85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-list-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-list-badge {
    background: var(--accent-pink);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 100px;
    min-width: 18px;
    text-align: center;
}

.chat-list-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 100px;
}

.empty-state-small {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 1rem;
    font-style: italic;
}

/* ============ NOTIFICATIONS ============ */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent-pink);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 300px;
    font-size: 0.9rem;
}

.notification.show {
    transform: translateX(0);
}

/* ============ CHALLENGE SYSTEM ============ */
.challenges-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.challenges-toolbar select {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.challenges-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.challenge-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.challenge-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.challenge-card.completed {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.05) 0%, var(--bg-card) 100%);
}

.challenge-card.completed::after {
    content: '✅ COMPLETED';
    position: absolute;
    top: 10px;
    right: -30px;
    background: var(--accent-green);
    color: #0a0a12;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 30px;
    transform: rotate(45deg);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.challenge-lang {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 100px;
    background: var(--bg-card-2);
    color: var(--accent-cyan);
}

.challenge-diff {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.challenge-points {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-yellow);
}

.challenge-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.challenge-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.challenge-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.challenge-best {
    color: var(--accent-green);
    font-weight: 600;
}

.challenge-ai {
    color: var(--accent-purple);
    font-style: italic;
}

.btn-challenge-start {
    width: 100%;
    background: var(--accent-gradient-2);
    border: none;
    color: white;
    padding: 12px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-challenge-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(233, 69, 96, 0.3);
}

/* Challenge Modal */
.challenge-modal-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.challenge-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.challenge-points-badge {
    background: var(--accent-yellow);
    color: #0a0a12;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
}

.challenge-desc {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.challenge-section {
    margin-bottom: 1.5rem;
}

.challenge-section label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.challenge-tests {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.test-case {
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    font-size: 0.85rem;
    font-family: 'Fira Code', monospace;
}

.test-case code {
    color: var(--accent-cyan);
}

.challenge-hints {
    list-style: none;
    padding: 0;
}

.challenge-hints li {
    padding: 6px 0;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
}

.challenge-hints li::before {
    content: '💡 ';
}

.challenge-editor-wrap {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    overflow: hidden;
    margin-bottom: 1rem;
}

.editor-header {
    background: var(--bg-card-2);
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

#challenge-editor {
    width: 100%;
    min-height: 200px;
    background: var(--bg-deep);
    border: none;
    padding: 1rem;
    color: var(--text);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.challenge-result {
    margin-bottom: 1rem;
}

.result-progress {
    background: var(--bg-card-2);
    border-radius: 100px;
    height: 32px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    border-radius: 100px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
}

.result-progress span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    z-index: 1;
}

.test-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.test-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.test-detail.passed {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.test-detail.failed {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.test-detail.error {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.test-icon {
    font-size: 1rem;
}

.test-expected, .test-got {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.test-expected {
    background: rgba(74, 222, 128, 0.15);
    color: var(--accent-green);
}

.test-got {
    background: rgba(233, 69, 96, 0.15);
    color: var(--accent-pink);
}

.test-error {
    color: var(--accent-pink);
    font-size: 0.8rem;
    width: 100%;
}

.score-display {
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    padding: 1rem;
    background: var(--bg-card-2);
    border-radius: var(--radius-xs);
    margin-bottom: 0.5rem;
}

.award-display {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-green);
    padding: 0.5rem;
}

.total-points {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.new-badges {
    text-align: center;
    font-size: 0.9rem;
    color: var(--accent-yellow);
    padding: 0.5rem;
}

.ai-feedback {
    background: var(--bg-card-2);
    border-radius: var(--radius-xs);
    padding: 1rem;
    margin-bottom: 1rem;
}

.ai-feedback p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.ai-feedback p:last-child {
    margin-bottom: 0;
}

.challenge-actions {
    display: flex;
    gap: 1rem;
}

.challenge-actions button {
    flex: 1;
}

/* ============ LEADERBOARD ============ */
.leaderboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent-gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

.leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: var(--bg-card-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    min-width: 160px;
}

.podium-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.podium-item.pos-1 {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, var(--bg-card-2) 100%);
    border-color: var(--accent-yellow);
    order: 2;
}

.podium-item.pos-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1) 0%, var(--bg-card-2) 100%);
    border-color: #c0c0c0;
    order: 1;
}

.podium-item.pos-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1) 0%, var(--bg-card-2) 100%);
    border-color: #cd7f32;
    order: 3;
}

.podium-crown {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.podium-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.75rem;
    box-shadow: 0 0 0 4px var(--bg-card), 0 0 0 6px var(--glass-border);
}

.podium-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-align: center;
}

.podium-points {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-yellow);
    margin-bottom: 0.25rem;
}

.podium-rank {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.podium-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    transition: all 0.2s;
}

.leaderboard-entry:hover {
    border-color: var(--accent-purple);
    transform: translateX(4px);
}

.leaderboard-entry.current-user {
    border-color: var(--accent-cyan);
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.05) 0%, var(--bg-card) 100%);
}

.entry-rank {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

.entry-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.entry-info {
    flex: 1;
    min-width: 0;
}

.entry-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.entry-rank-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.entry-progress {
    height: 6px;
    background: var(--bg-card-2);
    border-radius: 100px;
    overflow: hidden;
}

.entry-progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 100px;
    transition: width 0.5s ease;
}

.entry-stats {
    text-align: right;
    min-width: 120px;
}

.entry-points {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-yellow);
}

.entry-completed {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.entry-langs {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.entry-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

/* Badges */
.badge-coder { background: rgba(74, 222, 128, 0.2); color: var(--accent-green); }
.badge-developer { background: rgba(6, 182, 212, 0.2); color: var(--accent-cyan); }
.badge-architect { background: rgba(168, 85, 247, 0.2); color: var(--accent-purple); }
.badge-polyglot { background: rgba(251, 191, 36, 0.2); color: var(--accent-yellow); }
.badge-legend { background: rgba(233, 69, 96, 0.2); color: var(--accent-pink); }
.badge-founder { background: rgba(233, 69, 96, 0.3); color: var(--accent-pink); }
.badge-super_admin { background: rgba(233, 69, 96, 0.3); color: var(--accent-pink); }

[class^="badge-"] {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 100px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============ USER STATS CARD ============ */
#user-stats-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stats-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.stats-info {
    flex: 1;
}

.stats-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.stats-rank {
    font-size: 0.85rem;
    color: var(--accent-yellow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-points {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-yellow);
}

.stats-progress {
    height: 8px;
    background: var(--bg-card-2);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.stats-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 100px;
    transition: width 0.5s ease;
}

.stats-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.stats-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============ ADMIN: ROLE MANAGEMENT ============ */
.roles-info {
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.roles-info p {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.roles-info p:last-child {
    margin-bottom: 0;
}

.roles-manage-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.role-manage-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
}

.role-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.role-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.role-name {
    font-size: 1rem;
    font-weight: 700;
}

.role-current {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.role-select {
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.btn-save-role {
    background: var(--accent-green);
    border: none;
    color: #0a0a12;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-save-role:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

/* ============ ADMIN: MESSAGE MONITOR ============ */
.monitor-warning {
    background: rgba(233, 69, 96, 0.1);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: var(--radius-xs);
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--accent-pink);
}

.monitor-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.monitor-container.new-data {
    animation: flashUpdate 1s ease;
}

@keyframes flashUpdate {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; background: rgba(74, 222, 128, 0.05); }
}

.monitor-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.monitor-section {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
}

.monitor-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.monitor-conv {
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.monitor-conv-header {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.monitor-msg {
    display: flex;
    gap: 0.5rem;
    padding: 4px 0;
    font-size: 0.85rem;
    flex-wrap: wrap;
    align-items: baseline;
}

.monitor-from {
    font-weight: 700;
    color: var(--accent-purple);
    min-width: 60px;
}

.monitor-content {
    color: var(--text-dim);
    flex: 1;
}

.monitor-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

/* ============ MEMBER CARD ENHANCEMENTS ============ */
.member-points {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-yellow);
    margin-bottom: 0.5rem;
}

.member-badges {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.btn-dm-member {
    margin-top: 0.75rem;
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    width: 100%;
}

.btn-dm-member:hover {
    border-color: var(--accent-pink);
    color: var(--text);
}

/* ============ PROFILE STATS ============ */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card-2);
    border-radius: var(--radius-xs);
}

.profile-stat {
    text-align: center;
}

.profile-stat .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-yellow);
}

.profile-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============ MEMBER SELECTION FOR GROUPS ============ */
.member-select-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.member-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: background 0.2s;
}

.member-checkbox:hover {
    background: var(--bg-hover);
}

.member-checkbox input {
    cursor: pointer;
}

.member-checkbox span {
    font-size: 0.9rem;
    color: var(--text);
}

/* ============ AI AGENT WIDGET ============ */
.ai-agent-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.ai-agent-orb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4), 0 0 0 4px rgba(16, 185, 129, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: orbFloat 3s ease-in-out infinite;
}

.ai-agent-orb:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5), 0 0 0 6px rgba(16, 185, 129, 0.15);
}

.ai-agent-orb.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    animation: none;
    transform: rotate(45deg);
}

.orb-inner {
    width: 28px;
    height: 28px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-inner svg {
    width: 24px;
    height: 24px;
}

.orb-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.3);
    animation: orbPulse 2s ease-out infinite;
}

.orb-ring-2 {
    animation-delay: 1s;
    border-color: rgba(16, 185, 129, 0.15);
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes orbPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* AI Agent Panel */
.ai-agent-panel {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 380px;
    max-height: 600px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: panelSlideUp 0.3s ease;
}

.ai-agent-panel.active {
    display: flex;
}

@keyframes panelSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-agent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
}

.ai-agent-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: statusBlink 2s infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card-2);
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-close:hover {
    background: var(--accent-pink);
    color: white;
}

.ai-agent-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-welcome {
    text-align: center;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.ai-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.ai-avatar-large svg {
    width: 32px;
    height: 32px;
}

.ai-welcome h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.ai-welcome p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.ai-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-message {
    display: flex;
    gap: 10px;
    animation: msgIn 0.3s ease;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-message-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    line-height: 1.5;
}

.ai-message.ai .ai-message-bubble {
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.ai-message.user .ai-message-bubble {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
}

.ai-message.ai .ai-message-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.ai-message.user .ai-message-avatar {
    background: var(--accent-purple);
    color: white;
}

.ai-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--bg-card-2);
    border-radius: var(--radius-xs);
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.ai-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.ai-agent-footer {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-card-2);
}

.ai-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.ai-input-wrap input {
    flex: 1;
    background: var(--bg-deep);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    font-family: inherit;
}

.ai-input-wrap input:focus {
    border-color: #10b981;
}

.ai-send {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    min-width: auto;
}

.ai-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.ai-send svg {
    width: 16px;
    height: 16px;
}

.ai-disclaimer {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============ ENHANCED CHAT LAYOUT (Screenshot Style) ============ */
.chat-view-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - 4rem);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* Left Sidebar */
.chat-sidebar {
    background: var(--bg-card-2);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    min-width: 320px;
}

.chat-sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.chat-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.chat-header-top h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
}

.btn-icon-new {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    min-width: auto;
}

.btn-icon-new:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.4);
}

.chat-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-meta::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-yellow);
    animation: pulse 2s infinite;
}

.chat-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-deep);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 8px 12px;
    margin-bottom: 0.75rem;
}

.chat-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.chat-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
}

.chat-search input::placeholder {
    color: var(--text-muted);
}

.chat-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--accent-pink);
    color: var(--text);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
    border-color: transparent;
    color: white;
}

/* Chat List Items */
.chat-list-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.chat-section-header {
    padding: 0.5rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border-left: 3px solid transparent;
}

.chat-list-item:hover {
    background: var(--bg-hover);
}

.chat-list-item.active {
    background: rgba(233, 69, 96, 0.08);
    border-left-color: var(--accent-pink);
}

.chat-list-item.unread {
    background: rgba(233, 69, 96, 0.04);
}

.chat-list-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    background: var(--accent-purple);
}

.chat-list-icon.group-icon {
    border-radius: var(--radius-xs);
}

.chat-list-icon.dm-icon {
    font-size: 1.1rem;
}

.chat-list-info {
    flex: 1;
    min-width: 0;
}

.chat-list-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-list-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.chat-unread {
    background: var(--accent-pink);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
    min-width: 18px;
    text-align: center;
}

/* Right Main Area */
.chat-main-area {
    display: flex;
    flex-direction: column;
    background: var(--bg-deep);
    position: relative;
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.empty-icon svg {
    width: 36px;
    height: 36px;
}

.chat-empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.chat-empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 300px;
}

/* Active Chat Content */
.chat-active-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    background: var(--bg-card);
}

.chat-top-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.chat-title-wrap h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.chat-title-wrap span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chat-top-actions {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ============ ENHANCED PLAYGROUND ============ */
.playground-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - 10rem);
}

.playground-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
}

.playground-toolbar select {
    background: var(--bg-card-2);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
}

.playground-actions {
    display: flex;
    gap: 0.5rem;
}

.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #10b981;
    margin-left: auto;
}

.live-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.8); }
}

.playground-panes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.playground-panes.three-pane {
    grid-template-columns: 1fr 1fr 1fr;
}

.code-pane, .output-pane, .preview-pane {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-pane {
    display: none;
}

.preview-pane.active {
    display: flex;
}

.pane-label {
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    background: var(--bg-card-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    animation: livePulse 1.5s infinite;
}

#code-editor {
    flex: 1;
    background: var(--bg-deep);
    border: none;
    padding: 1rem;
    color: var(--text);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    outline: none;
}

#code-output {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

#code-output pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-dim);
}

#html-preview {
    flex: 1;
    border: none;
    background: white;
    width: 100%;
    min-height: 200px;
}

/* ============ RESPONSIVE UPDATES ============ */
@media (max-width: 1024px) {
    .chat-view-layout { grid-template-columns: 280px 1fr; }
    .playground-panes.three-pane { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .hub-sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
        transition: left 0.3s;
    }
    .hub-sidebar.open { left: 0; }

    .chat-view-layout { 
        grid-template-columns: 1fr; 
    }
    .chat-sidebar {
        position: fixed;
        left: -320px;
        height: 100vh;
        z-index: 50;
        transition: left 0.3s;
    }
    .chat-sidebar.open { left: 0; }

    .playground-panes { grid-template-columns: 1fr; height: auto; }
    .playground-panes.three-pane { grid-template-columns: 1fr; }
    .playground-layout { height: auto; }

    .ai-agent-panel {
        width: calc(100vw - 48px);
        right: -12px;
    }

    .main-title { font-size: 3.5rem; }
    .subtitle { font-size: 0.9rem; }
    .landing-actions { flex-direction: column; }
    .avatar-preset-grid { grid-template-columns: repeat(4, 1fr); }
    .pending-user-card { flex-direction: column; gap: 1rem; align-items: flex-start; }
}