:root {
    --primary: #818cf8;
    --primary-glow: rgba(129, 140, 248, 0.3);
    --secondary: #a78bfa;
    --accent: #f472b6;
    --success: #34d399;
    --error: #f87171;
    --bg-dark: #0d1117;
    --bg-card: rgba(22, 27, 34, 0.8);
    --border-card: #30363d;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --font-main: 'Inter', system-ui, sans-serif;
    --font-display: 'Outfit', sans-serif;
}

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

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Blobs */
.bg-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; overflow: hidden;
}
.blur-blob {
    position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.15;
    animation: float 25s infinite alternate ease-in-out;
}
.blob-1 { width: 600px; height: 600px; background: var(--primary); top: -200px; right: -100px; }
.blob-2 { width: 500px; height: 500px; background: var(--secondary); bottom: -150px; left: -100px; animation-delay: -7s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 30px) scale(1.1); }
}

.app-container {
    display: flex;
    width: 95vw;
    height: 92vh;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-card);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: rgba(13, 17, 23, 0.6);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
}

.logo h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: #f0f6fc;
}

.logo h1 span {
    color: var(--primary);
}

.section-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
    margin-bottom: 16px;
    margin-top: 24px;
}

.channel {
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.channel.active {
    background: rgba(129, 140, 248, 0.1);
    color: var(--primary);
}

.member-list {
    flex-grow: 1;
    overflow-y: auto;
}

.member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-main);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-online { background: var(--success); box-shadow: 0 0 8px var(--success); }

/* Chat Area */
.chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 20px 32px;
    background: rgba(13, 17, 23, 0.3);
    border-bottom: 1px solid var(--border-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: #f0f6fc;
}

.messages-container {
    flex-grow: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    display: flex;
    gap: 16px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #161b22;
    border: 1px solid var(--border-card);
    flex-shrink: 0;
    overflow: hidden;
}

.message-content {
    flex-grow: 1;
}

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

.message-user {
    font-weight: 700;
    color: #f0f6fc;
    font-size: 0.95rem;
}

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

.message-text {
    color: var(--text-main);
    line-height: 1.6;
    font-size: 0.95rem;
    word-break: break-word;
}

.message-attachment {
    margin-top: 12px;
    max-width: 400px;
    border-radius: 12px;
    border: 1px solid var(--border-card);
    overflow: hidden;
}

.message-attachment img {
    width: 100%;
    display: block;
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.message:hover .message-actions {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* Input Area */
.input-area {
    padding: 24px 32px;
    background: rgba(13, 17, 23, 0.3);
    border-top: 1px solid var(--border-card);
}

.input-wrapper {
    background: #0d1117;
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.3s;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
}

.chat-input {
    flex-grow: 1;
    background: none;
    border: none;
    color: var(--text-main);
    padding: 12px 0;
    outline: none;
    font-size: 0.95rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
}

.send-btn {
    background: var(--primary);
    color: white;
}

.send-btn:hover {
    background: var(--primary);
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Modals */
.modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active { display: flex; }

.modal-content {
    background: #161b22;
    border: 1px solid var(--border-card);
    border-radius: 24px;
    padding: 40px;
    width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.modal-content h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 12px;
    color: #f0f6fc;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.modal-content input, .modal-content select {
    width: 100%;
    background: #0d1117;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 14px;
    color: white;
    margin-bottom: 16px;
    outline: none;
    transition: 0.3s;
}

.modal-content input:focus { border-color: var(--primary); }

.modal-content button {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-card); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Legal Styles */
.sidebar-footer a, .login-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-footer a:hover, .login-footer a:hover {
    color: var(--primary);
}

.legal-modal {
    width: 600px !important;
    max-height: 80vh;
    overflow-y: auto;
    text-align: left !important;
}

.legal-text {
    margin-top: 24px;
    line-height: 1.6;
}

.legal-text h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    margin-top: 24px;
    color: var(--primary);
}

.legal-text p {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 16px;
}

.legal-text a {
    color: var(--primary);
}
