﻿@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --primary: #40e0d0;
    --primary-dark: #00bcd4;
    --secondary: #6c5ce7;
    --accent: #ff6b9d;
    --background: #0b1022;
    --surface: #141a33;
    --surface-light: #1b2345;
    --border: rgba(64, 224, 208, 0.2);
    --text-primary: #e0e6ed;
    --text-secondary: #a8afc4;
    --success: #00d4aa;
    --error: #ff6b6b;
    --warning: #ffa502;
    --sidebar-width: 280px;
    --topbar-height: 60px;
    --font-ui: "Space Grotesk", "Manrope", "Satoshi", sans-serif;
    --chat-surface: rgba(20, 26, 46, 0.94);
    --chat-surface-alt: rgba(24, 32, 56, 0.96);
    --chat-border: rgba(120, 150, 220, 0.14);
    --chat-border-strong: rgba(120, 150, 220, 0.24);
    --chat-shadow: 0 12px 30px rgba(5, 8, 20, 0.45);
}

/* GLOBAL TEXT COLOR - Ensure all text is visible on dark backgrounds */
body, html {
    color: var(--text-primary);
    background-color: var(--background);
    font-family: var(--font-ui);
}

/* Main app container */
.app-container {
    color: var(--text-primary);
    background-color: var(--background);
}

/* Chat area */
.chat-area {
    color: var(--text-primary);
    background-color: var(--background);
}

/* Message content default */
.message-content {
    max-width: 68%;
    padding: 14px 18px;
    border-radius: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--text-primary);  /* Ensure text is visible */
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    box-shadow: var(--chat-shadow);
    backdrop-filter: blur(10px);
}

/* LOADING SCREEN */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a1a 0%, #0f0f23 50%, #1a1a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    text-align: center;
}

.loading-rings {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-ring {
    position: absolute;
    border: 3px solid;
    border-radius: 50%;
    animation: load-rotate 3s linear infinite;
}

.loading-ring-1 {
    width: 120px;
    height: 120px;
    border-color: rgba(64, 224, 208, 0.8);
    border-top-color: #40e0d0;
    animation: load-rotate 3s linear infinite;
}

.loading-ring-2 {
    width: 160px;
    height: 160px;
    border-color: rgba(64, 224, 208, 0.5);
    border-bottom-color: #40e0d0;
    animation: load-rotate-reverse 3s linear infinite;
}

.loading-ring-3 {
    width: 80px;
    height: 80px;
    border-color: rgba(108, 92, 231, 0.6);
    border-right-color: #6c5ce7;
    animation: load-rotate 2s linear infinite;
}

@keyframes load-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes load-rotate-reverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

.loading-text h2 {
    font-size: 32px;
    background: linear-gradient(135deg, #40e0d0, #00bcd4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: 2px;
}

.loading-text p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 8px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.progress-bar {
    width: 300px;
    height: 6px;
    background: rgba(64, 224, 208, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(64, 224, 208, 0.3);
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #40e0d0, #00bcd4);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(64, 224, 208, 0.6);
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.progress-text span {
    color: var(--primary);
}

.skip-loading-btn {
    padding: 12px 24px;
    background: rgba(64, 224, 208, 0.2);
    border: 1px solid rgba(64, 224, 208, 0.3);
    border-radius: 25px;
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    margin-top: 20px;
}

.skip-loading-btn:hover {
    background: rgba(64, 224, 208, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(64, 224, 208, 0.2);
}

.skip-loading-btn i {
    font-size: 14px;
}

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

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

.automation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.automation-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.automation-pulse {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: relative;
}

.automation-card.status-in_progress .automation-pulse::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.33); opacity: 1; }
    80%, 100% { transform: scale(1.5); opacity: 0; }
}

.automation-card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
}

.automation-status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 11px;
    font-weight: 600;
}

.automation-status-pill .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.automation-status-pill.status-pending .status-dot { background: var(--warning); }
.automation-status-pill.status-in_progress .status-dot { background: var(--primary); }
.automation-status-pill.status-retrying .status-dot { background: var(--warning); }
.automation-status-pill.status-completed .status-dot { background: var(--success); }
.automation-status-pill.status-stopped .status-dot { background: var(--text-secondary); }
.automation-status-pill.status-failed .status-dot { background: var(--error); }

.automation-summary {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
}

.automation-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.automation-progress-bar {
    position: relative;
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.automation-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.automation-progress-bar.indeterminate .automation-progress-fill {
    width: 40%;
    animation: automationProgressIndeterminate 1.4s ease-in-out infinite;
}

.automation-progress-text {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 64px;
    text-align: right;
}

.automation-card.status-pending .automation-progress-fill { background: var(--warning); }
.automation-card.status-in_progress .automation-progress-fill { background: var(--primary); }
.automation-card.status-retrying .automation-progress-fill { background: var(--warning); }
.automation-card.status-completed .automation-progress-fill { background: var(--success); }
.automation-card.status-stopped .automation-progress-fill { background: var(--text-secondary); }
.automation-card.status-failed .automation-progress-fill { background: var(--error); }

@keyframes automationProgressIndeterminate {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(220%); }
}

.automation-dynamic-details {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    border: 1px solid rgba(64, 224, 208, 0.1);
}

.automation-steps {
    margin-top: 10px;
    display: none;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 10px;
}

.automation-steps-header {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.automation-steps-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.automation-steps-toggle:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.3);
}

.automation-step-item {
    display: grid;
    grid-template-columns: 18px 18px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.automation-step-index {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.automation-step-status i {
    color: var(--text-secondary);
}

.automation-step-item.status-in_progress .automation-step-status i,
.automation-step-item.status-active .automation-step-status i {
    color: var(--primary);
}

.automation-step-item.status-completed .automation-step-status i {
    color: var(--success);
}

.automation-step-item.status-failed .automation-step-status i {
    color: var(--error);
}

.automation-step-item.status-retrying .automation-step-status i {
    color: var(--warning);
}

.automation-step-title {
    color: var(--text-primary);
    font-size: 12px;
}

.automation-step-time {
    color: var(--text-secondary);
    font-size: 11px;
    text-align: right;
    opacity: 0.8;
}

.automation-step-item.status-pending { border-left: 2px solid var(--warning); padding-left: 6px; }
.automation-step-item.status-in_progress,
.automation-step-item.status-active { border-left: 2px solid var(--primary); padding-left: 6px; }
.automation-step-item.status-completed { border-left: 2px solid var(--success); padding-left: 6px; }
.automation-step-item.status-failed { border-left: 2px solid var(--error); padding-left: 6px; }
.automation-step-item.status-retrying { border-left: 2px solid var(--warning); padding-left: 6px; }
.automation-step-item.status-cancelled { border-left: 2px solid var(--border); padding-left: 6px; }

.automation-steps.collapsed {
    display: none;
}

.dynamic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.dynamic-item i {
    color: var(--primary);
    font-size: 14px;
}

.dynamic-item code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    color: var(--success);
}

.automation-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.automation-log-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    padding: 4px 0;
}

.automation-log-toggle:hover { color: var(--primary); }
.automation-log-toggle.active { color: var(--primary); }

