:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --card-bg: rgba(30, 41, 59, 0.7);
    --sidebar-bg: rgba(0, 0, 0, 0.2);
    --input-bg: rgba(255, 255, 255, 0.07);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin: 0;
    line-height: 1.5;
}

/* Background effects */
body::before, body::after {
    content: ''; position: fixed; border-radius: 50%;
    filter: blur(100px); z-index: -1;
    animation: float 10s infinite ease-in-out alternate;
}
body::before { width: 400px; height: 400px; background: rgba(59, 130, 246, 0.2); top: -100px; left: -100px; }
body::after { width: 300px; height: 300px; background: rgba(139, 92, 246, 0.2); bottom: -100px; right: -100px; animation-delay: -5s; }

@keyframes float { 0% { transform: translateY(0) scale(1); } 100% { transform: translateY(50px) scale(1.1); } }

.glass-container {
    width: 98%;
    max-width: 1600px;
    height: 96vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.6rem; font-weight: 800; display: flex; align-items: center; gap: 0.75rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column; /* Changed from default flex (row) */
    overflow: hidden;
    min-height: 0;
}

/* Grid Views */
.standard-view {
    overflow-y: auto;
    padding: 2.5rem;
    width: 100%;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    width: 100%;
}

.agent-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Fix dropdown visibility */
select option {
    background: #1e293b;
    color: white;
}

/* File attachments in list */
.list-attachments {
    margin-top: 0.75rem;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.list-file-pill {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    border: 1px solid var(--glass-border);
}
.list-file-pill:hover {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
    border-color: var(--primary);
}

.agent-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.agent-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    border: 2px solid #1e293b;
    z-index: 10;
}

/* Detail view layout */
.chat-layout {
    flex: 1;
    display: flex;
    width: 100%;
    min-height: 0;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: rgba(0, 0, 0, 0.05);
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.task-sidebar {
    width: 340px;
    border-left: 1px solid var(--glass-border);
    background: var(--sidebar-bg);
    padding: 2rem;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 700;
}

/* UI Elements */
button { cursor: pointer; font-family: inherit; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); border: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }

.nav-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-main); }
.nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.primary-btn { background: var(--primary); color: white; padding: 0.75rem 1.5rem; border-radius: 12px; font-weight: 600; font-size: 0.95rem; }
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; border-radius: 10px; background: rgba(255,255,255,0.08); color: white; border: 1px solid rgba(255,255,255,0.05); }
.btn-sm:hover { background: rgba(255,255,255,0.15); }
.btn-danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: var(--danger); color: white; }

/* Messages */
.chat-msg {
    max-width: 85%;
    padding: 1.25rem 1.5rem;
    border-radius: 20px;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.msg-user { background: var(--primary); align-self: flex-end; border-bottom-right-radius: 4px; color: white; }
.msg-agent { background: rgba(255, 255, 255, 0.04); align-self: flex-start; border: 1px solid var(--glass-border); border-bottom-left-radius: 4px; }

.msg-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}
.msg-user .msg-header { color: rgba(255, 255, 255, 0.8); }

/* Inputs */
.chat-input-form {
    display: flex; gap: 12px; padding: 1.5rem 2rem;
    background: rgba(0,0,0,0.25); border-top: 1px solid var(--glass-border);
}
.chat-input-form input {
    flex: 1; background: var(--input-bg); border: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem; border-radius: 14px; color: white; font-size: 1rem;
    outline: none; transition: all 0.2s;
}
.chat-input-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }

.mention-pills { display: flex; gap: 8px; padding: 0.75rem 2rem; background: rgba(0,0,0,0.15); flex-wrap: wrap; border-top: 1px solid var(--glass-border); }
.mention-pill { background: rgba(59, 130, 246, 0.1); color: var(--primary); padding: 5px 14px; border-radius: 20px; font-size: 0.85rem; cursor: pointer; border: 1px solid rgba(59, 130, 246, 0.2); transition: all 0.2s; font-weight: 600; }
.mention-pill:hover { background: var(--primary); color: white; }

/* File Item */
.file-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1rem; background: rgba(255,255,255,0.04); border-radius: 12px;
    margin-bottom: 0.5rem; border: 1px solid rgba(255,255,255,0.05);
}
.file-name { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }

/* Select styling */
select {
    width: 100%; padding: 0.75rem; border-radius: 12px; 
    background: var(--input-bg); color: white; border: 1px solid var(--glass-border);
    outline: none; cursor: pointer;
}

/* Modal */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    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 {
    width: 90%; max-width: 500px; padding: 2.5rem;
    background: #1e293b; border: 1px solid var(--glass-border);
    border-radius: 24px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-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); }
