:root {
    --bg-base: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --glass-bg: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs for Glassmorphism */
.blob {
    position: absolute;
    z-index: -1;
    opacity: 0.5;
    will-change: transform;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-blue {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(15,23,42,0) 70%);
}

.blob-green {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(16,185,129,0.2) 0%, rgba(15,23,42,0) 70%);
    animation-delay: -5s;
}

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

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100vh;
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-container h1 {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.fw-light {
    font-weight: 300;
    color: var(--text-secondary);
}

.pulse-indicator {
    width: 12px;
    height: 12px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pulse-indicator.active {
    background-color: var(--accent-green);
    box-shadow: 0 0 12px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 2rem;
    flex: 1;
    min-height: 0;
}

/* Typography & Headers */
.panel-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Transcript Panel */
.transcript-panel {
    display: flex;
    flex-direction: column;
}

.transcript-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 1rem;
}

/* Custom Scrollbar */
.transcript-container::-webkit-scrollbar {
    width: 6px;
}
.transcript-container::-webkit-scrollbar-track {
    background: transparent;
}
.transcript-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.message {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    max-width: 85%;
    line-height: 1.5;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes slideIn {
    to { opacity: 1; transform: translateY(0); }
}

.system-msg {
    align-self: center;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.875rem;
    border: 1px dashed var(--glass-border);
}

.agent-msg {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-bottom-left-radius: 0.25rem;
}

.user-msg {
    align-self: flex-end;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-bottom-right-radius: 0.25rem;
}

.server-msg {
    align-self: center;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: #fbbf24;
    text-align: center;
    margin: 1rem 0;
    width: 80%;
}

/* Calls Panel */
.calls-panel {
    display: flex;
    flex-direction: column;
}

.calls-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
}

.call-item {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.call-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.call-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
}

.call-id-label {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* Side Panel */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.data-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-item .value {
    font-size: 1.125rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.value.highlight {
    color: var(--accent-green);
    animation: flash 1s ease;
}

@keyframes flash {
    0% { color: var(--text-primary); text-shadow: none; }
    50% { color: var(--accent-green); text-shadow: 0 0 10px var(--accent-green); }
    100% { color: var(--accent-green); text-shadow: none; }
}

/* Sync Status */
.sync-status-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    transition: all 0.4s ease;
}

.sync-status-container.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.sync-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    transition: all 0.4s ease;
}

.sync-status-container.success .sync-icon {
    background: var(--accent-green);
    color: var(--bg-base);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.sync-text h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.sync-text p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
