/* Oughter Font for PlusB Branding */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300&family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap');

.font-brand {
    font-family: 'Bricolage Grotesque', sans-serif;

}

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Plus+Jakarta+Sans:wght@200;300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #020202;
    --card-bg: rgba(255, 255, 255, 0.02);
    --border-light: rgba(255, 255, 255, 0.06);
    --accent-glow: 147, 51, 234; /* Purple */
    --accent-cyan: 192, 132, 252; /* Purple Light */
    --plusb-light-gray: #afafaf;
}

/* Force all Tailwind text-slate utilities to ChatGPT light gray */
.text-slate-50,
.text-slate-100,
.text-slate-200,
.text-slate-300,
.text-slate-400,
.text-slate-500,
.text-slate-600,
.text-slate-700,
.text-slate-800,
.text-slate-900,
.text-slate-950 {
    color: var(--plusb-light-gray) !important;
}

body {
    background-color: var(--bg-dark);
    color: #cbd5e1; /* Slightly lighter for better readability */
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    color: #000;
    background: #fff;
}

/* Typography Overrides */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.03em; /* Tighter tracking for modern look */
}

/* Global List Marker Styling - Force Neutral */
ul li::marker, ol li::marker, li::marker {
    color: #e2e8f0; /* slater-200/300 */
}

.font-serif {
    font-family: 'Instrument Serif', serif;
    letter-spacing: -0.01em;
}

/* Premium Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08); /* Crisper, thinner border */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.glass-pill {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.glass-strong {
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255,255,255,0.12);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.glass-panel {
    background: rgba(10, 10, 10, 0.6); /* Slightly darker for contrast */
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}


/* Gradient Text */
.gradient-text {
    background: linear-gradient(to right, #FFF 20%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-accent {
    background: linear-gradient(135deg, #c084fc 0%, #f472b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Background Effects */
.hero-glow {
    position: absolute;
    width: 1200px; /* Larger glow */
    height: 1200px;
    background: radial-gradient(circle at center, rgba(var(--accent-glow), 0.12) 0%, transparent 60%);
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
    animation: pulse-glow 8s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% { opacity: 0.4; transform: translateX(-50%) scale(1); }
    100% { opacity: 0.7; transform: translateX(-50%) scale(1.1); }
}

.grid-bg {
    background-size: 40px 40px; /* Tighter grid */
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    mask-image: radial-gradient(circle at center, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 100%);
}

/* Bento Card Hover Effects */
.bento-card {
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6);
    border-color: rgba(255,255,255,0.15);
    background: rgba(255, 255, 255, 0.04);
}

.bento-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.05), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 2;
}

.bento-card:hover::after {
    opacity: 1;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: float 8s ease-in-out infinite;
}

.animate-delay-100 { animation-delay: 100ms; }
.animate-delay-200 { animation-delay: 200ms; }
.animate-delay-300 { animation-delay: 300ms; }

/* Custom Button */
.btn-primary {
    background: white;
    color: black;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: skewX(-20deg);
    transition: 0.6s;
}

.btn-primary:hover .btn-shine {
    left: 200%;
    transition: 0.6s;
}

/* Comparison Table Styles */
.comparison-row {
    transition: background-color 0.2s;
}
.comparison-row:hover {
    background-color: rgba(255,255,255,0.03);
}

/* Cosmic Aurora Text Effect */


.text-aurora {
    background: linear-gradient(
        300deg,
        #c084fc, /* Purple 400 */
        #f472b6, /* Pink 400 */
        #fbbf24, /* Amber 400 (Banana Glow) */
        #818cf8, /* Indigo 400 */
        #c084fc  /* Loop back */
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-fill-color: transparent;
    animation: cosmic-flow 8s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(192, 132, 252, 0.3));
}

/* Infinite Marquee */
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-scroll {
    animation: scroll 30s linear infinite;
}

.animate-scroll:hover {
    animation-play-state: paused;
}

.marquee-mask {
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}


/* Custom Animations for Premium Redesign */
@keyframes pulse-slow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.animate-pulse-slow {
    animation: pulse-slow 8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Vignette/Masking Utilities */
.mask-image-b-fade {
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.mask-image-r-fade {
    mask-image: linear-gradient(to right, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 70%, transparent 100%);
}

/* New Utilities for No-Code Agent Card */
.col-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mask-gradient-fade {
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* --- Advanced Neural Core & Memory Visualization --- */

/* 3D Orbit Container */
.neural-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Central Glowing Core */
.neural-core-gem {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, #fff, #c084fc, #7e22ce);
    border-radius: 50%;
    box-shadow: 
        0 0 30px rgba(192, 132, 252, 0.6),
        0 0 60px rgba(168, 85, 247, 0.4),
        inset -5px -5px 10px rgba(0,0,0,0.2);
    position: relative;
    z-index: 10;
    animation: core-breathe 4s ease-in-out infinite;
}

@keyframes core-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(192, 132, 252, 0.6); }
    50% { transform: scale(1.1); box-shadow: 0 0 50px rgba(192, 132, 252, 0.9), 0 0 80px rgba(168, 85, 247, 0.6); }
}

/* Orbit Rings */
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(192, 132, 252, 0.3);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.1);
    transform-style: preserve-3d;
}

