/* Quillfy AI - Hyper-Sentient AI Interface */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --error-color: #F44336;
    --info-color: #2196F3;
    
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: #1e1e3f;
    
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --text-muted: #8b8ba7;
    
    --border-color: #2a2a4a;
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    --sidebar-width: 320px;
    --sidebar-collapsed-width: 60px;
    --header-height: 70px;
}

.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: all 0.3s ease;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Quantum Status Hologram */
.quantum-status {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    animation: hologramAppear 0.5s ease-out;
}

.quantum-hologram {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.hologram-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(102, 126, 234, 0.1) 50%, transparent 70%);
    animation: hologramScan 3s linear infinite;
}

.quantum-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--text-primary);
}

.quantum-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

.quantum-content h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.quantum-stats {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

@keyframes hologramAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes hologramScan {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 25px 80px var(--shadow-color);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid var(--border-color);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px 30px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 30px;
}

.setup-guide {
    margin-bottom: 30px;
}

.setup-guide h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-footer {
    padding: 20px 30px;
    background: var(--bg-secondary);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Input Styles */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-prefix {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.input-with-prefix:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.prefix {
    background: var(--bg-tertiary);
    padding: 14px 16px;
    border-right: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.input-with-prefix input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: var(--text-primary);
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.help-text {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
    display: block;
    line-height: 1.4;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* App Layout */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand h1 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-version {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.current-agent {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.agent-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agent-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.agent-status {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.agent-status.typing {
    color: var(--warning-color);
}

.agent-status i {
    font-size: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-profile:hover {
    transform: scale(1.05);
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 80px;
}

.sidebar-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar.collapsed .sidebar-header h3,
.sidebar.collapsed .agents-section h4,
.sidebar.collapsed .agent-details,
.sidebar.collapsed .settings-header h4,
.sidebar.collapsed .settings-content {
    display: none;
}

/* Agents List */
.agents-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 20px 0;
}

.agents-section {
    padding: 20px;
}

.agents-section h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.agent-item:hover {
    background: var(--bg-tertiary);
}

.agent-item.active {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.agent-details {
    flex: 1;
    min-width: 0;
}

.agent-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 2px;
}

.agent-persona {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.agent-status-indicator.active {
    background: var(--success-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.agent-status-indicator.inactive {
    background: var(--text-muted);
}

/* AI Settings */
.ai-settings {
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.settings-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.settings-header:hover {
    background: var(--bg-secondary);
}

.settings-header h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-content {
    padding: 0 20px 20px 20px;
    max-height: 400px;
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
}

.setting-value {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.setting-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8rem;
}

/* Chat Main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.chat-main.sidebar-collapsed {
    margin-left: calc(var(--sidebar-collapsed-width) - var(--sidebar-width));
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg-primary);
}

/* Message Styles */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageSlideIn 0.3s ease-out;
}

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant {
    align-self: flex-start;
}

.message.welcome-message {
    max-width: 90%;
    background: var(--bg-card);
    border-radius: 16px;
    margin: 10px 0;
    border: 1px solid var(--border-color);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 2px 12px var(--shadow-color);
    flex: 1;
    border: 1px solid var(--border-color);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.message.welcome-message .message-content {
    background: var(--bg-card);
    box-shadow: none;
    border: 1px solid var(--border-color);
    padding: 20px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.agent-badge {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.message.user .agent-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.message-text {
    line-height: 1.6;
    font-size: 14px;
    color: var(--text-primary);
}

.message.user .message-text {
    color: white;
}

.message-text strong {
    color: inherit;
}

.message-text ul, .message-text ol {
    margin: 10px 0;
    padding-left: 20px;
}

.message-text li {
    margin-bottom: 5px;
}

.message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.message.user .message-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    color: inherit;
}

.message-actions {
    display: flex;
    gap: 5px;
}

.message-action {
    background: transparent;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.message-action:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

/* Typing Indicator */
.typing-indicator .message-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input Container */
.chat-input-container {
    padding: 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.file-preview {
    margin-bottom: 15px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.file-info i {
    color: var(--primary-color);
}

.chat-input {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.chat-input.focused {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.file-upload-btn {
    flex-shrink: 0;
}

.chat-input textarea {
    flex: 1;
    border: none;
    padding: 8px 12px;
    resize: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: transparent;
    color: var(--text-primary);
    max-height: 120px;
}

.chat-input textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-input textarea::placeholder {
    color: var(--text-muted);
}

.chat-input-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.send-button {
    padding: 10px;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Profile Avatar */
.profile-avatar {
    text-align: center;
    margin-bottom: 25px;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    margin-bottom: 15px;
}

/* Math and Code Styles */
.math-inline {
    font-style: italic;
}

.math-display {
    margin: 15px 0;
    text-align: center;
}

.code-block {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid var(--border-color);
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
}

.code-block code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    color: white;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px var(--shadow-color);
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--border-color);
}

.spinner-animation {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

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

.loading-spinner h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.loading-spinner p {
    margin-bottom: 25px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    border-left: 4px solid var(--primary-color);
    z-index: 10000;
    max-width: 400px;
    animation: slideInRight 0.3s ease;
    border: 1px solid var(--border-color);
}

.notification-success { border-left-color: var(--success-color); }
.notification-error { border-left-color: var(--error-color); }
.notification-warning { border-left-color: var(--warning-color); }
.notification-info { border-left-color: var(--info-color); }

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height);
        bottom: 0;
        z-index: 99;
        transform: translateX(0);
        transition: transform 0.3s ease;
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .chat-main {
        margin-left: 0 !important;
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .header-brand h1 {
        font-size: 1.3rem;
    }
    
    .current-agent {
        padding: 6px 12px;
    }
    
    .agent-info {
        display: none;
    }
    
    .message {
        max-width: 95%;
    }
    
    .modal {
        margin: 20px;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .chat-input-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 10px;
    }
    
    .header-brand h1 {
        font-size: 1.1rem;
    }
    
    .app-version {
        display: none;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .message-content {
        padding: 12px 16px;
    }
    
    .chat-input {
        padding: 10px;
    }
    
    .settings-content {
        max-height: 300px;
    }
}

/* MathJax Container Styles */
.MathJax {
    color: var(--text-primary) !important;
}

.mjx-chtml {
    color: inherit !important;
}

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

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

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

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

/* Selection Styling */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}
/* Neural Profile Modal Fixes */
.profile-avatar {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    margin-bottom: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.profile-avatar .btn-secondary {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

/* Modal Body Scroll Fix */
.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Responsive Modal Fixes */
@media (max-width: 768px) {
    .modal {
        margin: 20px;
        max-width: 95%;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 20px;
        max-height: 60vh;
    }
    
    .profile-avatar {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .avatar-preview {
        width: 70px;
        height: 70px;
    }
    
    .input-group {
        margin-bottom: 15px;
    }
    
    .input-group input,
    .input-group textarea {
        padding: 12px 14px;
        font-size: 16px; /* Better for mobile */
    }
}

@media (max-width: 480px) {
    .modal {
        margin: 10px;
        max-width: 98%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 15px;
        max-height: 65vh;
    }
    
    .modal-footer {
        padding: 15px 20px;
    }
    
    .profile-avatar {
        margin-bottom: 12px;
    }
    
    .avatar-preview {
        width: 60px;
        height: 60px;
    }
    
    .input-group label {
        font-size: 0.9rem;
    }
}

/* Specific Neural Profile Modal Styles */
.modal[data-type="profile"] .modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Ensure textareas are properly sized */
#user-bio {
    min-height: 100px;
    resize: vertical;
}

/* Better scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

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

/* Modal Footer Button Layout */
.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    min-width: 120px;
    flex: 0 1 auto;
}

@media (max-width: 480px) {
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        min-width: 100%;
        flex: 1;
    }
}

/* Input Focus States for Better UX */
.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Better Label Styling */
.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* File Input Styling */
input[type="file"] {
    border: none;
    padding: 0;
}

/* Ensure modal is centered properly */
.modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Mobile-specific modal positioning */
@media (max-height: 700px) {
    .modal {
        max-height: 85vh;
    }
    
    .modal-body {
        max-height: 55vh;
    }
}

/* Prevent modal from being too tall on very small screens */
@media (max-height: 500px) {
    .modal {
        max-height: 80vh;
    }
    
    .modal-body {
        max-height: 50vh;
    }
}

/* Better spacing for form elements */
.input-group:last-child {
    margin-bottom: 0;
}

/* Avatar upload button styling */
.profile-avatar .btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.profile-avatar .btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}