.automation-log-container {
    max-height: 150px;
    overflow-y: auto;
    margin-top: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.automation-log-container.collapsed {
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
}

.automation-card-log {
    font-family: 'Consolas', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.automation-card-log-item {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.message-text-body.empty {
    display: none;
}

.thinking-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px auto;
    padding: 6px 12px;
    background: rgba(64, 224, 208, 0.12);
    border: 1px solid rgba(64, 224, 208, 0.25);
    color: var(--primary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thinking-badge:hover {
    background: rgba(64, 224, 208, 0.2);
    box-shadow: 0 0 12px rgba(64, 224, 208, 0.15);
    transform: translateY(-1px);
}

/* ============================================================
   THINKING CARD - consistent with the agent run box.
   Same width, same box colour/border/radius, one clean line, and
   the same leading status marker. Uses the run-box CSS variables
   (defined once in automation_unified.css :root) so both stay in sync.
   ============================================================ */

/* Width-align the thinking card with the run box (24px left, same max). */
.thinking-message .message-content {
    width: calc(100% - 48px);
    max-width: 980px;
    margin: 0 0 0 24px;
}

/* The pill: one tight row, same surface as the run box. */
.thinking-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 0;
    background: var(--run-box-bg, rgba(14, 23, 46, 0.55));
    border: 1px solid var(--run-box-border, rgba(108, 140, 205, 0.18));
    border-radius: var(--run-box-radius, 14px);
    box-shadow: 0 10px 30px rgba(3, 10, 24, 0.22);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}
/* Leading marker matches the run header's status square. */
.thinking-pill::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 6px;
    display: inline-flex;
    background: radial-gradient(circle at center, #5be0d2 0 3px, rgba(91, 224, 210, 0.14) 3.5px);
}
.thinking-pill:hover { border-color: rgba(126, 184, 255, 0.30); }
.thinking-pill.expanded { border-color: rgba(126, 184, 255, 0.40); }

.thinking-pill-title {
    font-weight: 750;
    font-size: 14.5px;
    color: #eff6ff;
}
/* Live preview line hidden so the pill stays one row. */
.thinking-pill-sub { display: none; }

.thinking-pill-cta {
    margin: 0 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #7fb0ff;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
/* Match the mockup: right-side CTA is plain text (no icon). */
.thinking-pill-cta i { display: none; }

/* Expandable reasoning body - consistent with the box surface. */
.thinking-container {
    display: none;
    max-height: 0;
    overflow: hidden;
    padding: 0 14px;
    margin: 0 0 12px 0;
    background: rgba(10, 17, 34, 0.6);
    border: 1px solid var(--run-box-border, rgba(108, 140, 205, 0.18));
    border-radius: 12px;
    transition: max-height 0.35s ease, padding 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}
.thinking-container.expanded {
    display: block;
    max-height: 480px;
    padding: 14px;
    opacity: 1;
}
.thinking-content {
    font-family: "SFMono-Regular", "Consolas", monospace;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    border-left: 3px solid rgba(91, 224, 210, 0.6);
    padding-left: 10px;
}

/* FILE DIFF BUBBLE */
.file-diff-bubble {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    width: 100%;
    animation: slideIn 0.3s ease;
}

.diff-bubble-content {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.diff-bubble-content i {
    color: var(--primary);
}

.diff-file-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.diff-op-tag {
    font-size: 10px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.diff-op-tag.op-edit { background: rgba(64, 224, 208, 0.2); color: var(--primary); }
.diff-op-tag.op-create { background: rgba(0, 212, 170, 0.2); color: var(--success); }
.diff-op-tag.op-delete { background: rgba(239, 68, 68, 0.2); color: var(--error); }

.diff-bubble-actions {
    display: flex;
    gap: 6px;
}

.diff-bubble-actions button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.diff-bubble-actions button:hover {
    background: rgba(64, 224, 208, 0.2);
    color: var(--primary);
    border-color: var(--primary);
}

.diff-bubble-actions .diff-action-undo:hover {
    background: rgba(255, 107, 107, 0.2);
    color: var(--error);
    border-color: var(--error);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* TOP BAR */
.top-bar {
    height: var(--topbar-height);
    background: rgba(15, 15, 35, 0.95);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    backdrop-filter: blur(10px);
    z-index: 100;
    box-shadow: 0 2px 20px rgba(64, 224, 208, 0.1);
}

.top-bar-left {
    flex: 0 0 auto;
}

.ibex-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ibex-logo i {
    font-size: 24px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(64, 224, 208, 0.5));
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(64, 224, 208, 0.1);
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 13px;
}

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

.status-dot.connected {
    background: var(--success);
}

.status-dot.pending-review {
    background: var(--warning);
    animation: pulse 1s infinite;
}

.status-indicator.pending-review {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
}

.status-indicator.pending-review #statusText {
    color: var(--warning);
}

.guest-mode-badge {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 193, 7, 0.45);
    border-radius: 999px;
    background: rgba(255, 193, 7, 0.08);
    color: #ffd666;
    font-size: 12px;
}

.guest-mode-badge button {
    border: none;
    border-radius: 999px;
    padding: 3px 10px;
    cursor: pointer;
    background: #ffd666;
    color: #1b1f2a;
    font-weight: 600;
    font-size: 11px;
}

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

.top-bar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    background: rgba(64, 224, 208, 0.1);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.avatar {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 224, 208, 0.2);
    border-radius: 50%;
}

/* MAIN LAYOUT */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 15, 35, 0.95);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(64, 224, 208, 0.3) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(64, 224, 208, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(64, 224, 208, 0.5);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
}

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

.nav-btn:hover {
    background: rgba(64, 224, 208, 0.1);
    color: var(--text-primary);
    border-color: var(--border);
}

.nav-btn.active {
    background: rgba(64, 224, 208, 0.2);
    color: var(--primary);
    border-color: var(--border);
}

.nav-btn i {
    font-size: 18px;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.workspace-subnav {
    margin: 0 15px 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(64, 224, 208, 0.06), rgba(64, 224, 208, 0.02));
}

.workspace-subnav.hidden {
    display: none;
}

.workspace-subnav-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 8px 2px;
}

#siteopsSubnav {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0 15px 10px;
}

#siteopsSubnav .siteops-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

#siteopsSubnav .siteops-nav-btn:hover {
    background: rgba(64, 224, 208, 0.1);
    color: var(--text-primary);
    border-color: var(--border);
}

#siteopsSubnav .siteops-nav-btn.active {
    background: rgba(64, 224, 208, 0.2);
    color: var(--primary);
    border-color: var(--border);
}

#siteopsSubnav .workspace-subnav-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 6px 10px;
}

.workspace-nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin-bottom: 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: all 0.22s ease;
}

.workspace-nav-btn:last-child {
    margin-bottom: 0;
}

.workspace-nav-btn:hover {
    background: rgba(64, 224, 208, 0.1);
    border-color: var(--border);
    color: var(--text-primary);
}

.workspace-nav-btn.active {
    background: rgba(64, 224, 208, 0.18);
    border-color: var(--border);
    color: var(--primary);
}

.siteops-nav-btn {
    gap: 0;
    justify-content: flex-start;
}

.siteops-nav-btn span {
    display: inline-block;
    width: 100%;
}

.siteops-nav-btn i {
    display: none;
}

.conversations {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 15px 15px;
    overflow-y: auto;
}

.conversations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.new-chat-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(64, 224, 208, 0.2);
    border: 1px solid var(--border);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.new-chat-btn:hover {
    background: rgba(64, 224, 208, 0.3);
    transform: scale(1.1);
}