.ring-1 {
    width: 80px;
    height: 80px;
    border-color: rgba(94, 234, 212, 0.4); /* Teal hint */
    animation: spin-orbit 8s linear infinite;
}

.ring-2 {
    width: 110px;
    height: 110px;
    border-color: rgba(168, 85, 247, 0.4); /* Purple */
    animation: spin-orbit-reverse 12s linear infinite;
}

.ring-3 {
    width: 140px;
    height: 140px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    animation: spin-orbit 20s linear infinite;
}

/* Particles on Rings */
.orbit-particle {
    position: absolute;
    top: 50%;
    left: 50%; /* Center to offset from */
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white;
}

.ring-1 .orbit-particle { transform: rotate(0deg) translate(40px) rotate(0deg); }
.ring-2 .orbit-particle { transform: rotate(120deg) translate(55px) rotate(-120deg); background: #5eead4; }
.ring-3 .orbit-particle { transform: rotate(240deg) translate(70px) rotate(-240deg); background: #c084fc; }

@keyframes spin-orbit {
    0% { transform: rotateX(70deg) rotateZ(0deg); }
    100% { transform: rotateX(70deg) rotateZ(360deg); }
}

@keyframes spin-orbit-reverse {
    0% { transform: rotateX(70deg) rotateY(20deg) rotateZ(360deg); }
    100% { transform: rotateX(70deg) rotateY(20deg) rotateZ(0deg); }
}

/* Premium Card Styles */
.glass-card-premium {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card-premium::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg, rgba(255,255,255,0.1), transparent 40%, transparent 60%, rgba(255,255,255,0.05));
    opacity: 0;
    transition: opacity 0.5s ease;
}

.glass-card-premium:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 30px 60px -15px rgba(168, 85, 247, 0.15);
}

.glass-card-premium:hover::before {
    opacity: 1;
}

/* Connection Line Flow */
.flow-line {
    fill: none;
    stroke-width: 2px;
    stroke-linecap: round;
    opacity: 0.3;
}

.flow-packet {
    filter: drop-shadow(0 0 5px white);
}

/* Research App - Citations & Sources */

/* Citation Pills (Inline) */
.citation-wrapper {
    display: inline-flex;
    align-items: center;
    vertical-align: super;
    font-size: 0.7em;
    margin-left: 2px;
}

.citation-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin: 0 1px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    color: #2dd4bf; /* Teal 400 */
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.citation-pill:hover {
    background: rgba(45, 212, 191, 0.2);
    border-color: rgba(45, 212, 191, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Compact Source Cards */
.source-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.source-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(45, 212, 191, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.source-id {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: rgba(0,0,0,0.3);
    color: #94a3b8;
    font-family: monospace;
    font-size: 9px;
    font-weight: 600;
}

.group:hover .source-id {
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.1);
}

.source-domain {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #64748b;
}

.source-title {
    font-size: 11px;
    line-height: 1.4;
    color: #cbd5e1;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: auto; 
}

.group:hover .source-title {
    color: #e2e8f0;
}

.source-hover-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.2s ease;
}


/* Premium Research UI - "Thinking" State */

.research-glass-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
}

.research-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.5), transparent);
    animation: scanline 2s linear infinite;
}

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

