/* CSS Variables - Salesforce Lightning Inspired */
:root {
    /* Primary Colors */
    --color-primary: #0176D3;
    --color-primary-dark: #014486;
    --color-primary-light: #1B96FF;

    /* AI Accent */
    --color-ai: #7F3FBF;
    --color-ai-light: #9D5BD2;
    --color-ai-dark: #5A2D82;
    --color-ai-glow: rgba(127, 63, 191, 0.3);

    /* Semantic Colors */
    --color-success: #2E844A;
    --color-success-light: #45C65A;
    --color-warning: #DD7A01;
    --color-warning-light: #FE9339;
    --color-error: #BA0517;
    --color-error-light: #EA001E;

    /* Neutrals */
    --color-background: #F3F3F3;
    --color-surface: #FFFFFF;
    --color-surface-alt: #F9FAFB;
    --color-border: #E5E5E5;
    --color-border-dark: #C9C9C9;

    /* Text Colors */
    --color-text-primary: #181818;
    --color-text-secondary: #5C5C5C;
    --color-text-muted: #939393;
    --color-text-inverse: #FFFFFF;

    /* Speaker Colors */
    --color-agent: #0176D3;
    --color-customer: #2E844A;

    /* Sizing */
    --header-height: 56px;
    --sidebar-width: 220px;
    --player-height: 72px;
    --panel-padding: 20px;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-panel: 400ms ease-out;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-background);
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-inverse);
}

.logo-icon {
    width: 28px;
    height: 28px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.agent-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-inverse);
}

.agent-label {
    opacity: 0.8;
    font-size: 13px;
}

.agent-name {
    font-weight: 600;
}

.agent-id {
    opacity: 0.6;
    font-size: 12px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: var(--color-text-inverse);
    font-size: 13px;
}

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

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: var(--player-height);
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 16px 0;
    z-index: 50;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--color-surface-alt);
    color: var(--color-text-primary);
}

.nav-item.active {
    background: rgba(1, 118, 211, 0.1);
    color: var(--color-primary);
}

/* Main Layout */
.app-layout {
    display: flex;
    padding-top: var(--header-height);
    padding-bottom: var(--player-height);
    height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

.content-row {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
    overflow: hidden; /* Prevent row from expanding beyond its flex allocation */
}

/* Panels */
.panel {
    background: var(--color-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px var(--panel-padding);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-alt);
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--color-success);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.panel-badge svg {
    width: 14px;
    height: 14px;
}

/* Customer 360 Panel */
.customer-360 {
    width: 400px;
    flex-shrink: 0;
}

/* Transcript Panel */
.transcript-panel {
    flex: 1;
    min-width: 0;
}

/* Call Control Panel */
.call-control {
    width: 400px;
    flex-shrink: 0;
}

/* AI Assistant Panel */
.ai-assistant {
    flex: 1;
    min-width: 0;
    min-height: 0; /* Allow panel to shrink and enable overflow in children */
    max-height: 100%; /* Prevent panel from exceeding row height */
}

.ai-icon {
    width: 18px;
    height: 18px;
    color: var(--color-ai);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

.ai-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-ai);
    animation: pulse-dot 1.5s infinite;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface-alt);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}