.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conversation-item {
    padding: 12px;
    background: rgba(64, 224, 208, 0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    color: var(--text-primary);  /* Ensure text is visible */
}

.conversation-item:hover {
    background: rgba(64, 224, 208, 0.1);
    border-color: var(--border);
}

.conversation-item.active {
    background: rgba(64, 224, 208, 0.15);
    border-color: var(--primary);
}

.conversation-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-date {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.conversation-menu {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(15, 15, 35, 0.9);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px;
    display: none;
    z-index: 100;
    gap: 4px;
}

.conversation-item:hover .conversation-menu {
    display: flex;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.menu-btn:hover {
    background: rgba(64, 224, 208, 0.2);
    color: var(--primary);
}

/* HISTORY VIEW */
.history-container {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.history-header {
    margin-bottom: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.history-item:hover {
    background: rgba(26, 26, 46, 0.8);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(64, 224, 208, 0.2);
}

.history-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.history-preview {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.history-date {
    color: var(--primary);
}

.history-count {
    background: rgba(64, 224, 208, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.history-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history-item:hover .history-actions {
    opacity: 1;
}

.history-actions .action-btn {
    padding: 6px 12px;
    font-size: 11px;
}

.history-actions .action-btn.delete {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.3);
    color: var(--error);
}

.history-actions .action-btn.delete:hover {
    background: rgba(255, 107, 107, 0.3);
}
.view-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--background);
}

.view {
    display: none;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(64, 224, 208, 0.3) transparent;
    background: var(--background);
}

.view.active {
    display: flex;
    flex-direction: column;
}

#chatView, #voiceView {
    position: relative;
}

.auth-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 13, 31, 0.88);
    backdrop-filter: blur(12px);
    color: #ffffff;
    padding: 24px;
    pointer-events: auto;
}

.auth-lock-overlay.hidden {
    display: none;
}

.auth-lock-content {
    max-width: 420px;
    width: 100%;
    border-radius: 18px;
    padding: 28px 24px;
    background: rgba(16, 30, 58, 0.96);
    border: 1px solid rgba(123, 196, 255, 0.16);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

.auth-lock-content i {
    font-size: 32px;
    color: #88c7ff;
    margin-bottom: 12px;
    display: inline-block;
}

.auth-lock-content h3 {
    margin: 0 0 12px;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.auth-lock-content p {
    margin: 0 0 20px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
}

.upgrade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #48a3ff, #57f0d5);
    border: none;
    border-radius: 999px;
    color: #081d33;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(76, 178, 255, 0.24);
}

.view::-webkit-scrollbar {
    width: 8px;
}

.view::-webkit-scrollbar-track {
    background: transparent;
}

.view::-webkit-scrollbar-thumb {
    background: rgba(64, 224, 208, 0.3);
    border-radius: 4px;
}

.view::-webkit-scrollbar-thumb:hover {
    background: rgba(64, 224, 208, 0.5);
}

/* CHAT VIEW */
#chatView {
    flex-direction: column !important;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px 28px 26px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.chat-messages::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, rgba(64,224,208,0.0), rgba(64,224,208,0.25), rgba(108,92,231,0.2), rgba(64,224,208,0.0));
    pointer-events: none;
    filter: blur(0.2px);
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    gap: 20px;
    color: var(--text-secondary);
}

.welcome-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.welcome-header i {
    font-size: 48px;
    color: var(--primary);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.welcome-header h2 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.25s ease;
    position: relative;
    padding-left: 28px;
}

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

.message.user {
    justify-content: flex-end;
}

.message::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: none;
}

.message-content {
    max-width: 72%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--chat-border);
    background: var(--chat-surface);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.22);
}

.message.assistant .message-content {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 8px 0;
    max-width: 85%;
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    max-width: 85%;
    min-width: 120px;
    backdrop-filter: blur(10px);
}

.message.voice-message .message-content {
    border-style: dashed;
}

.message-voice-badge {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border: 1px solid var(--chat-border);
    border-radius: 999px;
    padding: 2px 8px;
    margin-bottom: 6px;
}

/* Thinking Block Styles */
.thinking-block {
    display: flex;
    flex-direction: column;
    background: var(--chat-surface-alt) !important;
    border: 1px solid var(--chat-border-strong) !important;
    border-radius: 14px;
    padding: 10px 12px;
    margin: 8px 0 4px 28px;
    font-size: 0.92em;
    max-width: 70%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    position: relative;
}

.thinking-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-bright, #40e0d0);
    font-weight: 700;
    margin-bottom: 8px;
    user-select: none;
}

.thinking-header i {
    font-size: 1.1em;
}

.thinking-timer {
    margin-left: auto;
    font-family: monospace;
    background: rgba(64, 224, 208, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--text-primary);
}

.thought-complete {
    opacity: 0.9;
}

.thought-complete:hover {
    opacity: 1;
}

/* Collapse helper for inline toggle */
.thinking-content.collapsed {
    display: none;
}

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

.thinking-toggle {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
}

.chat-input-area {
    padding: 18px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.attachment-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
    max-height: 120px;
    overflow-y: auto;
}

.attachment-preview-container:empty {
    display: none;
}

.attachment-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.attachment-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-item i {
    font-size: 24px;
    color: var(--primary);
}

.attachment-item .remove-btn {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 5;
}

.attachment-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 8px;
    padding: 2px 4px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

.message-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.msg-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(64, 224, 208, 0.12);
    border: 1px solid rgba(64, 224, 208, 0.4);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(5px);
    animation: tagSlideIn 0.3s ease-out;
}

.msg-tag i {
    font-size: 10px;
}

.msg-tag.tag-browser_automation {
    background: rgba(108, 92, 231, 0.12);
    border-color: rgba(108, 92, 231, 0.4);
    color: #a29bfe;
}

.input-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #000;
    padding: 6px 12px;
    border-radius: 20px;
    margin: 4px 6px 4px 0;
    font-size: 11px;
    font-weight: 600;
    gap: 8px;
    animation: tagSlideIn 0.2s ease-out;
    box-shadow: 0 2px 8px rgba(64, 224, 208, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.1);
    user-select: none;
    max-width: 250px;
    flex-shrink: 0;
    white-space: nowrap;
}

.tag-content {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-remove {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: #000;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tag-remove:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

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

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    background: rgba(16, 18, 26, 0.5);
    border-radius: 18px;
    padding: 8px 12px;
    border: 1px solid rgba(64, 224, 208, 0.1);
    min-height: 56px;
}

.chat-input-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 0 12px;
    max-width: 100%;
    line-height: 1.4;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 14.5px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: all 0.3s ease;
}

#messageInput:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface-light);
    box-shadow: 0 6px 18px rgba(64, 224, 208, 0.18);
}

#messageInput::placeholder {
    color: var(--text-secondary);
}

/* CRITICAL: Input field should NEVER be disabled */
#messageInput:disabled {
    opacity: 1 !important;
    background: rgba(26, 26, 46, 0.8) !important;
    color: var(--text-primary) !important;
    cursor: text !important;
    pointer-events: auto !important;
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(64, 224, 208, 0.3);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn.stop-mode {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
    animation: pulse-stop 1.5s ease-in-out infinite;
}