/* Neural Pulse Loader */
.neural-loader {
    width: 60px;
    height: 60px;
    position: relative;
    margin: 0 auto 20px;
}

.neural-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #2dd4bf;
    animation: spin-pulse 3s linear infinite;
}

.neural-ring:nth-child(2) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-top-color: #f472b6;
    animation: spin-pulse-reverse 2s linear infinite;
}

.neural-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20%;
    height: 20%;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px #fff, 0 0 30px #2dd4bf;
    animation: core-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes spin-pulse {
    0% { transform: rotate(0deg); opacity: 0.8; }
    50% { opacity: 0.4; }
    100% { transform: rotate(360deg); opacity: 0.8; }
}

@keyframes spin-pulse-reverse {
    0% { transform: rotate(360deg); opacity: 0.8; }
    50% { opacity: 0.4; }
    100% { transform: rotate(0deg); opacity: 0.8; }
}

@keyframes core-pulse {
    from { box-shadow: 0 0 10px #fff, 0 0 20px #2dd4bf; }
    to { box-shadow: 0 0 20px #fff, 0 0 40px #2dd4bf, 0 0 60px #c084fc; }
}

/* Smart Log Stream */
.smart-log-window {
    height: 160px;
    overflow-y: hidden;
    position: relative;
    mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 20%, black 80%, transparent);
    font-family: 'JetBrains Mono', monospace;
}

.log-stream-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: absolute;
    bottom: 0;
    width: 100%;
    padding-bottom: 20px;
    transition: transform 0.3s ease;
}

.log-item {
    font-size: 11px;
    color: #64748b;
    padding-left: 12px;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    opacity: 0.5;
}

.log-item.active {
    color: #2dd4bf;
    border-left-color: #2dd4bf;
    opacity: 1;
    font-weight: 600;
    background: linear-gradient(90deg, rgba(45, 212, 191, 0.05), transparent);
}

.log-item.completed {
    color: #94a3b8;
    border-left-color: #94a3b8;
    opacity: 0.7;
}

.current-phase-text {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    background: linear-gradient(to right, #2dd4bf, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(45, 212, 191, 0.3);
}

/* ============================================
   GEMINI-STYLE RESEARCH UI
   ============================================ */

/* Main Research Container */
.gemini-research-container {
    background: #1a1a1a;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin: 16px 0;
    animation: fadeSlideUp 0.4s ease-out;
}

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

/* Research Header with Status */
.gemini-research-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.research-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #2dd4bf;
}

.research-status-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background: #2dd4bf;
    border-radius: 50%;
    animation: pulse-glow-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-glow-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px #2dd4bf; }
    50% { opacity: 0.5; box-shadow: 0 0 12px #2dd4bf; }
}

.research-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Thinking Sections Container */
.gemini-thinking-sections {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual Thinking Section Card */
.gemini-thinking-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: sectionReveal 0.4s ease-out;
}

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

/* Sidebar Beta Tag Visibility */
#sidebar.collapsed .sidebar-beta-tag {
    opacity: 0;
    pointer-events: none;
    width: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.gemini-thinking-section:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.gemini-thinking-section.active {
    border-color: rgba(45, 212, 191, 0.3);
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.05), transparent);
}

/* Thinking Header */
.thinking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.thinking-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

.thinking-icon {
    width: 20px;
    height: 20px;
    color: #c084fc;
    flex-shrink: 0;
}

.gemini-thinking-section.active .thinking-icon {
    color: #2dd4bf;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.thinking-title {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.4;
}

.thinking-chevron {
    width: 16px;
    height: 16px;
    color: #64748b;
    transition: transform 0.3s ease;
}

.gemini-thinking-section.expanded .thinking-chevron {
    transform: rotate(180deg);
}

