:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --sidebar-width: 320px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    backdrop-filter: blur(10px);
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
}

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

.logo-icon {
    background: var(--accent);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 800;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.highlight {
    color: var(--accent);
}

.search-box {
    padding: 0 24px 20px;
}

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

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

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid transparent;
}

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

.chat-item.active {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-info .name-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.chat-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-info span.time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chat-info p.preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Content Styling */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(30, 41, 59, 0.3);
}

.chat-header {
    padding: 16px 32px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
}

.client-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.details h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.details span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-refresh {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

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

.empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    gap: 16px;
}

/* Message Bubbles */
.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.message.agent {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
}

.message.client {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.message .meta {
    font-size: 0.7rem;
    margin-top: 4px;
    opacity: 0.7;
    display: block;
}

.message.client .meta {
    text-align: right;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

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