:root {
    --bg-dark: #0f111a;
    --card-bg: rgba(25, 28, 41, 0.6);
    --card-border: rgba(255, 255, 255, 0.05);
    --accent-primary: #8a2be2; /* Vibrant purple */
    --accent-secondary: #00d2ff; /* Neon cyan */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --success: #10b981;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs (Glassmorphism effect) */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
}

.blob-1 {
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
}

.blob-2 {
    bottom: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
}

/* Layout */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.header-content h1 span {
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-content p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.widget-insights { grid-column: span 12; }
.widget-content { grid-column: span 6; }
.widget-agents { grid-column: span 6; }

@media (max-width: 1024px) {
    .widget-content, .widget-agents { grid-column: span 12; }
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Data Items */
.insight-item, .content-item, .agent-item {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 1rem;
    border-left: 3px solid transparent;
}

.insight-item { border-left-color: var(--accent-primary); }
.content-item { border-left-color: var(--accent-secondary); }
.agent-item { border-left-color: var(--success); display: flex; justify-content: space-between; align-items: center; }

.insight-item strong {
    display: block;
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.insight-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.impact-badge {
    display: inline-block;
    margin-top: 0.5rem;
    background: rgba(138, 43, 226, 0.2);
    color: #e2b3ff;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.platform-tag {
    color: var(--accent-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    display: block;
}

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

.loading {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background: var(--bg-dark);
    border: 1px solid var(--accent-primary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transition: height 0.3s ease;
    height: 400px;
}

.chat-widget.collapsed {
    height: 52px !important; /* Just the header */
}

.chat-header {
    background: rgba(138, 43, 226, 0.2);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--accent-primary);
}

.chat-header h3 {
    font-size: 1rem;
    margin: 0;
    color: #fff;
}

.chat-header button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
}

.chat-body {
    height: 300px;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0,0,0,0.4);
}

.message {
    padding: 10px;
    border-radius: 8px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.system {
    background: rgba(138, 43, 226, 0.2);
    color: #e2b3ff;
    align-self: flex-start;
    border: 1px solid rgba(138, 43, 226, 0.4);
}

.message.user {
    background: rgba(0, 210, 255, 0.2);
    color: #00d2ff;
    align-self: flex-end;
    border: 1px solid rgba(0, 210, 255, 0.4);
}

.chat-input-area {
    display: flex;
    padding: 10px;
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
}

.chat-input-area input {
    flex: 1;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    outline: none;
}

.chat-input-area button {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 0 15px;
    margin-left: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.chat-input-area button:hover {
    background: #9d4edd;
}

/* Upload Zone Styles */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.02);
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(138, 43, 226, 0.1);
}

.upload-content p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.vault-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vault-item-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-all;
}

.vault-item-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 10px;
}
