:root {
    /* Colors - Light Theme based on screenshot */
    --bg-app: #f9fafb; /* Very light gray for main background */
    --bg-surface: #ffffff; /* White for cards */
    --bg-sidebar: #ffffff;
    --text-primary: #111827; /* Dark gray almost black */
    --text-secondary: #4b5563; /* Medium gray */
    --text-muted: #9ca3af; /* Light gray */
    
    --primary-color: #2563eb; /* Blue */
    --primary-hover: #1d4ed8;
    --success-color: #84cc16; /* Lime green for MEET */
    --danger-color: #ef4444; /* Red for end call */
    
    --border-color: #e5e7eb; /* Light border */
    --border-active: #2563eb;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 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);

    /* Layout */
    --header-height: 70px;
    --sidebar-width: 380px;
    --control-bar-height: 80px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; }
p { margin: 0; line-height: 1.5; }

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.w-full { width: 100%; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }

/* App Layout */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    height: calc(100vh - var(--header-height));
}

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-xl);
    z-index: 20;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    text-decoration: none;
}
.logo span { color: var(--success-color); }

/* Search Bar */
.search-bar {
    position: relative;
    width: 600px;
    max-width: 100%;
}
.search-input {
    width: 100%;
    padding: 12px 48px; /* Room for icons */
    background: var(--bg-app);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-icon-left {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-icon-right {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.9rem;
}
.btn-primary {
    background: var(--primary-color);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-icon-only {
    padding: 10px;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}
.btn-icon-only:hover { background: var(--bg-app); color: var(--text-primary); }

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: var(--spacing-md);
    width: 100%;
    /* Let the grid take available height but minimal size too */
    min-height: 500px; 
}

.participant-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    aspect-ratio: 4/3;
}

.participant-card.speaking {
    border: 2px solid var(--primary-color);
}

.speaking-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-badge {
    position: absolute;
    bottom: 40px; 
    right: 35%; /* Adjust based on avatar */
    background: #f3f4f6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.avatar-wrapper {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.placeholder-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #9ca3af;
    overflow: hidden;
}
/* Simulate the 3D avatars with gradient */
.avatar-1 { background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%); }
.avatar-2 { background: linear-gradient(135deg, #93c5fd 0%, #3b82f6 100%); }
.avatar-3 { background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%); }
.avatar-4 { background: linear-gradient(135deg, #86efac 0%, #22c55e 100%); }

.participant-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.participant-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.more-participants {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
}
.small-avatars {
    display: flex;
    gap: -8px;
    margin-bottom: 8px;
}
.small-avatars .placeholder-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    border: 2px solid white;
    margin-left: -8px;
}
.small-avatars .placeholder-avatar:first-child { margin-left: 0; }
.view-all-link {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

/* Transcription Panel */
.transcription-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.transcription-content {
    flex: 1;
}
.transcription-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}
.cc-icon {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 4px;
}

.transcript-line {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.ts-time { color: var(--primary-color); font-size: 0.8rem; min-width: 60px; margin-top: 2px; }
.ts-text { color: var(--text-muted); line-height: 1.4; }
.ts-text strong { color: var(--text-secondary); font-weight: 600; margin-right: 4px; }
.ts-text.highlight { color: var(--text-primary); font-style: italic; }

.audio-viz {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 60px;
    padding-left: var(--spacing-lg);
}
.viz-bar {
    width: 6px;
    background: var(--primary-color);
    border-radius: 4px;
    animation: pulse 1s infinite ease-in-out;
}
@keyframes pulse {
    0%, 100% { height: 20%; opacity: 0.6; }
    50% { height: 100%; opacity: 1; }
}

/* Sidebar Chat */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}
.tab {
    flex: 1;
    text-align: center;
    padding: 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid transparent;
}
.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.chat-group {
    display: flex;
    gap: 12px;
}
.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    flex-shrink: 0;
}
.chat-content {
    flex: 1;
}
.chat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    align-items: baseline;
}
.chat-author { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.chat-bubble {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}
.chat-time {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 4px;
    display: block;
}

.file-card {
    background: #eff6ff; /* Light blue tint */
    border: 1px solid #dbeafe;
    padding: 12px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.file-icon-box {
    width: 32px;
    height: 32px;
    background: #dbeafe;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.chat-input-wrapper {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}
.chat-input-box {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.input-actions {
    display: flex;
    gap: 8px;
    color: var(--text-muted);
}

/* Footer / Control Bar */
.control-bar-wrapper {
    background: var(--bg-surface);
    height: var(--control-bar-height);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-xl);
    width: 100%;
    z-index: 30;
}

.control-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.control-btn:hover {
    background: #f9fafb;
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.control-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
.control-btn.danger {
    background: white;
    color: var(--danger-color);
    border-color: #fee2e2;
}
.control-btn.danger:hover {
    background: var(--danger-color);
    color: white;
}

.transcribe-btn {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.transcribe-btn:hover {
    background: var(--primary-hover);
}

/* Icons */
.material-icons {
    font-family: 'Material Icons Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
}

/* Responsive */
@media (max-width: 1200px) {
    .sidebar { display: none; }
}
@media (max-width: 768px) {
    .video-grid { grid-template-columns: 1fr; }
    .search-bar { display: none; }
    .app-header { padding: 0 var(--spacing-md); }
}