.send-btn.stop-mode:hover {
    background: linear-gradient(135deg, #ff5252, #ff3838);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
}

@keyframes pulse-stop {
    0%, 100% {
        box-shadow: 0 0 8px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 0 16px rgba(255, 107, 107, 0.6);
    }
}

/* VIEW HEADER */
.view-header {
    padding: 25px;
    border-bottom: 1px solid var(--border);
}

.view-header h2 {
    font-size: 22px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-header h2 i {
    color: var(--primary);
}

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

.search-box {
    margin-top: 15px;
    padding: 10px 16px;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    max-width: 300px;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(64, 224, 208, 0.2);
}

/* MEMORY VIEW */
.memory-container {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.memory-sections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.memory-section {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease;
}

.memory-section:hover {
    background: rgba(26, 26, 46, 0.8);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(64, 224, 208, 0.2);
}

.memory-section h3 {
    font-size: 16px;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.profile-card, .preferences-grid, .dislikes-list, .facts-list, .traits-list, .summaries-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-item, .preference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(64, 224, 208, 0.05);
    border-radius: 8px;
    font-size: 14px;
    position: relative;
}

.preference-checkbox {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.preference-actions {
    display: flex;
    gap: 4px;
}

.bulk-actions {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(64, 224, 208, 0.1);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.section-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.btn-danger {
    padding: 8px 16px;
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 6px;
    color: var(--error);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: rgba(244, 67, 54, 0.3);
    transform: translateY(-1px);
}

.pref-label, .fact-item strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.pref-value {
    color: var(--text-primary);
    flex: 1;
    margin-left: 10px;
}

.summary-item {
    padding: 12px;
    background: rgba(64, 224, 208, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.summary-item p {
    margin: 0 0 5px 0;
    font-size: 13px;
    line-height: 1.4;
}

.summary-item small {
    color: var(--text-secondary);
    font-size: 11px;
}

/* HISTORY VIEW */
.history-container {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

/* TOOLS VIEW */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

.tool-card {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tool-card:hover {
    background: rgba(26, 26, 46, 0.8);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(64, 224, 208, 0.2);
}

.tool-icon {
    font-size: 36px;
}

.tool-card h3 {
    font-size: 16px;
    color: var(--text-primary);
}

.tool-card p {
    font-size: 13px;
    color: var(--text-secondary);
}

.tool-btn {
    padding: 8px 16px;
    background: rgba(64, 224, 208, 0.2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.tool-btn:hover {
    background: rgba(64, 224, 208, 0.3);
    transform: scale(1.05);
}

/* SETTINGS VIEW */
.settings-container {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
    max-width: 600px;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.setting-item {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.setting-item select,
.setting-item input[type="color"] {
    padding: 8px 12px;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
}

.setting-item input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

.setting-item select:focus,
.setting-item input[type="color"]:focus {
    outline: none;
    border-color: var(--primary);
}

.setting-description {
    margin-top: 6px;
    margin-left: 28px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.about-info {
    padding: 16px;
    background: rgba(64, 224, 208, 0.1);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.about-info p {
    margin: 8px 0;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    opacity: 0.3;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .message-content {
        max-width: 85%;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 60px;
        flex-direction: row;
        padding: 10px;
    }

    .sidebar-nav {
        flex-direction: row;
        padding: 0;
        margin: 0;
        flex: 1;
        gap: 4px;
    }

    .nav-btn span {
        display: none;
    }

    .conversations {
        display: none;
    }

    .view-container {
        flex: 1;
    }
}

/* CODE BLOCKS */
pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
    position: relative;
}

code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.code-block {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(64, 224, 208, 0.8);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    color: white;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.code-block:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: rgba(64, 224, 208, 1);
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.message.assistant:hover .message-actions {
    opacity: 1;
}

.message.user .message-actions {
    justify-content: flex-end;
}

.message.user:hover .message-actions {
    opacity: 1;
}

@media (hover: none) {
    .message-actions {
        opacity: 1;
    }
}

.action-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* Enhanced message formatting */
.message-content h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 18px 0 12px 0;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
}

.message-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 16px 0 10px 0;
    color: var(--text-primary);
}

.message-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 12px 0 8px 0;
    color: var(--text-primary);
}

.message-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 10px 0 6px 0;
    color: var(--text-secondary);
}

.message-content p {
    margin: 10px 0;
    line-height: 1.65;
}

.message-content ul, .message-content ol {
    margin: 12px 0;
    padding-left: 25px;
}

.message-content li {
    margin: 6px 0;
    line-height: 1.5;
}

.message-content code {
    background: rgba(12, 14, 20, 0.8);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12.5px;
    color: #f2b6a0;
}

.message-content pre {
    background: rgba(12, 14, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px;
    margin: 14px 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12.5px;
}

.message-content blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    padding-left: 12px;
    margin: 12px 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Clickable Links Styling */
.message-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: rgba(64, 224, 208, 0.4);
    text-underline-offset: 2px;
    font-weight: 500;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    transition: color 0.2s ease;
    display: inline;
    margin: 0;
}

.message-content a:hover {
    color: #7ef0e4;
    text-decoration-color: rgba(64, 224, 208, 0.8);
}

.message-content a:active {
    transform: translateY(0);
}

/* YouTube and Video Links */
.message-content a[href*="youtube.com"],
.message-content a[href*="youtu.be"] {
    color: #ff6b6b;
    text-decoration-color: rgba(255, 107, 107, 0.6);
}

.message-content a[href*="youtube.com"]:hover,
.message-content a[href*="youtu.be"]:hover {
    color: #ff8a80;
}

/* GitHub Links */
.message-content a[href*="github.com"] {
    color: #c8d3ff;
    text-decoration-color: rgba(200, 211, 255, 0.6);
}

.message-content a[href*="github.com"]:hover {
    color: #dee6ff;
}

/* External Link Icon */
.message-content a::after {
    content: "";
}

.function-call {
    background: rgba(156, 39, 176, 0.1);
    border: 1px solid rgba(156, 39, 176, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 12px;
    color: #ce93d8;
}

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(64, 224, 208, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(64, 224, 208, 0.5);
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* VOICE INTERFACE */
.voice-view {
    padding: 0 !important;
    overflow: hidden !important;
}

.voice-interface {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a1a 0%, #0f0f23 50%, #1a1a3a 100%);
    position: relative;
    overflow: hidden;
}

.starfield {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, rgba(255, 255, 255, 0.2) 2px, transparent 40px),
        radial-gradient(2px 2px at 60% 70%, white, rgba(255, 255, 255, 0.2) 1px, transparent 50px),
        radial-gradient(1px 1px at 50% 50%, white, rgba(255, 255, 255, 0.2) 1px, transparent 30px),
        radial-gradient(1px 1px at 80% 10%, white, rgba(255, 255, 255, 0.2) 2px, transparent 40px),
        radial-gradient(2px 2px at 90% 60%, white, rgba(255, 255, 255, 0.2) 1px, transparent 40px),
        radial-gradient(1px 1px at 30% 80%, white, rgba(255, 255, 255, 0.2) 1px, transparent 30px),
        radial-gradient(1px 1px at 70% 40%, white, rgba(255, 255, 255, 0.2) 2px, transparent 40px),
        radial-gradient(2px 2px at 10% 90%, white, rgba(255, 255, 255, 0.2) 1px, transparent 40px);
    background-repeat: repeat;
    background-size: 200% 200%;
    opacity: 0.6;
    z-index: 1;
}

.ibex-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.rings-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ring {
    position: absolute;
    border: 2px solid;
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

.ring-1 {
    width: 200px;
    height: 200px;
    border-color: rgba(64, 224, 208, 0.4);
    animation: rotate 20s linear infinite;
    box-shadow: 0 0 20px rgba(64, 224, 208, 0.3);
}

.ring-2 {
    width: 240px;
    height: 240px;
    border-color: rgba(64, 224, 208, 0.3);
    animation: rotate-reverse 25s linear infinite;
    box-shadow: 0 0 30px rgba(64, 224, 208, 0.2);
}

.ring-3 {
    width: 280px;
    height: 280px;
    border-color: rgba(64, 224, 208, 0.2);
    animation: rotate 30s linear infinite;
    box-shadow: 0 0 40px rgba(64, 224, 208, 0.1);
}

.ring-4 {
    width: 160px;
    height: 160px;
    border-color: rgba(108, 92, 231, 0.4);
    border-width: 1px;
    animation: rotate-reverse 15s linear infinite;
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.3);
}

.ring-5 {
    width: 320px;
    height: 320px;
    border-color: rgba(64, 224, 208, 0.15);
    border-width: 1px;
    animation: rotate 35s linear infinite;
    box-shadow: 0 0 50px rgba(64, 224, 208, 0.05);
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotate-reverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

.ibex-core {
    position: absolute;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(64, 224, 208, 0.15) 0%, rgba(64, 224, 208, 0.05) 70%, transparent 100%);
    border: 2px solid rgba(64, 224, 208, 0.5);
    box-shadow: 
        inset 0 0 20px rgba(64, 224, 208, 0.2),
        0 0 30px rgba(64, 224, 208, 0.4),
        0 0 60px rgba(64, 224, 208, 0.2);
}

.core-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(64, 224, 208, 0.4), transparent 70%);
    filter: blur(8px);
    animation: pulse-glow-idle 4s ease-in-out infinite;
}

@keyframes pulse-glow-idle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02);
    }
}

@keyframes pulse-glow-active {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.ibex-text {
    position: relative;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #40e0d0, #00bcd4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(64, 224, 208, 0.5);
    z-index: 2;
}

.core-inner {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 1px solid rgba(64, 224, 208, 0.3);
    border-radius: 50%;
    animation: rotate 10s linear infinite;
}

.voice-status {
    position: absolute;
    bottom: 220px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 2;
}

#voiceStatusText {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.waveform {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 40px;
}

.wave-bar {
    width: 4px;
    background: linear-gradient(180deg, #40e0d0, #00bcd4);
    border-radius: 2px;
    height: 8px;
    opacity: 0.4;
    transition: height 0.1s ease, opacity 0.1s ease;
    box-shadow: 0 0 10px rgba(64, 224, 208, 0.5);
}

@keyframes wave-idle {
    0%, 100% {
        height: 8px;
        opacity: 0.4;
    }
    50% {
        height: 12px;
        opacity: 0.6;
    }
}

@keyframes wave-motion {
    0%, 100% {
        height: 20px;
        opacity: 0.3;
    }
    50% {
        height: 40px;
        opacity: 1;
    }
}

.wave-bar.active {
    animation: wave-motion-active 0.5s ease-in-out infinite;
}

@keyframes wave-motion-active {
    0%, 100% {
        height: 30px;
        opacity: 0.5;
    }
    50% {
        height: 60px;
        opacity: 1;
    }
}

.voice-controls {
    position: absolute;
    bottom: 30px;
    z-index: 2;
    display: flex;
    gap: 20px;
}

.media-controls {
    position: absolute;
    bottom: 110px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.media-buttons {
    display: flex;
    gap: 15px;
}

.media-btn {
    padding: 12px 20px;
    background: rgba(64, 224, 208, 0.2);
    border: 1px solid rgba(64, 224, 208, 0.3);
    border-radius: 25px;
    color: var(--primary);
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
}

.media-btn:hover {
    background: rgba(64, 224, 208, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(64, 224, 208, 0.2);
}

.media-btn.active {
    background: linear-gradient(135deg, var(--success), #00a085);
    color: #000;
    border-color: var(--success);
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.avatar-overlay-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(64, 224, 208, 0.2);
    border: 1px solid rgba(64, 224, 208, 0.4);
    border-radius: 50%;
    color: #40e0d0;
    font-size: 18px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-overlay-btn:hover {
    background: rgba(64, 224, 208, 0.4);
    transform: scale(1.1);
}

.avatar-overlay-btn.active {
    background: rgba(64, 224, 208, 0.6);
    box-shadow: 0 0 20px rgba(64, 224, 208, 0.5);
}

#avatar2DCanvas {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 180px;
    height: 220px;
    display: none;
    z-index: 50;
    pointer-events: none;
}

#avatar2DCanvas.show {
    display: block;
    animation: floatAvatar 3s ease-in-out infinite;
}

@keyframes floatAvatar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.media-btn i {
    font-size: 14px;
}

.media-status {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    padding: 8px 16px;
    background: rgba(15, 15, 35, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(64, 224, 208, 0.2);
    backdrop-filter: blur(10px);
    max-width: 300px;
}

.voice-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 50px;
    color: #000;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(64, 224, 208, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voice-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(64, 224, 208, 0.4);
}

.voice-btn:active {
    transform: translateY(-2px);
}

.voice-btn.listening {
    background: linear-gradient(135deg, #ff6b9d, #ff3366);
    box-shadow: 0 8px 24px rgba(255, 107, 157, 0.3);
}

.voice-btn i {
    font-size: 16px;
}

/* Speaking animation - enhanced glow when speaking */
.rings-wrapper.speaking .core-glow {
    animation: pulse-glow-active 0.5s ease-in-out infinite !important;
}

.rings-wrapper.speaking .ring {
    animation-duration: 0.8s !important;
    box-shadow: 0 0 30px rgba(64, 224, 208, 0.8) !important;
}

.ring-1.speaking {
    animation: rotate-fast 0.8s linear infinite !important;
    box-shadow: 0 0 40px rgba(64, 224, 208, 0.8) !important;
}

.ring-2.speaking {
    animation: rotate-reverse-fast 0.8s linear infinite !important;
    box-shadow: 0 0 50px rgba(64, 224, 208, 0.6) !important;
}

.ring-3.speaking {
    animation: rotate-fast 0.8s linear infinite !important;
    box-shadow: 0 0 60px rgba(64, 224, 208, 0.4) !important;
}

.ring-4.speaking {
    animation: rotate-reverse-fast 0.8s linear infinite !important;
    box-shadow: 0 0 35px rgba(108, 92, 231, 0.8) !important;
}

.ring-5.speaking {
    animation: rotate-fast 0.8s linear infinite !important;
    box-shadow: 0 0 70px rgba(64, 224, 208, 0.3) !important;
}

@keyframes rotate-fast {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate-reverse-fast {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

/* IBEX text pump animation when speaking */
.ibex-text.speaking {
    animation: pomp-pulse 0.5s ease-in-out infinite !important;
}

@keyframes pomp-pulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(64, 224, 208, 0.6);
    }
    50% {
        transform: scale(1.08);
        text-shadow: 0 0 20px rgba(64, 224, 208, 0.9), 0 0 30px rgba(0, 188, 212, 0.6);
    }
}



/* Loading spinner animation */
.loading-spinner {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 12px;
    flex-direction: column;
}

.loading-text {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    animation: pulse 2s infinite;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 20px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: typingBounce 1.4s infinite ease-in-out;
    box-shadow: 0 0 6px rgba(64, 224, 208, 0.5);
}

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

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

.loading-details {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.8;
    line-height: 1.3;
    max-width: 300px;
    word-wrap: break-word;
}

.spinner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: bounce 1.4s infinite ease-in-out;
    box-shadow: 0 0 8px rgba(64, 224, 208, 0.6);
}

.spinner-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.spinner-dot:nth-child(2) {
    animation-delay: -0.16s;
}

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

.message.loading {
    background: transparent !important;
    border: none !important;
    padding: 8px 0 !important;
}

.message.loading .message-content {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* EVENTS VIEW */
.events-container {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.events-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(64, 224, 208, 0.3);
}

.btn-secondary {
    padding: 10px 20px;
    background: rgba(64, 224, 208, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(64, 224, 208, 0.3);
}

.view-toggle {
    display: flex;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active {
    background: var(--primary);
    color: #000;
}

.calendar-view {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-header h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
}

.calendar-header .nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(64, 224, 208, 0.2);
    border: 1px solid var(--border);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.calendar-header .nav-btn:hover {
    background: rgba(64, 224, 208, 0.3);
    transform: scale(1.1);
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 10px;
}

.weekday {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.calendar-day {
    position: relative;
    padding: 12px;
    min-height: 50px;
    background: rgba(15, 15, 35, 0.8);
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.calendar-day:hover {
    background: rgba(64, 224, 208, 0.1);
    border-color: var(--border);
}

.calendar-day.today {
    background: rgba(64, 224, 208, 0.2);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.calendar-day.selected {
    background: rgba(64, 224, 208, 0.3);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(64, 224, 208, 0.3);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.has-events {
    background: rgba(108, 92, 231, 0.2);
    border-color: rgba(108, 92, 231, 0.5);
}

.event-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(108, 92, 231, 0.6);
}

.events-list {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(15, 15, 35, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.event-item:hover {
    background: rgba(15, 15, 35, 1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.event-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    min-width: 60px;
    text-align: center;
    padding: 6px 12px;
    background: rgba(64, 224, 208, 0.2);
    border-radius: 6px;
}

.event-details {
    flex: 1;
}

.event-details h4 {
    font-size: 16px;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.event-details p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 4px 0;
}

.event-details small {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.1);
}

/* VIDEO PREVIEWS */
.video-previews {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    gap: 20px;
    z-index: 3;
    justify-content: space-between;
    max-width: 800px;
    margin: 0 auto;
}

.video-preview {
    background: rgba(15, 15, 35, 0.9);
    border: 2px solid rgba(64, 224, 208, 0.3);
    border-radius: 12px;
    overflow: hidden;
    width: 300px;
    height: 200px;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.video-preview:hover {
    border-color: rgba(64, 224, 208, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.preview-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(15, 15, 35, 0.9) 0%, transparent 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 2;
}

.preview-header i {
    color: var(--primary);
    font-size: 16px;
}

.preview-header span:first-of-type {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    margin-left: 8px;
}

.preview-status {
    background: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse-live 2s infinite;
}

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

.video-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
    filter: contrast(1.1) brightness(1.05);
}

.preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(15, 15, 35, 0.9) 0%, transparent 100%);
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
}

.camera-preview {
    border-color: rgba(0, 255, 0, 0.3);
}

.camera-preview:hover {
    border-color: rgba(0, 255, 0, 0.6);
}

.screen-preview {
    border-color: rgba(255, 165, 0, 0.3);
}

.screen-preview:hover {
    border-color: rgba(255, 165, 0, 0.6);
}

/* Responsive video previews */
@media (max-width: 768px) {
    .video-previews {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        top: 10px;
        left: 10px;
        right: 10px;
    }
    
    .video-preview {
        width: 250px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .video-preview {
        width: 200px;
        height: 120px;
    }
    
    .preview-header {
        padding: 8px 12px;
    }
    
    .preview-header span:first-of-type {
        font-size: 12px;
    }
    
    .preview-overlay {
        padding: 8px 12px;
        font-size: 10px;
    }
}
  
/* SCANNER VIEW */  
#scannerView {  
    overflow: hidden;  
    background: #f5f5f5;  
}  
#scannerView iframe {  
    width: 100%;  
    height: 100%;  
    border: none;  
} 

/* TASKS VIEW */
.tasks-container {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.tasks-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    gap: 15px;
    flex-wrap: wrap;
}

.tasks-section {
    margin-bottom: 30px;
}

.tasks-section h3 {
    font-size: 18px;
    color: var(--primary);
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px;
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.task-item:hover {
    background: rgba(26, 26, 46, 0.8);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(64, 224, 208, 0.2);
}

.task-item.completed {
    opacity: 0.7;
    background: rgba(15, 15, 35, 0.4);
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-checkbox {
    flex-shrink: 0;
    margin-top: 2px;
}

.task-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.task-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
}

.task-priority {
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
}

.task-priority.priority-low {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.task-priority.priority-medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.task-priority.priority-high {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.task-due, .task-created {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.edit-btn, .delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.edit-btn {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.edit-btn:hover {
    background: rgba(255, 193, 7, 0.3);
    transform: scale(1.1);
}

.delete-btn {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.delete-btn:hover {
    background: rgba(244, 67, 54, 0.3);
    transform: scale(1.1);
}

.add-task-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(64, 224, 208, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
}

.add-task-btn:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 12px 36px rgba(64, 224, 208, 0.4);
}

.add-task-btn:active {
    transform: translateY(-2px) scale(1.05);
}

/* File Download Cards - Visible and Accessible Design */
.file-download-card {
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.98), rgba(30, 30, 50, 0.98));
    border: 2px solid rgba(100, 200, 255, 0.3);
    border-radius: 12px;
    margin: 16px 0;
    overflow: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(100, 200, 255, 0.1);
    animation: slideIn 0.3s ease-out;
    min-width: 300px;
    max-width: 500px;
}

.file-download-header {
    background: linear-gradient(90deg, rgba(100, 200, 255, 0.15), rgba(150, 100, 255, 0.15));
    padding: 16px 20px;
    border-bottom: 1px solid rgba(100, 200, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-download-header i {
    color: #64c8ff;
    font-size: 20px;
}

.file-download-title {
    font-weight: 600;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.file-download-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-name {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    word-break: break-all;
    line-height: 1.4;
}

.file-size {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.file-expiration-notice {
    font-size: 13px;
    color: #ffb347;
    background: rgba(255, 179, 71, 0.15);
    padding: 10px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    border-left: 3px solid #ffb347;
}

.file-expiration-notice i {
    color: #ffb347;
    font-size: 14px;
}

.file-download-actions {
    padding: 16px 20px;
    background: rgba(15, 15, 35, 0.5);
    border-top: 1px solid rgba(100, 200, 255, 0.15);
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}

.file-download-btn, .file-preview-btn {
    background: rgba(100, 200, 255, 0.15);
    border: 2px solid rgba(100, 200, 255, 0.3);
    color: #64c8ff;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    min-height: 44px;
}

.file-download-btn:hover, .file-preview-btn:hover {
    background: rgba(100, 200, 255, 0.25);
    border-color: rgba(100, 200, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 200, 255, 0.2);
}

.file-download-btn {
    background: linear-gradient(135deg, #64c8ff, #4a9fd4);
    color: #000;
    border-color: transparent;
    font-weight: 700;
}

.file-download-btn:hover {
    background: linear-gradient(135deg, #7dd4ff, #5ab0e0);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(100, 200, 255, 0.4);
}

/* File Operation Cards */
.file-operation-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-operation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

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

.file-path {
    font-family: 'Courier New', monospace;
    background: var(--background);
    padding: 8px 12px;
    border-radius: 6px;
    margin: 8px 0;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.file-preview {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    white-space: pre-wrap;
    color: var(--text-primary);
}

.file-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.file-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-action-btn.keep {
    background: var(--success);
    color: white;
}

.file-action-btn.undo {
    background: var(--warning);
    color: white;
}

.file-action-btn.preview {
    background: var(--secondary);
    color: white;
}

.file-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.file-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

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

.file-status.error {
    color: var(--error);
}

.preview-collapsed {
    display: none;
}

.preview-expanded {
    display: block;
}
/* Search Results Styles */
.search-results-card {
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.9), rgba(26, 26, 46, 0.9));
    border: 1px solid rgba(64, 224, 208, 0.3);
    border-radius: 12px;
    margin: 15px 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-results-header {
    background: rgba(64, 224, 208, 0.1);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(64, 224, 208, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-results-header i {
    color: var(--primary);
    font-size: 18px;
}

.search-results-header span:first-of-type {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.results-count {
    background: rgba(64, 224, 208, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--primary);
}

.search-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(64, 224, 208, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: rgba(64, 224, 208, 0.05);
    border-left: 3px solid var(--primary);
}

.search-result-item:last-child {
    border-bottom: none;
}

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

.result-favicon {
    font-size: 16px;
}

.result-title {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.3;
}

.result-source {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(64, 224, 208, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
}

.result-snippet {
    margin: 8px 0;
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 14px;
}

.result-url {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-top: 8px;
}

.result-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    background: rgba(64, 224, 208, 0.1);
    border: 1px solid rgba(64, 224, 208, 0.2);
}

.result-link:hover {
    background: rgba(64, 224, 208, 0.2);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(64, 224, 208, 0.3);
}

.result-link i {
    color: var(--primary);
    font-size: 11px;
}

.result-link span {
    color: var(--text-secondary);
    font-size: 11px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-actions {
    padding: 15px 20px;
    background: rgba(15, 15, 35, 0.5);
    border-top: 1px solid rgba(64, 224, 208, 0.1);
    display: flex;
    gap: 10px;
}

.search-action-btn {
    background: rgba(64, 224, 208, 0.1);
    border: 1px solid rgba(64, 224, 208, 0.3);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.search-action-btn:hover {
    background: rgba(64, 224, 208, 0.2);
    border-color: var(--primary);
}

/* ATTACHMENTS & DRAG-AND-DROP */
.chat-input-area.drag-over {
    background: rgba(64, 224, 208, 0.15);
    border-top: 2px dashed var(--primary);
}

.attachment-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 0 15px 0;
}

.attachment-preview-container:empty {
    padding: 0;
}

.attachment-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.attachment-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-item i {
    font-size: 24px;
    color: var(--primary);
}

.attachment-item .remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--error);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 10;
}

.attachment-item .remove-btn:hover {
    transform: scale(1.1);
    background: #ff4444;
}

.attachment-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 8px;
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attach-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.attach-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(64, 224, 208, 0.1);
}

.send-btn {
    background: var(--primary);
    color: #000;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.4);
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* AUTOMATION PROGRESS DISPLAY */
.automation-progress-container {
    background: rgba(64, 224, 208, 0.05);
    border: 2px solid rgba(64, 224, 208, 0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    animation: fadeIn 0.3s ease-out;
}

.automation-step {
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(64, 224, 208, 0.08);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    animation: slideIn 0.3s ease-out;
}

.automation-step .step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 600;
}

.automation-step .step-emoji {
    font-size: 18px;
    display: inline-block;
    min-width: 24px;
}

.automation-step .step-action {
    color: var(--primary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.automation-step .step-description {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    margin-left: 32px;
}

.automation-step .step-screenshot {
    margin-top: 12px;
    margin-left: 32px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(64, 224, 208, 0.2);
}

.automation-step .step-screenshot img {
    display: block;
    max-width: 100%;
    height: auto;
}

.automation-completion {
    text-align: center;
    padding: 16px;
    background: rgba(0, 212, 170, 0.1);
    border-top: 2px solid var(--success);
    border-radius: 4px;
    color: var(--success);
    font-weight: 600;
    font-size: 16px;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* LEAN AUTOMATION CARD */
.automation-card {
    background: rgba(12, 14, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 8px 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.automation-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.automation-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.automation-card-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    color: #0b0d12;
}

.automation-card-status.status-pending {
    background: #b0bec5;
}

.automation-card-status.status-in_progress {
    background: #40e0d0;
}

.automation-card-status.status-retrying {
    background: #ffca28;
}

.automation-card-status.status-completed {
    background: #66bb6a;
}

.automation-card-status.status-failed {
    background: #ef5350;
}

.automation-card-summary {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.automation-card-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.automation-card-toggle:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.automation-card-details {
    margin-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 8px;
}

.automation-card-details.collapsed {
    display: none;
}

.automation-card-log {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.automation-card-log-item {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* PREMIUM AUTOMATION STATUS */
.automation-status {
    background: linear-gradient(135deg, rgba(64, 224, 208, 0.1), rgba(108, 92, 231, 0.1));
    border: 2px solid rgba(64, 224, 208, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin: 16px 0;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(64, 224, 208, 0.2);
    animation: automationPulse 2s ease-in-out infinite;
}

@keyframes automationPulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(64, 224, 208, 0.2);
        border-color: rgba(64, 224, 208, 0.3);
    }
    50% {
        box-shadow: 0 12px 48px rgba(64, 224, 208, 0.4);
        border-color: rgba(64, 224, 208, 0.5);
    }
}

.automation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.automation-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconSpin 3s linear infinite;
    box-shadow: 0 4px 16px rgba(64, 224, 208, 0.4);
}

@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.automation-icon i {
    font-size: 24px;
    color: #000;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.3));
}

.automation-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.automation-progress {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(15, 15, 35, 0.8);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(64, 224, 208, 0.3);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% 100%;
    border-radius: 20px;
    animation: progressFlow 2s linear infinite;
    box-shadow: 0 0 12px rgba(64, 224, 208, 0.6);
}

@keyframes progressFlow {
    0% {
        background-position: -200% 0;
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        background-position: 200% 0;
        width: 100%;
    }
}

.status-text {
    font-size: 16px;
    color: var(--text-primary);
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 8px rgba(64, 224, 208, 0.3);
        opacity: 0.8;
    }
    50% {
        text-shadow: 0 0 16px rgba(64, 224, 208, 0.6);
        opacity: 1;
    }
}

.automation-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    border-radius: 16px;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 4s linear infinite;
    box-shadow: 0 0 8px rgba(64, 224, 208, 0.8);
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 3s;
}

.particle:nth-child(2) {
    left: 30%;
    animation-delay: 0.8s;
    animation-duration: 4s;
}

.particle:nth-child(3) {
    left: 50%;
    animation-delay: 1.6s;
    animation-duration: 3.5s;
}

.particle:nth-child(4) {
    left: 70%;
    animation-delay: 2.4s;
    animation-duration: 4.2s;
}

.particle:nth-child(5) {
    left: 90%;
    animation-delay: 3.2s;
    animation-duration: 3.8s;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100px) scale(0);
        opacity: 0;
    }
}

/* =============================================
   TASK MESSAGE IN CHAT STREAM
   ============================================= */
.task-message {
    background: linear-gradient(135deg, rgba(15, 15, 35, 0.9), rgba(26, 26, 46, 0.9));
    border: 2px solid rgba(64, 224, 208, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    animation: taskSlideIn 0.4s ease-out;
}

.task-message.status-completed {
    border-color: rgba(76, 175, 80, 0.5);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.2);
}

.task-message.status-failed {
    border-color: rgba(244, 67, 54, 0.5);
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.2);
}

.task-message.status-cancelled {
    border-color: rgba(255, 152, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 152, 0, 0.2);
}

.task-message.status-active,
.task-message.status-in_progress {
    animation: taskPulse 2s ease-in-out infinite;
}

@keyframes taskSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes taskPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(64, 224, 208, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(64, 224, 208, 0.4);
    }
}

.task-message .task-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(64, 224, 208, 0.2);
}

.task-message .task-status-icon {
    font-size: 24px;
    min-width: 32px;
    text-align: center;
}

.task-message .task-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.task-message .task-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-message .task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.task-message .task-progress-text {
    color: var(--text-secondary);
}

.task-message .task-progress-percent {
    font-weight: 600;
    color: var(--primary);
}

.task-message .task-progress-bar {
    height: 6px;
    background: rgba(15, 15, 35, 0.8);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid rgba(64, 224, 208, 0.2);
}

.task-message .task-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
}

.task-message .task-steps-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-message .task-step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(64, 224, 208, 0.05);
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.task-message .task-step-item.status-completed {
    border-left-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.task-message .task-step-item.status-in_progress,
.task-message .task-step-item.status-active {
    border-left-color: #40e0d0;
    background: rgba(64, 224, 208, 0.1);
    animation: stepPulse 1.5s ease-in-out infinite;
}

.task-message .task-step-item.status-failed {
    border-left-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.task-message .task-step-item.status-cancelled {
    border-left-color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
    opacity: 0.7;
}

.task-message .task-step-item.status-pending {
    border-left-color: #ffa726;
}

.task-message .task-step-item.status-retrying {
    border-left-color: #ffeb3b;
    animation: stepSpin 1s linear infinite;
}

@keyframes stepPulse {
    0%, 100% {
        background: rgba(64, 224, 208, 0.1);
    }
    50% {
        background: rgba(64, 224, 208, 0.2);
    }
}

@keyframes stepSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.task-message .step-status-icon {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
}

.task-message .step-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.task-message .task-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(64, 224, 208, 0.2);
    text-align: center;
    font-size: 13px;
}

.task-message .task-completed-time {
    color: #4caf50;
    font-weight: 500;
}

.task-message .task-failed-time {
    color: #f44336;
    font-weight: 500;
}

.task-message .task-cancelled-time {
    color: #ff9800;
    font-weight: 500;
}

/* Finalized task styling */
.task-message.finalized-completed {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
}

.task-message.finalized-failed {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1), rgba(244, 67, 54, 0.05));
}

.task-message.finalized-cancelled {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 152, 0, 0.05));
}

/* =============================================================================
   FILE EDIT CARD - Nice Chat UI (replaces ugly popup modal)
   ============================================================================= */

.file-edit-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 12px 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.file-edit-card.expanded {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.file-edit-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.08), rgba(33, 150, 243, 0.03));
    transition: background 0.2s;
}

.file-edit-header:hover {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(33, 150, 243, 0.08));
}

.file-edit-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border-radius: 8px;
    color: white;
    font-size: 16px;
}

.file-edit-info {
    flex: 1;
    min-width: 0;
}

.file-edit-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.file-edit-path {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-edit-toggle {
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.file-edit-card.expanded .file-edit-toggle {
    transform: rotate(180deg);
}

.file-edit-diff {
    border-top: 1px solid var(--border);
    background: var(--background);
    max-height: 300px;
    overflow-y: auto;
}

.diff-content {
    display: flex;
    gap: 16px;
    padding: 12px;
}

.diff-old, .diff-new {
    flex: 1;
    min-width: 0;
}

.diff-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.diff-view pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
}

.diff-line {
    padding: 2px 4px;
    white-space: pre-wrap;
    word-break: break-all;
}

.diff-lno {
    display: inline-block;
    width: 44px;
    margin-right: 8px;
    color: var(--text-secondary);
    opacity: 0.85;
    user-select: none;
}

.diff-line.added {
    background: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
}

.diff-line.removed {
    background: rgba(244, 67, 54, 0.2);
    color: #c62828;
}

.diff-more {
    color: var(--text-secondary);
    font-style: italic;
    padding: 4px;
}

.diff-expand-btn {
    margin: 10px 12px 12px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 12px;
}

.diff-expand-btn:hover {
    background: var(--surface-light);
}

.file-edit-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.file-edit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

.file-edit-btn.undo {
    background: rgba(255, 107, 107, 0.15);
    color: #e53935;
}

.file-edit-btn.undo:hover:not(:disabled) {
    background: rgba(255, 107, 107, 0.3);
}

.file-edit-btn.redo {
    background: rgba(255, 167, 38, 0.15);
    color: #f57c00;
}

.file-edit-btn.redo:hover:not(:disabled) {
    background: rgba(255, 167, 38, 0.3);
}

.file-edit-btn.history {
    background: rgba(33, 150, 243, 0.15);
    color: #1976d2;
}

.file-edit-btn.history:hover:not(:disabled) {
    background: rgba(33, 150, 243, 0.3);
}

.file-edit-btn.collapse {
    background: var(--background);
    color: var(--text-secondary);
    margin-left: auto;
}

.file-edit-btn.collapse:hover {
    background: var(--border);
}

.file-edit-timestamp {
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--background);
    border-top: 1px solid var(--border);
}

.file-edit-timestamp.success {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

/* Chat history lazy-load indicator */
.history-loading {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 12px;
}

.history-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: historySpin 0.8s linear infinite;
}

@keyframes historySpin {
    to { transform: rotate(360deg); }
}

/* ============================================
   CODEBASE CONTEXT PANEL
   ============================================ */
.codebase-panel {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    margin-bottom: 8px;
}

.codebase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.codebase-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.codebase-add-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--primary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.codebase-add-btn:hover {
    background: var(--primary);
    color: var(--background);
    border-color: var(--primary);
}

.codebase-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.codebase-empty {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    padding: 8px;
    opacity: 0.6;
}

.codebase-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--surface-light);
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.codebase-item:hover {
    border-color: var(--border);
}

.codebase-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.codebase-folder-icon {
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}

.codebase-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.codebase-remove-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    opacity: 0;
    transition: all 0.2s ease;
}

.codebase-item:hover .codebase-remove-btn {
    opacity: 1;
}

.codebase-remove-btn:hover {
    color: var(--error);
}

/* Sidebar bulk-delete controls */
.conv-bulk-bar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; }
.conv-bulk-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    padding: 6px 10px; border-radius: 8px;
    background: rgba(126, 184, 255, 0.10); color: #cfe0ff;
    border: 1px solid rgba(126, 184, 255, 0.22);
    transition: background .15s ease, border-color .15s ease;
}
.conv-bulk-btn:hover { background: rgba(126, 184, 255, 0.18); }
.conv-bulk-btn.danger { background: rgba(255, 107, 122, 0.12); color: #ff9aa5; border-color: rgba(255, 107, 122, 0.30); }
.conv-bulk-btn.danger:hover { background: rgba(255, 107, 122, 0.20); }
.conv-bulk-btn[disabled] { opacity: .5; cursor: not-allowed; }
.conversation-item.selected { background: rgba(126, 184, 255, 0.14); border-radius: 8px; }
.conversation-item .selection-checkbox { margin-right: 8px; color: #7eb8ff; display: inline-flex; }