/* Thinking Content */
.thinking-content {
    padding: 0 16px 16px 48px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.thinking-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.gemini-thinking-section:hover,
.gemini-thinking-section.active {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.gemini-thinking-section.expanded .thinking-content {
    max-height: 500px;
    padding: 0 16px 16px 48px;
}

.thinking-content p {
    font-size: 13px;
    line-height: 1.7;
    color: #94a3b8;
    margin: 0;
}

/* Website Research Section */
.gemini-websites-section {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.websites-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.websites-header-icon {
    width: 18px;
    height: 18px;
    color: #2dd4bf;
    animation: spin 2s linear infinite;
}

.websites-header-icon.done {
    animation: none;
}

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

.websites-header-text {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
}

/* Website Cards Grid */
.website-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

/* Individual Website Card */
.gemini-website-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.gemini-website-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.website-favicon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.website-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.website-domain {
    font-size: 10px;
    color: #64748b;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.website-title {
    font-size: 11px;
    font-weight: 500;
    color: #cbd5e1;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Research Complete State */
.gemini-research-complete {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.02), transparent);
}

.research-complete-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #2dd4bf;
    margin-bottom: 12px;
}

/* Simplified Loader for Initial State */
.gemini-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 16px;
}

.gemini-brain-loader {
    width: 48px;
    height: 48px;
    position: relative;
}

.gemini-brain-loader .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.gemini-brain-loader .ring-1 {
    border-top-color: #2dd4bf;
    animation: spin 1.2s linear infinite;
}

.gemini-brain-loader .ring-2 {
    inset: 6px;
    border-right-color: #c084fc;
    animation: spin 1.5s linear infinite reverse;
}

.gemini-brain-loader .core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(45, 212, 191, 0.3);
}

.gemini-loader-text {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    text-align: center;
}

/* Sidebar Research Steps */
.sidebar-thinking-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 12px;
    position: relative;
    border-radius: 8px;
    transition: background 0.2s ease;
    margin-bottom: 12px; /* Added gap */
}

/* ... existing hover/active ... */
.sidebar-thinking-step:hover {
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-thinking-step.active {
    background: rgba(45, 212, 191, 0.05);
}

.sidebar-thinking-step::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 28px;
    bottom: -20px; /* Extended to cover gap */
    width: 2px;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-thinking-step:last-child::before {
    display: none;
}

/* ... indicator ... */
.step-indicator {
    width: 12px; /* Smaller */
    height: 12px;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    margin-top: 2px;
    z-index: 10;
    transition: all 0.3s ease;
}

.sidebar-thinking-step.active .step-indicator {
    background: #06e170;
    border-color: #2dd4bf;
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
    transform: scale(1.1);
}

.sidebar-thinking-step.completed .step-indicator {
    background: #2dd4bf;
    border-color: #2dd4bf;
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-title {
    font-size: 12px; /* Smaller */
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 6px;
    line-height: 1.4;
}

.sidebar-thinking-step.active .step-title {
    color: #2dd4bf;
}

.step-description {
    font-size: 11px; /* Smaller */
    color: #94a3b8;
    line-height: 1.6;
    /* Removed text truncation to align with user preference for reading content */
}

/* Shimmer Effects */
.shimmer-text {
    background: linear-gradient(to right, #94a3b8 20%, #e2e8f0 50%, #94a3b8 80%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 2s linear infinite;
    font-weight: 500;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

/* Skeleton Loader for Next Step */
.sidebar-skeleton-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 12px;
    margin-bottom: 12px;
    position: relative;
}

.sidebar-skeleton-step::before {
    content: '';
    position: absolute;
    left: 17px;
    top: -12px; /* Connect from previous */
    bottom: 50%;
    width: 2px;
    background: rgba(255, 255, 255, 0.06);
}

.skeleton-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.05);
    margin-top: 2px;
    animation: pulse 1.5s ease-in-out infinite;
    z-index: 10;
}

.skeleton-content {
    flex: 1;
}

.skeleton-line {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.long { width: 90%; }

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Gemini-Style Source Pills */
.sources-section {
    margin-top: 2rem;
}

.sources-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.source-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 40px;
    transition: all 0.2s ease;
    text-decoration: none;
    max-width: 320px;
}

.source-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(96, 165, 250, 0.4);
    transform: translateY(-1px);
}

/* Static pills (citations without URLs) */
.source-pill-static {
    cursor: default;
}

.source-pill-static:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.08);
}

