:root {
    --primary: #8a2be2;
    --secondary: #4b0082;
    --accent: #00f2ff;
    --bg-dark: #0a0a0c;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text: #e0e0e0;
    --text-dim: #a0a0a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg-dark);
    background-image: url('assets/bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    overflow: hidden;
}

.app-container {
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    display: flex;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

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

/* Sidebar */
.sidebar {
    width: 350px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

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

.sidebar-header h1 {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(45deg, var(--accent), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.search-bar {
    padding: 16px 24px;
}

.search-bar input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 16px;
    color: white;
    outline: none;
    transition: 0.3s;
}

.search-bar input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

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

.chat-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    transition: 0.2s;
    border-left: 4px solid transparent;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent);
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.chat-info {
    flex: 1;
}

.chat-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.chat-info p {
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.chat-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-status {
    display: flex;
    align-items: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 10px #00ff88;
}

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

.message {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

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

.message.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

.message.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.message-time {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 4px;
    text-align: right;
}

.chat-input-area {
    padding: 24px 32px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 16px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 14px 20px;
    color: white;
    outline: none;
    transition: 0.3s;
}

.chat-input-area input:focus {
    border-color: var(--accent);
}

.send-btn {
    background: linear-gradient(45deg, var(--accent), var(--primary));
    border: none;
    border-radius: 16px;
    width: 50px;
    height: 50px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(0, 242, 255, 0.3);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 242, 255, 0.5);
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
