/* CollabHub AI - Main Stylesheet */

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

:root {
    /* Colors */
    --primary-color: #5b6fc8;
    --primary-dark: #4a5ba8;
    --secondary-color: #10b981;
    --background-dark: #0f172a;
    --background-medium: #1e293b;
    --background-light: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --ai-color: #10b981;
    --human-color: #3b82f6;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--background-medium);
    border-bottom: 1px solid var(--border-color);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--primary-color);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    position: relative;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 14px;
    color: var(--text-secondary);
}

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

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

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--human-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.settings-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.settings-btn:hover {
    background: var(--background-light);
    color: var(--text-primary);
}

/* Admin Dropdown */
.admin-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--spacing-sm);
    background: var(--background-medium);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
}

.admin-dropdown a {
    display: block;
    padding: var(--spacing-md);
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

.admin-dropdown a:last-child {
    border-bottom: none;
}

.admin-dropdown a:hover {
    background: var(--background-light);
}

/* Main Layout */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--background-medium);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.workspace-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.btn-collapse {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs);
}

.btn-new-chat {
    margin: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-new-chat:hover {
    background: var(--primary-dark);
}

.sidebar-section {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    position: relative;
}

.nav-menu li:hover:not(.disabled) {
    background: var(--background-light);
    color: var(--text-primary);
}

.nav-menu li.active {
    background: var(--primary-color);
    color: white;
}

.nav-menu li.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.coming-soon {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 6px;
    background: var(--background-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--background-medium);
}

.content-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.content-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-icon {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 14px;
}

.btn-icon:hover:not(.disabled) {
    background: var(--primary-dark);
}

.btn-icon.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

/* Message Styles */
.message {
    display: flex;
    gap: var(--spacing-md);
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.message-avatar.human {
    background: var(--human-color);
}

.message-avatar.ai {
    background: var(--ai-color);
}

.message-avatar.system {
    background: var(--background-light);
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.message-author {
    font-weight: 600;
    font-size: 14px;
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
}

.message-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.message-badge.human {
    background: var(--human-color);
    color: white;
}

.message-badge.ai {
    background: var(--ai-color);
    color: white;
}

.message-badge.system {
    background: var(--background-light);
    color: var(--text-secondary);
}

.message-text {
    background: var(--background-medium);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    line-height: 1.6;
    position: relative;
}

.ai-message .message-text {
    border-left: 3px solid var(--ai-color);
}

.system-message .message-text {
    background: var(--background-light);
    border-left: 3px solid var(--primary-color);
}

.vera-badge {
    display: inline-block;
    margin-left: var(--spacing-sm);
    font-size: 11px;
    padding: 2px 6px;
    background: var(--warning-color);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* Message Input */
.message-input-container {
    border-top: 1px solid var(--border-color);
    background: var(--background-medium);
}

.message-input-toolbar {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.toolbar-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.toolbar-btn:hover:not(.disabled) {
    background: var(--background-light);
    color: var(--text-primary);
}

.toolbar-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message-input-wrapper {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
}

.message-input {
    flex: 1;
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 200px;
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-send {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-send:hover {
    background: var(--primary-dark);
}

/* Right Sidebar */
.right-sidebar {
    width: 320px;
    background: var(--background-medium);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.participants-panel {
    flex: 1;
}

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

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.participant-count {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.participants-section {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.participants-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.5px;
}

.participant {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
}

.participant:hover:not(.disabled) {
    background: var(--background-light);
}

.participant.disabled {
    opacity: 0.5;
}

.participant-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.participant-avatar.human {
    background: var(--human-color);
}

.participant-avatar.ai {
    background: var(--ai-color);
}

.participant-info {
    flex: 1;
}

.participant-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.participant-role {
    font-size: 12px;
    color: var(--text-secondary);
}

.participant-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.participant-status.online {
    background: var(--success-color);
}

.participant-status.offline {
    background: var(--text-muted);
}

/* VERA Widget */
.vera-widget {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg);
    border-radius: var(--radius-lg);
    color: #000;
}

.vera-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    font-size: 16px;
}

.vera-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: var(--spacing-lg);
}

.vera-stat {
    text-align: center;
}

.vera-stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.vera-stat-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.8;
}

.vera-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.vera-btn {
    flex: 1;
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    color: #000;
}

.vera-btn:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--background-medium);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--background-light);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--background-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

::-webkit-scrollbar-track {
    background: var(--background-dark);
}

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

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

/* Responsive */
@media (max-width: 1024px) {
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: -280px;
        height: 100%;
        z-index: 100;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
}