.source-pill-text {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-pill:hover .source-pill-text {
    color: #e2e8f0;
}

/* Legacy support for old format */
.source-pill-domain {
    font-size: 11px;
    font-weight: 600;
    color: #60a5fa;
    white-space: nowrap;
}

.source-pill-title {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-pill:hover .source-pill-title {
    color: #e2e8f0;
}

/* NUCLEAR FIX for Blue Line and Styling */
.gemini-research-header,
.gemini-loader-container,
.research-status-badge,
.research-timer,
.gemini-brain-loader,
.gemini-loader-text {
    border: none !important;
    border-bottom: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Re-apply badge background explicitly */
.research-status-badge {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Ensure Researching text is correct */
.shimmer-text {
    font-size: 16px !important;
    display: inline-block;
    color: transparent; /* Needed for bg-clip */
}

/* Force Animations */
.gemini-brain-loader .ring-1 { animation: spin 1.2s linear infinite !important; }
.gemini-brain-loader .ring-2 { animation: spin 1.5s linear infinite reverse !important; }

/* Minimalistic Research UI */
.shimmer-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    background: linear-gradient(to right, #94a3b8 20%, #f1f5f9 50%, #94a3b8 80%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    text-align: left;
}

.research-status-tile {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    max-width: 500px;
    margin: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.tile-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    z-index: 10;
}

.text-content {
    flex: 1;
    min-width: 0;
}

.tile-title {
    font-size: 12px;
    color: #e2e8f0;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 2px;
}

.tile-subtitle {
    font-size: 10px;
    color: #94a3b8;
}

.tile-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 6px;
    border-radius: 4px;
}

.gradient-shimmer-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #059669 100%);
    background-size: 200% auto;
    animation: sidebar-load 2s linear infinite;
    opacity: 0.8;
}

/* Seamless Scrollbar for Sidebar */
.research-steps-container,
.research-status-tile,
.gemini-research-container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.research-steps-container::-webkit-scrollbar,
.research-status-tile::-webkit-scrollbar,
/* Research Message Container - Transparent */
.research-message-container,
.research-message-container .message-bubble,
.research-message-container .message-content,
.research-message-container .message-avatar {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
}

/* Ensure minimalistic container is also clean */
.gemini-research-container.minimalistic {
    margin-top: 1rem;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Ensure shimmer title and tile are visible */
.minimalistic .shimmer-title {
    margin-bottom: 24px;
}

/* ============================================
   DARWIN RESEARCH UI - GOOGLE-INSPIRED DESIGN
   Clean, Minimal, Professional
   ============================================ */

/* Main Research Card */
/* Main Research Card (Fixed Alignment) */
.darwin-research-card {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-self: flex-start; /* Force left alignment */
    text-align: left;
    margin-left: 0 !important;
    margin-right: auto !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: darwin-fade-in 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.darwin-research-card > * {
    position: relative;
    z-index: 1;
}

@keyframes darwin-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Section */
.darwin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
}

/* Specific Shimmer Effect for Title */
.shimmer-green {
    background: linear-gradient(90deg, #f1f5f9 0%, #86efac 50%, #f1f5f9 100%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* Card shimmer while streaming */
.darwin-research-card.is-streaming::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
        rgba(34, 197, 94, 0) 0%,
        rgba(34, 197, 94, 0.12) 45%,
        rgba(34, 197, 94, 0.28) 50%,
        rgba(34, 197, 94, 0.12) 55%,
        rgba(34, 197, 94, 0) 100%);
    transform: translateX(-100%);
    animation: darwin-card-shimmer 2.4s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes darwin-card-shimmer {
    to { transform: translateX(100%); }
}

/* Ensure container clears floats/alignments */
.research-message-container {
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.darwin-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15) 0%, rgba(22, 101, 52, 0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@keyframes darwin-icon-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 16px 3px rgba(74, 222, 128, 0.15);
    }
}

.darwin-icon {
    width: 20px;
    height: 20px;
    color: #0369a1;
    animation: darwin-icon-spin 8s linear infinite;
}

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

.darwin-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.darwin-title {
    font-size: 18px;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: -0.01em;
}

.darwin-timer {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}

/* Progress Bar */
.darwin-progress {
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 1px;
    overflow: hidden;
    margin-bottom: 16px;
}

.darwin-progress-bar {
    height: 100%;
    width: 5%; /* Start small, controlled by JS */
    /* Green gradient to match shimmer */
    background: linear-gradient(90deg, #4ade80, #166534, #4ade80);
    background-size: 200% 100%;
    border-radius: 1px;
    transition: width 0.5s ease-out;
    /* Removed fake grow animation */
}

@keyframes darwin-progress-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes darwin-progress-grow {
    0% { width: 5%; }
    20% { width: 25%; }
    50% { width: 50%; }
    80% { width: 75%; }
    100% { width: 90%; }
}

/* Status Text */
.darwin-status {
    margin-bottom: 20px;
}

.darwin-status-text {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 400;
    line-height: 1.5;
}

/* Sources Section */
.darwin-sources {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.darwin-sources-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.darwin-sources-icon {
    width: 16px;
    height: 16px;
    animation: darwin-icon-spin 3s linear infinite;
}

.darwin-sources-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Source Pill */
.darwin-source-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-size: 12px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.15s ease;
    max-width: 200px;
}

.darwin-source-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.darwin-source-pill img {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.darwin-source-pill span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Override old styles to prevent conflicts */
.gemini-research-container.minimalistic,
.research-status-tile,
.shimmer-title {
    display: none !important;
}

/* --- Animated Claude Avatar --- */
.claude-avatar {
    width: 32px;
    height: 32px;
    /* Removed background, border, and box-shadow to keep only dots */
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: visible;
    flex-shrink: 0;
}

/* Removed ::before pseudo-element */

.claude-dot-container {
    width: 76px;
    height: 70px;
    position: relative;
    z-index: 1;
    transform: scale(0.26) translateX(-10px); /* Shift left to center visually */
    transform-origin: center center;
}

.claude-dot {
    position: absolute;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border-radius: 50%;
    animation: claudePulse 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    will-change: transform, opacity;
}

.claude-dot.large {
    width: 16px;
    height: 16px;
}

.claude-dot.small {
    width: 7px;
    height: 7px;
}

/* Perfect Grid Positioning */
/* Row 1 */
.claude-dot:nth-child(1) { left: 0; top: 0; animation-delay: 0s; }
.claude-dot:nth-child(2) { left: 20px; top: 0; animation-delay: 0.12s; }
.claude-dot:nth-child(3) { left: 40px; top: 0; animation-delay: 0.24s; }
.claude-dot:nth-child(4) { left: 64.5px; top: 4.5px; animation-delay: 0.36s; }

/* Row 2 */
.claude-dot:nth-child(5) { left: 0; top: 27px; animation-delay: 0.48s; }
.claude-dot:nth-child(6) { left: 20px; top: 27px; animation-delay: 0.6s; }
.claude-dot:nth-child(7) { left: 40px; top: 27px; animation-delay: 0.72s; }
.claude-dot:nth-child(8) { left: 60px; top: 27px; animation-delay: 0.84s; }

/* Row 3 */
.claude-dot:nth-child(9) { left: 0; top: 54px; animation-delay: 0.96s; }
.claude-dot:nth-child(10) { left: 24.5px; top: 58.5px; animation-delay: 1.08s; }
.claude-dot:nth-child(11) { left: 40px; top: 54px; animation-delay: 1.2s; }
.claude-dot:nth-child(12) { left: 60px; top: 54px; animation-delay: 1.32s; }

@keyframes claudePulse {
    0% {
        opacity: 0.15;
        transform: scale(0.92);
        box-shadow: 
            0 0 0 0 rgba(255, 255, 255, 0),
            0 0 8px rgba(255, 255, 255, 0.1);
    }
    
    40% {
        opacity: 0.95;
        transform: scale(0.98);
        box-shadow: 
            0 0 12px 2px rgba(255, 255, 255, 0.2),
            0 0 20px rgba(255, 255, 255, 0.15);
    }
    
    50% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 
            0 0 16px 3px rgba(255, 255, 255, 0.25),
            0 0 25px rgba(255, 255, 255, 0.2);
    }
    
    60% {
        opacity: 0.95;
        transform: scale(0.98);
        box-shadow: 
            0 0 12px 2px rgba(255, 255, 255, 0.2),
            0 0 20px rgba(255, 255, 255, 0.15);
    }
    
    100% {
        opacity: 0.15;
        transform: scale(0.92);
        box-shadow: 
            0 0 0 0 rgba(255, 255, 255, 0),
            0 0 8px rgba(255, 255, 255, 0.1);
    }
}
