/* Font Import - Must be at the very top (CSS spec requirement) */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=JetBrains+Mono:wght@400;500&family=Space+Mono:wght@400;700&family=Nunito:wght@400;500;600;700&family=Quicksand:wght@400;500;600;700&family=Cormorant+Garamond:wght@400;500;600;700&family=Source+Serif+Pro:wght@400;600&display=swap');

/* ============================================
   ROBOTIC CHAT WIDGET - Playful Tech Style
   ============================================ */

/* CSS Variables - Color System */
:root {
    --robot-bg-dark: #0a0a12;
    --robot-bg-card: #12121c;
    --robot-bg-input: #1a1a28;
    --robot-primary: #00d4ff;
    --robot-secondary: #00ff88;
    --robot-accent: #ff00aa;
    --robot-text: #e8e8f0;
    --robot-text-dim: #6a6a8a;
    --robot-border: #2a2a3f;
    --robot-glow: rgba(0, 212, 255, 0.4);
    --robot-glow-green: rgba(0, 255, 136, 0.3);
    --robot-gradient: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
}

/* ============================================
   STYLE ISOLATION - Protect from WordPress theme
   ============================================ */
#ollama-chatbot-container,
#ollama-chatbot-container * {
    box-sizing: border-box;
}

#ollama-chatbot-container textarea {
    font-family: inherit;
}

/* ============================================
   FLOATING TOGGLE BUTTON - Robot Avatar
   ============================================ */
.robot-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--robot-bg-dark);
    border: 3px solid var(--robot-primary);
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    box-shadow:
        0 0 20px var(--robot-glow),
        0 0 40px rgba(0, 212, 255, 0.2),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
}

.robot-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow:
        0 0 30px var(--robot-glow),
        0 0 60px rgba(0, 212, 255, 0.3),
        inset 0 0 30px rgba(0, 212, 255, 0.2);
    border-color: var(--robot-secondary);
}

.robot-toggle-btn:active {
    transform: scale(0.95);
}

/* Robot Avatar */
.robot-avatar {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Antenna */
.robot-antenna {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 16px;
    background: var(--robot-primary);
    border-radius: 2px;
}

.antenna-ball {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: var(--robot-secondary);
    border-radius: 50%;
    animation: antenna-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--robot-secondary);
}

@keyframes antenna-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.3); opacity: 0.7; }
}

/* Robot Face */
.robot-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.robot-eyes {
    display: flex;
    gap: 12px;
}

.robot-eye {
    width: 14px;
    height: 14px;
    background: var(--robot-primary);
    border-radius: 2px;
    position: relative;
    animation: eye-blink 4s ease-in-out infinite;
    box-shadow: 0 0 8px var(--robot-primary);
}

.robot-eye::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 1px;
    top: 2px;
    right: 2px;
    opacity: 0.9;
}

.robot-eye.left {
    animation-delay: 0.1s;
}

@keyframes eye-blink {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

.robot-mouth {
    width: 20px;
    height: 6px;
    background: var(--robot-secondary);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.robot-mouth::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: mouth-scan 2s linear infinite;
}

@keyframes mouth-scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Pulse Rings */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--robot-primary);
    animation: pulse-expand 2s ease-out infinite;
    pointer-events: none;
}

.pulse-ring.delay {
    animation-delay: 1s;
}

@keyframes pulse-expand {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* ============================================
   CHAT WINDOW
   ============================================ */
.chat-window {
    position: fixed;
    bottom: 110px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 580px;
    max-height: calc(100vh - 140px);
    background: var(--robot-bg-dark);
    border: 2px solid var(--robot-border);
    border-radius: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 0 0 1px rgba(0, 212, 255, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(0, 212, 255, 0.1);
}

/* Grid Background Pattern */
.chat-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.chat-hidden {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    pointer-events: none;
}

/* Corner Decorations */
.corner-decor {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 2;
    pointer-events: none;
}

.corner-decor::before,
.corner-decor::after {
    content: '';
    position: absolute;
    background: var(--robot-primary);
}

.corner-decor.top-left {
    top: -1px;
    left: -1px;
}
.corner-decor.top-left::before {
    width: 20px;
    height: 2px;
    top: 0;
    left: 0;
}
.corner-decor.top-left::after {
    width: 2px;
    height: 20px;
    top: 0;
    left: 0;
}

.corner-decor.top-right {
    top: -1px;
    right: -1px;
}
.corner-decor.top-right::before {
    width: 20px;
    height: 2px;
    top: 0;
    right: 0;
}
.corner-decor.top-right::after {
    width: 2px;
    height: 20px;
    top: 0;
    right: 0;
}

.corner-decor.bottom-left {
    bottom: -1px;
    left: -1px;
}
.corner-decor.bottom-left::before {
    width: 20px;
    height: 2px;
    bottom: 0;
    left: 0;
}
.corner-decor.bottom-left::after {
    width: 2px;
    height: 20px;
    bottom: 0;
    left: 0;
}

.corner-decor.bottom-right {
    bottom: -1px;
    right: -1px;
}
.corner-decor.bottom-right::before {
    width: 20px;
    height: 2px;
    bottom: 0;
    right: 0;
}
.corner-decor.bottom-right::after {
    width: 2px;
    height: 20px;
    bottom: 0;
    right: 0;
}

/* Scanline Effect */
.scanline {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--robot-primary), transparent);
    opacity: 0.3;
    z-index: 1;
    animation: scanline-move 8s linear infinite;
    pointer-events: none;
}

@keyframes scanline-move {
    0% { top: 70px; opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { top: calc(100% - 80px); opacity: 0.3; }
}

/* ============================================
   CHAT HEADER
   ============================================ */
.chat-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--robot-border);
    position: relative;
    z-index: 1;
}

.header-robot {
    margin-right: 14px;
}

.mini-robot-face {
    width: 42px;
    height: 42px;
    background: var(--robot-bg-card);
    border: 2px solid var(--robot-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 15px var(--robot-glow);
}

.mini-robot-face::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--robot-secondary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--robot-secondary);
}

.mini-robot-eyes {
    display: flex;
    gap: 6px;
}

.mini-eye {
    width: 8px;
    height: 8px;
    background: var(--robot-primary);
    border-radius: 2px;
    animation: mini-eye-glow 2s ease-in-out infinite;
    box-shadow: 0 0 6px var(--robot-primary);
}

.mini-eye:first-child {
    animation-delay: 0.3s;
}

@keyframes mini-eye-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-info {
    flex: 1;
}

.header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--robot-text);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--robot-secondary);
    border-radius: 50%;
    animation: status-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px var(--robot-secondary);
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.status-text {
    font-size: 11px;
    color: var(--robot-secondary);
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Close Button */
.close-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--robot-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    border-color: var(--robot-accent);
    background: rgba(255, 0, 170, 0.1);
}

.close-icon {
    position: relative;
    width: 16px;
    height: 16px;
}

.close-icon span {
    position: absolute;
    width: 16px;
    height: 2px;
    background: var(--robot-text-dim);
    top: 50%;
    left: 50%;
    transition: all 0.3s ease;
}

.close-icon span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-icon span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.close-btn:hover .close-icon span {
    background: var(--robot-accent);
}

/* New Chat Button */
.new-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--robot-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.new-btn svg {
    width: 18px;
    height: 18px;
    fill: none !important;
    stroke: var(--robot-text-dim) !important;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.new-btn:hover {
    border-color: var(--robot-secondary);
    background: rgba(0, 255, 136, 0.1);
}

.new-btn:hover svg {
    stroke: var(--robot-secondary) !important;
    transform: rotate(90deg);
}

/* ============================================
   MESSAGES AREA
   ============================================ */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    position: relative;
    z-index: 1;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--robot-bg-dark);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--robot-border);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--robot-primary);
}

/* Welcome Message */
.ollama-welcome {
    text-align: center;
    padding: 24px 16px;
    color: var(--robot-text-dim);
    font-size: 14px;
    position: relative;
}

.ollama-welcome::before {
    content: '//';
    color: var(--robot-primary);
    margin-right: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.ollama-welcome .bot-name {
    color: var(--robot-primary);
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
}

/* Message Styles */
.ollama-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    animation: message-slide 0.3s ease-out;
}

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

.ollama-message-user {
    align-items: flex-end;
}

.ollama-message-assistant {
    align-items: flex-start;
}

.ollama-message-content {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    position: relative;
}

/* User Message - Outgoing */
.ollama-message-user .ollama-message-content {
    background: linear-gradient(135deg, #00d4ff 0%, #00ff88 100%);
    color: var(--robot-bg-dark);
    border-bottom-right-radius: 4px;
    font-weight: 500;
    box-shadow:
        0 4px 20px rgba(0, 212, 255, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.ollama-message-user .ollama-message-content::before {
    content: '>';
    position: absolute;
    right: 8px;
    bottom: 6px;
    font-size: 10px;
    opacity: 0.5;
}

/* Assistant Message - Incoming */
.ollama-message-assistant .ollama-message-content {
    background: var(--robot-bg-card);
    color: var(--robot-text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--robot-border);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 212, 255, 0.1) inset;
}

.ollama-message-assistant .ollama-message-content::before {
    content: '<';
    position: absolute;
    left: 8px;
    bottom: 6px;
    font-size: 10px;
    color: var(--robot-primary);
    opacity: 0.7;
}

/* Markdown Styles */
.ollama-message-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid var(--robot-border);
    font-family: 'JetBrains Mono', monospace;
}

.ollama-message-content code {
    background: rgba(0, 212, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--robot-primary);
}

.ollama-message-content pre code {
    background: transparent;
    padding: 0;
    color: var(--robot-text);
}

.ollama-message-content ul,
.ollama-message-content ol {
    margin: 10px 0;
    padding-left: 24px;
}

.ollama-message-content li {
    margin: 4px 0;
}

.ollama-message-content p {
    margin: 10px 0;
}

.ollama-message-content p:first-child {
    margin-top: 0;
}

.ollama-message-content p:last-child {
    margin-bottom: 0;
}

.ollama-message-content strong {
    color: var(--robot-secondary);
}

.ollama-message-content a {
    color: var(--robot-primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--robot-primary);
}

.ollama-message-content a:hover {
    color: var(--robot-secondary);
    border-bottom-color: var(--robot-secondary);
}

/* Typing Indicator */
.ollama-typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 0;
    align-items: center;
}

.ollama-typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--robot-primary);
    border-radius: 2px;
    animation: typing-robot 1.2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--robot-primary);
}

.ollama-typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.ollama-typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-robot {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-6px) scale(1.2);
        opacity: 0.6;
    }
}

/* Error Message */
.ollama-error {
    color: var(--robot-accent);
    font-size: 12px;
    padding: 8px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   INPUT AREA
   ============================================ */
.chat-input-area {
    display: flex;
    padding: 16px;
    gap: 12px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 212, 255, 0.05) 100%);
    border-top: 1px solid var(--robot-border);
    position: relative;
    z-index: 1;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-decor {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 2px solid var(--robot-primary);
    pointer-events: none;
    z-index: 1;
}

.input-decor.left {
    left: 0;
    top: 0;
    border-right: none;
    border-bottom: none;
}

.input-decor.right {
    right: 0;
    bottom: 0;
    border-left: none;
    border-top: none;
}

#ollama-chat-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--robot-bg-input);
    border: 1px solid var(--robot-border);
    border-radius: 12px;
    color: var(--robot-text);
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

#ollama-chat-input::placeholder {
    color: var(--robot-text-dim);
    opacity: 0.7;
}

#ollama-chat-input:focus {
    outline: none;
    border-color: var(--robot-primary);
    box-shadow:
        0 0 0 2px rgba(0, 212, 255, 0.1),
        0 0 20px rgba(0, 212, 255, 0.1);
}

/* Send Button */
.send-btn {
    width: 48px;
    height: 48px;
    background: var(--robot-gradient);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn svg {
    width: 22px;
    height: 22px;
    fill: none !important;
    stroke: var(--robot-bg-dark) !important;
    stroke-width: 2;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--robot-glow);
}

.send-btn:hover svg {
    transform: translateX(2px) translateY(-2px);
}

.send-btn:active {
    transform: scale(0.95);
}

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

.send-btn:disabled:hover svg {
    transform: none;
}

.btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: btn-shine 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes btn-shine {
    0%, 100% { transform: rotate(45deg) translateX(-150%); }
    50% { transform: rotate(45deg) translateX(150%); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .chat-window {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }

    .robot-toggle-btn {
        bottom: 16px;
        right: 16px;
        width: 64px;
        height: 64px;
    }

    .corner-decor {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible */
.robot-toggle-btn:focus-visible,
.close-btn:focus-visible,
.new-btn:focus-visible,
.send-btn:focus-visible,
#ollama-chat-input:focus-visible {
    outline: 2px solid var(--robot-secondary);
    outline-offset: 2px;
}

/* ============================================
   THEME SYSTEM - Multi-style Widget Themes
   ============================================ */

/* Theme: Xiao Wang (Default - Tech Robot)
   Colors: Cyan #00d4ff, Green #00ff88, Magenta #ff00aa
   Style: Sci-fi, robotic, glowing
   Avatar: Robot face with antenna
*/

/* Theme: Mei (Customer Service - Warm & Friendly)
   Colors: Coral #ff8fab, Peach #fcd5ce, Gold #e9c46a, Cream #fefae0
   Style: Soft, rounded, welcoming, empathetic
   Avatar: Custom caring customer service character
*/
#ollama-chatbot-container.theme-mei {
    /* Warm & Inviting Color Palette */
    --robot-bg-dark: #fff9f5;
    --robot-bg-card: #ffffff;
    --robot-bg-input: #fffbf7;
    --robot-primary: #ff8fab;
    --robot-secondary: #f4a261;
    --robot-accent: #e9c46a;
    --robot-text: #5c4033;
    --robot-text-dim: #a68a64;
    --robot-border: #fce8dc;
    --robot-glow: rgba(255, 143, 171, 0.3);
    --robot-glow-green: rgba(244, 162, 97, 0.25);
    --robot-gradient: linear-gradient(135deg, #ff8fab 0%, #f4a261 100%);

    /* Mei-specific colors */
    --mei-coral: #ff8fab;
    --mei-peach: #fcd5ce;
    --mei-cream: #fefae0;
    --mei-gold: #e9c46a;
    --mei-warm-brown: #8b6914;
}

/* ============================================
   MEI FLOATING TOGGLE - Caring Avatar
   ============================================ */
#ollama-chatbot-container.theme-mei .robot-toggle-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 3px solid var(--mei-coral);
    background: linear-gradient(145deg, #ffffff 0%, var(--mei-peach) 100%);
    box-shadow:
        0 4px 20px rgba(255, 143, 171, 0.25),
        0 8px 40px rgba(255, 143, 171, 0.15),
        inset 0 2px 10px rgba(255, 255, 255, 0.8);
    overflow: visible;
}

#ollama-chatbot-container.theme-mei .robot-toggle-btn:hover {
    transform: scale(1.08) rotate(5deg);
    border-color: var(--mei-gold);
    box-shadow:
        0 6px 30px rgba(255, 143, 171, 0.35),
        0 12px 50px rgba(244, 162, 97, 0.2);
}

#ollama-chatbot-container.theme-mei .robot-toggle-btn:active {
    transform: scale(0.95);
}

/* Hide robot avatar, show Mei avatar */
#ollama-chatbot-container.theme-mei .robot-avatar {
    display: none;
}

#ollama-chatbot-container.theme-mei .avatar-mei {
    display: flex;
}

/* Mei Avatar - Custom Illustration Style */
#ollama-chatbot-container.theme-mei .avatar-mei {
    position: relative;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

/* Mei's Face Container */
.mei-face {
    position: relative;
    width: 46px;
    height: 46px;
}

/* Mei's Hair */
.mei-hair {
    position: absolute;
    width: 50px;
    height: 26px;
    background: linear-gradient(180deg, #5c4033 0%, #8b6914 100%);
    border-radius: 25px 25px 0 0;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.mei-hair::before,
.mei-hair::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 20px;
    background: linear-gradient(180deg, #5c4033 0%, #8b6914 100%);
    border-radius: 0 0 6px 6px;
    bottom: -8px;
}

.mei-hair::before {
    left: -2px;
}

.mei-hair::after {
    right: -2px;
}

/* Mei's Face */
.mei-head {
    position: absolute;
    width: 40px;
    height: 38px;
    background: linear-gradient(180deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 50% 50% 45% 45%;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: mei-head-tilt 4s ease-in-out infinite;
}

@keyframes mei-head-tilt {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(2deg); }
    75% { transform: translateX(-50%) rotate(-2deg); }
}

/* Mei's Eyes */
.mei-eyes {
    position: absolute;
    display: flex;
    gap: 10px;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.mei-eye {
    width: 6px;
    height: 8px;
    background: #2d1810;
    border-radius: 50%;
    position: relative;
    animation: mei-blink 4s ease-in-out infinite;
}

.mei-eye::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    top: 1px;
    left: 1px;
}

@keyframes mei-blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

/* Mei's Blush */
.mei-blush {
    position: absolute;
    width: 8px;
    height: 4px;
    background: rgba(255, 143, 171, 0.6);
    border-radius: 50%;
    top: 18px;
    z-index: 3;
    animation: mei-blush-pulse 3s ease-in-out infinite;
}

.mei-blush.left {
    left: 4px;
}

.mei-blush.right {
    right: 4px;
}

@keyframes mei-blush-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

/* Mei's Smile */
.mei-smile {
    position: absolute;
    width: 12px;
    height: 6px;
    border: 2px solid #d4726a;
    border-top: none;
    border-radius: 0 0 12px 12px;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    background: transparent;
}

/* Mei's Headband/Accessory */
.mei-accessory {
    position: absolute;
    width: 14px;
    height: 8px;
    background: linear-gradient(135deg, var(--mei-coral) 0%, var(--mei-gold) 100%);
    border-radius: 4px;
    top: 6px;
    right: 6px;
    z-index: 4;
    box-shadow: 0 2px 4px rgba(255, 143, 171, 0.3);
}

/* Mei Pulse Rings - Soft Heart Style */
#ollama-chatbot-container.theme-mei .pulse-ring {
    border-color: var(--mei-coral);
    animation: mei-pulse 2.5s ease-out infinite;
}

#ollama-chatbot-container.theme-mei .pulse-ring.delay {
    animation-delay: 1.25s;
}

@keyframes mei-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
        border-radius: 50%;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
        border-radius: 50%;
    }
}

/* ============================================
   MEI CHAT WINDOW - Soft & Welcoming
   ============================================ */
#ollama-chatbot-container.theme-mei .chat-window {
    background: linear-gradient(180deg, #fff9f5 0%, #ffffff 50%, #fffbf7 100%);
    border: 2px solid var(--mei-peach);
    border-radius: 24px;
    box-shadow:
        0 0 0 1px rgba(255, 143, 171, 0.1),
        0 20px 60px rgba(255, 143, 171, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Soft Pattern Background */
#ollama-chatbot-container.theme-mei .chat-window::before {
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 143, 171, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(244, 162, 97, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(233, 196, 106, 0.03) 0%, transparent 70%);
    background-size: 100px 100px, 120px 120px, 150px 150px;
    animation: mei-bg-float 20s ease-in-out infinite;
}

@keyframes mei-bg-float {
    0%, 100% { background-position: 0 0, 100px 50px, 50px 100px; }
    50% { background-position: 20px 20px, 80px 70px, 70px 120px; }
}

/* Hide sharp corner decorations */
#ollama-chatbot-container.theme-mei .corner-decor {
    display: none;
}

/* Soft Scanline - Wavy Gradient */
#ollama-chatbot-container.theme-mei .scanline {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 143, 171, 0.15) 20%,
        rgba(244, 162, 97, 0.2) 50%,
        rgba(255, 143, 171, 0.15) 80%,
        transparent 100%
    );
    height: 1px;
    opacity: 0.6;
    animation: mei-scanline 12s ease-in-out infinite;
}

@keyframes mei-scanline {
    0% { top: 70px; opacity: 0.4; }
    50% { opacity: 0.7; }
    100% { top: calc(100% - 80px); opacity: 0.4; }
}

/* ============================================
   MEI CHAT HEADER
   ============================================ */
#ollama-chatbot-container.theme-mei .chat-header {
    background: linear-gradient(180deg, rgba(255, 143, 171, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--mei-peach);
    border-radius: 22px 22px 0 0;
    padding: 18px 20px;
}

/* Mei Header Avatar */
#ollama-chatbot-container.theme-mei .mini-robot-face {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--mei-coral);
    background: linear-gradient(145deg, #ffffff 0%, var(--mei-peach) 100%);
    box-shadow: 0 4px 12px rgba(255, 143, 171, 0.2);
    position: relative;
    overflow: hidden;
}

#ollama-chatbot-container.theme-mei .mini-robot-face::before {
    display: none;
}

/* Mini Mei Face in Header */
#ollama-chatbot-container.theme-mei .mini-robot-eyes {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

#ollama-chatbot-container.theme-mei .mini-eye {
    width: 5px;
    height: 7px;
    background: #2d1810;
    border-radius: 50%;
    animation: mei-mini-eye 3s ease-in-out infinite;
    box-shadow: none;
}

#ollama-chatbot-container.theme-mei .mini-eye::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    top: 1px;
    right: 1px;
}

@keyframes mei-mini-eye {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(1px); }
}

/* Add mini blush */
#ollama-chatbot-container.theme-mei .header-robot::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 5px;
    background: rgba(255, 143, 171, 0.5);
    border-radius: 50%;
    bottom: 8px;
    right: 4px;
    z-index: 5;
}

/* Mei Header Title */
#ollama-chatbot-container.theme-mei .header-info h3 {
    font-family: 'Nunito', 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: #5c4033;
    letter-spacing: 0.5px;
    text-transform: none;
}

/* Status Line */
#ollama-chatbot-container.theme-mei .status-dot {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

#ollama-chatbot-container.theme-mei .status-text {
    color: #22c55e;
    font-family: 'Quicksand', -apple-system, sans-serif;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

/* Close Button */
#ollama-chatbot-container.theme-mei .close-btn {
    border-radius: 12px;
    border: 1px solid var(--mei-peach);
    background: rgba(255, 255, 255, 0.8);
}

#ollama-chatbot-container.theme-mei .close-btn:hover {
    border-color: var(--mei-coral);
    background: rgba(255, 143, 171, 0.1);
    transform: rotate(90deg);
}

#ollama-chatbot-container.theme-mei .close-icon span {
    background: var(--robot-text-dim);
    border-radius: 1px;
}

#ollama-chatbot-container.theme-mei .close-btn:hover .close-icon span {
    background: var(--mei-coral);
}

/* New Chat Button - Mei Theme */
#ollama-chatbot-container.theme-mei .new-btn {
    border-radius: 12px;
    border: 1px solid var(--mei-peach);
    background: rgba(255, 255, 255, 0.8);
}

#ollama-chatbot-container.theme-mei .new-btn:hover {
    border-color: var(--mei-coral);
    background: rgba(255, 143, 171, 0.1);
    transform: rotate(90deg);
}

#ollama-chatbot-container.theme-mei .new-btn svg {
    fill: none !important;
    stroke: var(--robot-text-dim) !important;
    stroke-width: 2;
}

#ollama-chatbot-container.theme-mei .new-btn:hover svg {
    stroke: var(--mei-coral) !important;
}

/* ============================================
   MEI MESSAGES AREA
   ============================================ */
#ollama-chatbot-container.theme-mei .chat-messages {
    padding: 20px 16px;
}

/* Custom Scrollbar - Soft Style */
#ollama-chatbot-container.theme-mei .chat-messages::-webkit-scrollbar {
    width: 6px;
}

#ollama-chatbot-container.theme-mei .chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#ollama-chatbot-container.theme-mei .chat-messages::-webkit-scrollbar-thumb {
    background: var(--mei-peach);
    border-radius: 3px;
}

#ollama-chatbot-container.theme-mei .chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--mei-coral);
}

/* Welcome Message - Friendly Style */
#ollama-chatbot-container.theme-mei .ollama-welcome {
    text-align: center;
    padding: 28px 20px;
    position: relative;
}

#ollama-chatbot-container.theme-mei .ollama-welcome::before {
    content: '🌸';
    margin-right: 6px;
    font-size: 14px;
}

#ollama-chatbot-container.theme-mei .ollama-welcome .bot-name {
    color: var(--mei-coral);
    font-weight: 700;
    font-family: 'Quicksand', -apple-system, sans-serif;
}

/* Message Styles - Soft Bubbles */
#ollama-chatbot-container.theme-mei .ollama-message {
    margin-bottom: 14px;
}

#ollama-chatbot-container.theme-mei .ollama-message-content {
    padding: 14px 18px;
    border-radius: 20px;
    font-family: 'Nunito', 'Quicksand', -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* User Message - Outgoing */
#ollama-chatbot-container.theme-mei .ollama-message-user .ollama-message-content {
    background: linear-gradient(135deg, #ff8fab 0%, #f4a261 100%);
    color: white;
    border-bottom-right-radius: 6px;
    font-weight: 600;
    box-shadow:
        0 4px 16px rgba(255, 143, 171, 0.3),
        0 2px 8px rgba(244, 162, 97, 0.2);
}

#ollama-chatbot-container.theme-mei .ollama-message-user .ollama-message-content::before {
    content: '';
    display: none;
}

/* Assistant Message - Incoming */
#ollama-chatbot-container.theme-mei .ollama-message-assistant .ollama-message-content {
    background: #ffffff;
    color: #5c4033;
    border: 1px solid var(--mei-peach);
    border-bottom-left-radius: 6px;
    position: relative;
}

#ollama-chatbot-container.theme-mei .ollama-message-assistant .ollama-message-content::before {
    content: '';
    display: none;
}

/* Add caring indicator before assistant message */
#ollama-chatbot-container.theme-mei .ollama-message-assistant .ollama-message-content::after {
    content: '💕';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.6;
    animation: mei-heart-beat 2s ease-in-out infinite;
}

@keyframes mei-heart-beat {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

/* Markdown Styles for Mei */
#ollama-chatbot-container.theme-mei .ollama-message-content pre {
    background: rgba(255, 143, 171, 0.08);
    border: 1px solid var(--mei-peach);
    border-radius: 12px;
}

#ollama-chatbot-container.theme-mei .ollama-message-content code {
    background: rgba(255, 143, 171, 0.1);
    color: #d4726a;
    border-radius: 6px;
}

#ollama-chatbot-container.theme-mei .ollama-message-content pre code {
    color: #5c4033;
}

#ollama-chatbot-container.theme-mei .ollama-message-content strong {
    color: var(--mei-secondary);
}

#ollama-chatbot-container.theme-mei .ollama-message-content a {
    color: var(--mei-coral);
    border-bottom: 1px dashed var(--mei-coral);
}

#ollama-chatbot-container.theme-mei .ollama-message-content a:hover {
    color: var(--mei-secondary);
    border-bottom-color: var(--mei-secondary);
}

/* Typing Indicator - Soft Dots */
#ollama-chatbot-container.theme-mei .ollama-typing-indicator {
    gap: 6px;
}

#ollama-chatbot-container.theme-mei .ollama-typing-indicator span {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--mei-coral) 0%, var(--mei-secondary) 100%);
    border-radius: 50%;
    animation: mei-typing 1.4s ease-in-out infinite;
    box-shadow: 0 2px 6px rgba(255, 143, 171, 0.3);
}

#ollama-chatbot-container.theme-mei .ollama-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
#ollama-chatbot-container.theme-mei .ollama-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes mei-typing {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-8px) scale(1.1);
        opacity: 0.7;
    }
}

/* ============================================
   MEI INPUT AREA
   ============================================ */
#ollama-chatbot-container.theme-mei .chat-input-area {
    padding: 16px 20px;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 143, 171, 0.04) 100%);
    border-top: 1px solid var(--mei-peach);
    border-radius: 0 0 22px 22px;
    gap: 14px;
}

/* Hide input decorations */
#ollama-chatbot-container.theme-mei .input-decor {
    display: none;
}

/* Input Field */
#ollama-chatbot-container.theme-mei #ollama-chat-input {
    padding: 16px 20px;
    background: #ffffff;
    border: 2px solid var(--mei-peach);
    border-radius: 24px;
    color: #5c4033;
    font-family: 'Nunito', -apple-system, sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

#ollama-chatbot-container.theme-mei #ollama-chat-input::placeholder {
    color: #c4a882;
}

#ollama-chatbot-container.theme-mei #ollama-chat-input:focus {
    border-color: var(--mei-coral);
    box-shadow:
        0 0 0 4px rgba(255, 143, 171, 0.1),
        0 4px 16px rgba(255, 143, 171, 0.15);
}

/* Send Button - Heart Style */
#ollama-chatbot-container.theme-mei .send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8fab 0%, #f4a261 100%);
    box-shadow:
        0 4px 16px rgba(255, 143, 171, 0.35),
        0 2px 8px rgba(244, 162, 97, 0.25);
}

#ollama-chatbot-container.theme-mei .send-btn svg {
    width: 20px;
    height: 20px;
    fill: none !important;
    stroke: white !important;
    stroke-width: 2;
}

#ollama-chatbot-container.theme-mei .send-btn:hover {
    transform: scale(1.08);
    box-shadow:
        0 6px 24px rgba(255, 143, 171, 0.45),
        0 4px 12px rgba(244, 162, 97, 0.3);
}

#ollama-chatbot-container.theme-mei .send-btn:hover svg {
    transform: translateX(2px) translateY(-2px);
}

#ollama-chatbot-container.theme-mei .send-btn:active {
    transform: scale(0.95);
}

/* Button Glow Animation */
#ollama-chatbot-container.theme-mei .btn-glow {
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 70%
    );
    animation: mei-btn-shine 4s ease-in-out infinite;
}

@keyframes mei-btn-shine {
    0%, 100% { transform: rotate(45deg) translateX(-150%); }
    50% { transform: rotate(45deg) translateX(150%); }
}

/* ============================================
   MEI RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    #ollama-chatbot-container.theme-mei .chat-window {
        border-radius: 0;
        border: none;
    }

    #ollama-chatbot-container.theme-mei .chat-header {
        border-radius: 0;
    }

    #ollama-chatbot-container.theme-mei .chat-input-area {
        border-radius: 0;
    }

    #ollama-chatbot-container.theme-mei .robot-toggle-btn {
        width: 60px;
        height: 60px;
    }
}

/* ============================================
   MEI ACCESSIBILITY
   ============================================ */
#ollama-chatbot-container.theme-mei .robot-toggle-btn:focus-visible,
#ollama-chatbot-container.theme-mei .close-btn:focus-visible,
#ollama-chatbot-container.theme-mei .new-btn:focus-visible,
#ollama-chatbot-container.theme-mei .send-btn:focus-visible,
#ollama-chatbot-container.theme-mei #ollama-chat-input:focus-visible {
    outline: 2px solid var(--mei-coral);
    outline-offset: 3px;
}

/* Theme: Technical Advisor (Professional & Clean)
   Colors: Blue #3b82f6, Gray #6b7280, Green #10b981
   Style: Minimal, professional, efficient
   Avatar: Lightning bolt icon
*/
/* ============================================
   THEME: FELIX - Senior Engineer
   Refined · Professional · Thoughtful
   ============================================ */

#ollama-chatbot-container.theme-tech-advisor {
    /* Refined Professional Color System */
    --tech-navy: #1a365d;
    --tech-navy-light: #2c5282;
    --tech-navy-dark: #102a43;
    --tech-gold: #c9a227;
    --tech-gold-light: #d4af37;
    --tech-gold-dark: #9a7b0a;
    --tech-ivory: #faf9f6;
    --tech-cream: #f5f3ef;
    --tech-paper: #f8f6f1;
    --tech-ink: #2d3748;
    --tech-ink-light: #4a5568;
    --tech-muted: #718096;
    --tech-border: #e2ded8;
    --tech-border-dark: #c9c4bc;

    /* Override base variables */
    --robot-bg-dark: var(--tech-navy-dark);
    --robot-bg-card: var(--tech-paper);
    --robot-bg-input: var(--tech-ivory);
    --robot-primary: var(--tech-navy);
    --robot-secondary: var(--tech-gold);
    --robot-accent: var(--tech-gold-light);
    --robot-text: var(--tech-ink);
    --robot-text-dim: var(--tech-muted);
    --robot-border: var(--tech-border);
    --robot-glow: rgba(201, 162, 39, 0.25);
    --robot-glow-green: rgba(44, 82, 130, 0.2);
    --robot-gradient: linear-gradient(135deg, var(--tech-navy) 0%, var(--tech-navy-light) 100%);
}

/* ============================================
   FLOATING BUTTON - Gentle Professional
   ============================================ */

#ollama-chatbot-container.theme-tech-advisor .robot-toggle-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--tech-ivory) 0%, var(--tech-cream) 100%);
    border: 2px solid var(--tech-gold);
    box-shadow:
        0 4px 20px rgba(26, 54, 93, 0.15),
        0 0 0 4px rgba(201, 162, 39, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#ollama-chatbot-container.theme-tech-advisor .robot-toggle-btn:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--tech-gold-light);
    box-shadow:
        0 8px 30px rgba(26, 54, 93, 0.2),
        0 0 0 6px rgba(201, 162, 39, 0.15),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

#ollama-chatbot-container.theme-tech-advisor .robot-toggle-btn:active {
    transform: translateY(-1px) scale(0.98);
}

#ollama-chatbot-container.theme-tech-advisor .robot-avatar {
    display: none;
}

#ollama-chatbot-container.theme-tech-advisor .avatar-mei {
    display: none;
}

/* Tech Advisor Avatar - Cartoon Engineer */
#ollama-chatbot-container.theme-tech-advisor .avatar-tech {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    position: relative;
}

#ollama-chatbot-container.theme-tech-advisor .engineer-face {
    animation: gentle-float 4s ease-in-out infinite;
}

#ollama-chatbot-container.theme-tech-advisor .engineer-hair {
    background: var(--tech-navy);
}

#ollama-chatbot-container.theme-tech-advisor .engineer-lens {
    border-color: var(--tech-navy);
}

#ollama-chatbot-container.theme-tech-advisor .engineer-smile {
    border-color: #a07e5c;
}

#ollama-chatbot-container.theme-tech-advisor .engineer-collar {
    background: #f8fafc;
    border-color: var(--tech-border);
}

#ollama-chatbot-container.theme-tech-advisor .engineer-collar::before,
#ollama-chatbot-container.theme-tech-advisor .engineer-collar::after {
    background: #f8fafc;
    border-color: var(--tech-border);
}

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

/* Pulse rings - Refined */
#ollama-chatbot-container.theme-tech-advisor .pulse-ring {
    border-color: var(--tech-gold);
    opacity: 0.3;
}

#ollama-chatbot-container.theme-tech-advisor .pulse-ring.delay {
    border-color: var(--tech-navy-light);
    opacity: 0.2;
}

/* ============================================
   CHAT WINDOW - Scholar's Study
   ============================================ */

#ollama-chatbot-container.theme-tech-advisor .chat-window {
    background: linear-gradient(180deg, var(--tech-ivory) 0%, var(--tech-paper) 100%);
    border: 1px solid var(--tech-border);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(26, 54, 93, 0.12),
        0 0 0 1px rgba(201, 162, 39, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

/* Subtle paper texture overlay */
#ollama-chatbot-container.theme-tech-advisor .chat-window::before {
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(201, 162, 39, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(26, 54, 93, 0.02) 0%, transparent 50%);
    opacity: 1;
}

/* Corner decorations - Architectural precision */
#ollama-chatbot-container.theme-tech-advisor .corner-decor::before,
#ollama-chatbot-container.theme-tech-advisor .corner-decor::after {
    background: var(--tech-gold);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

#ollama-chatbot-container.theme-tech-advisor .chat-window:hover .corner-decor::before,
#ollama-chatbot-container.theme-tech-advisor .chat-window:hover .corner-decor::after {
    opacity: 0.6;
}

/* No scanline for this theme */
#ollama-chatbot-container.theme-tech-advisor .scanline {
    display: none;
}

/* ============================================
   HEADER - Professional Title Bar
   ============================================ */

#ollama-chatbot-container.theme-tech-advisor .chat-header {
    background: linear-gradient(180deg, var(--tech-navy) 0%, var(--tech-navy-light) 100%);
    border-bottom: 2px solid var(--tech-gold);
    padding: 16px 20px;
    position: relative;
}

/* Decorative header line */
#ollama-chatbot-container.theme-tech-advisor .chat-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.3), transparent);
}

/* Header avatar - Monogram style */
#ollama-chatbot-container.theme-tech-advisor .header-robot .mini-robot-face {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--tech-gold) 0%, var(--tech-gold-light) 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(201, 162, 39, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

#ollama-chatbot-container.theme-tech-advisor .header-robot .mini-robot-face::before,
#ollama-chatbot-container.theme-tech-advisor .header-robot .mini-robot-eyes {
    display: none;
}

#ollama-chatbot-container.theme-tech-advisor .header-robot .mini-robot-face::after {
    content: 'T';
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--tech-navy-dark);
}

/* Header info */
#ollama-chatbot-container.theme-tech-advisor .header-info h3 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--tech-ivory);
    letter-spacing: 0.5px;
}

#ollama-chatbot-container.theme-tech-advisor .status-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

#ollama-chatbot-container.theme-tech-advisor .status-dot {
    width: 6px;
    height: 6px;
    background: var(--tech-gold);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.3);
    animation: status-glow 2s ease-in-out infinite;
}

@keyframes status-glow {
    0%, 100% { box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.3); }
    50% { box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.2); }
}

#ollama-chatbot-container.theme-tech-advisor .status-text {
    font-family: 'Source Serif Pro', 'Georgia', serif;
    font-size: 11px;
    color: var(--tech-gold-light);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Close button */
#ollama-chatbot-container.theme-tech-advisor .close-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

#ollama-chatbot-container.theme-tech-advisor .close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--tech-gold);
}

#ollama-chatbot-container.theme-tech-advisor .close-icon span {
    background: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

#ollama-chatbot-container.theme-tech-advisor .close-btn:hover .close-icon span {
    background: var(--tech-gold);
}

/* New Chat Button - Tech Advisor Theme */
#ollama-chatbot-container.theme-tech-advisor .new-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

#ollama-chatbot-container.theme-tech-advisor .new-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--tech-gold);
}

#ollama-chatbot-container.theme-tech-advisor .new-btn svg {
    fill: none !important;
    stroke: rgba(255, 255, 255, 0.7) !important;
    stroke-width: 2;
    transition: all 0.3s ease;
}

#ollama-chatbot-container.theme-tech-advisor .new-btn:hover svg {
    stroke: var(--tech-gold) !important;
}

/* ============================================
   MESSAGES AREA - Scholarly Exchange
   ============================================ */

#ollama-chatbot-container.theme-tech-advisor .chat-messages {
    background: transparent;
    scrollbar-width: thin;
}

#ollama-chatbot-container.theme-tech-advisor .chat-messages::-webkit-scrollbar {
    width: 6px;
}

#ollama-chatbot-container.theme-tech-advisor .chat-messages::-webkit-scrollbar-track {
    background: var(--tech-cream);
}

#ollama-chatbot-container.theme-tech-advisor .chat-messages::-webkit-scrollbar-thumb {
    background: var(--tech-border-dark);
    border-radius: 3px;
}

#ollama-chatbot-container.theme-tech-advisor .chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--tech-muted);
}

/* Welcome message */
#ollama-chatbot-container.theme-tech-advisor .ollama-welcome {
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.04) 0%, rgba(201, 162, 39, 0.04) 100%);
    border: 1px solid var(--tech-border);
    border-left: 3px solid var(--tech-gold);
    border-radius: 0 12px 12px 0;
    padding: 16px 20px;
    color: var(--tech-ink);
    font-family: 'Source Serif Pro', 'Georgia', serif;
    font-size: 14px;
    line-height: 1.7;
    position: relative;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-welcome::before {
    content: '"';
    color: var(--tech-gold);
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 0;
    vertical-align: text-bottom;
    margin-right: 2px;
    opacity: 0.7;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-welcome::after {
    content: '"';
    color: var(--tech-gold);
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 0;
    vertical-align: text-bottom;
    margin-left: 2px;
    opacity: 0.7;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-welcome .bot-name {
    color: var(--tech-navy);
    font-weight: 600;
}

/* Message bubbles */
#ollama-chatbot-container.theme-tech-advisor .ollama-message {
    margin-bottom: 16px;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-message-content {
    font-family: 'Source Serif Pro', 'Georgia', serif;
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: 0.1px;
    color: var(--tech-ink);
}

/* User message */
#ollama-chatbot-container.theme-tech-advisor .ollama-message-user .ollama-message-content {
    background: linear-gradient(135deg, var(--tech-navy) 0%, var(--tech-navy-light) 100%);
    color: var(--tech-ivory);
    border-radius: 16px 16px 4px 16px;
    padding: 12px 16px;
    box-shadow:
        0 4px 12px rgba(26, 54, 93, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-message-user .ollama-message-content::before {
    display: none;
}

/* Assistant message */
#ollama-chatbot-container.theme-tech-advisor .ollama-message-assistant {
    padding-left: 8px;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-message-assistant .ollama-message-content {
    background: var(--tech-ivory);
    border: 1px solid var(--tech-border);
    border-left: 3px solid var(--tech-gold);
    border-radius: 0 12px 12px 12px;
    padding: 14px 18px;
    box-shadow:
        0 2px 8px rgba(26, 54, 93, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 1);
    position: relative;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-message-assistant .ollama-message-content::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 14px;
    width: 8px;
    height: 8px;
    background: var(--tech-gold);
    transform: rotate(45deg);
    box-shadow: 0 1px 3px rgba(201, 162, 39, 0.3);
}

#ollama-chatbot-container.theme-tech-advisor .ollama-message-assistant .ollama-message-content::after {
    display: none;
}

/* Message typography */
#ollama-chatbot-container.theme-tech-advisor .ollama-message-content pre {
    background: var(--tech-navy-dark);
    border: 1px solid var(--tech-navy);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    overflow-x: auto;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-message-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    background: rgba(26, 54, 93, 0.08);
    color: var(--tech-navy);
    padding: 2px 6px;
    border-radius: 4px;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-message-content pre code {
    background: transparent;
    color: var(--tech-ivory);
    padding: 0;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-message-content strong {
    color: var(--tech-navy);
    font-weight: 600;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-message-content a {
    color: var(--tech-navy-light);
    text-decoration: none;
    border-bottom: 1px solid var(--tech-gold);
    transition: all 0.2s ease;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-message-content a:hover {
    color: var(--tech-gold-dark);
    border-bottom-color: var(--tech-gold-dark);
}

/* Typing indicator - Elegant dots */
#ollama-chatbot-container.theme-tech-advisor .ollama-typing-indicator {
    display: flex;
    gap: 6px;
    padding: 4px 0;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--tech-gold);
    border-radius: 50%;
    animation: typing-wave 1.4s ease-in-out infinite;
    box-shadow: none;
}

#ollama-chatbot-container.theme-tech-advisor .ollama-typing-indicator span:nth-child(1) { animation-delay: 0s; }
#ollama-chatbot-container.theme-tech-advisor .ollama-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
#ollama-chatbot-container.theme-tech-advisor .ollama-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-wave {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ============================================
   INPUT AREA - Scholar's Desk
   ============================================ */

#ollama-chatbot-container.theme-tech-advisor .chat-input-area {
    background: linear-gradient(180deg, var(--tech-paper) 0%, var(--tech-cream) 100%);
    border-top: 1px solid var(--tech-border);
    padding: 16px;
}

#ollama-chatbot-container.theme-tech-advisor .input-wrapper {
    position: relative;
    background: var(--tech-ivory);
    border: 1px solid var(--tech-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

#ollama-chatbot-container.theme-tech-advisor .input-wrapper:focus-within {
    border-color: var(--tech-gold);
    box-shadow:
        0 0 0 3px rgba(201, 162, 39, 0.1),
        inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

#ollama-chatbot-container.theme-tech-advisor .input-decor {
    display: none;
}

#ollama-chatbot-container.theme-tech-advisor #ollama-chat-input {
    font-family: 'Source Serif Pro', 'Georgia', serif;
    font-size: 14px;
    color: var(--tech-ink);
    background: transparent;
    border: none;
    padding: 14px 16px;
    resize: none;
}

#ollama-chatbot-container.theme-tech-advisor #ollama-chat-input::placeholder {
    color: var(--tech-muted);
    font-style: italic;
}

#ollama-chatbot-container.theme-tech-advisor #ollama-chat-input:focus {
    outline: none;
}

/* Send button */
#ollama-chatbot-container.theme-tech-advisor .send-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--tech-navy) 0%, var(--tech-navy-light) 100%);
    border: none;
    box-shadow:
        0 2px 8px rgba(26, 54, 93, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#ollama-chatbot-container.theme-tech-advisor .send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.5), transparent);
}

#ollama-chatbot-container.theme-tech-advisor .send-btn svg {
    fill: none !important;
    stroke: var(--tech-ivory) !important;
    stroke-width: 2;
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
}

#ollama-chatbot-container.theme-tech-advisor .send-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 16px rgba(26, 54, 93, 0.25),
        0 0 0 2px var(--tech-gold);
}

#ollama-chatbot-container.theme-tech-advisor .send-btn:hover svg {
    stroke: var(--tech-gold) !important;
}

#ollama-chatbot-container.theme-tech-advisor .send-btn:active {
    transform: translateY(0);
}

#ollama-chatbot-container.theme-tech-advisor .btn-glow {
    display: none;
}

/* ============================================
   RESPONSIVE & ACCESSIBILITY
   ============================================ */

@media (max-width: 480px) {
    #ollama-chatbot-container.theme-tech-advisor .chat-window {
        border-radius: 12px;
    }

    #ollama-chatbot-container.theme-tech-advisor .chat-header {
        padding: 12px 16px;
    }

    #ollama-chatbot-container.theme-tech-advisor .header-info h3 {
        font-size: 16px;
    }

    #ollama-chatbot-container.theme-tech-advisor .chat-input-area {
        padding: 12px;
    }

    #ollama-chatbot-container.theme-tech-advisor .robot-toggle-btn {
        width: 56px;
        height: 56px;
    }
}

/* Focus states for accessibility */
#ollama-chatbot-container.theme-tech-advisor .robot-toggle-btn:focus-visible,
#ollama-chatbot-container.theme-tech-advisor .close-btn:focus-visible,
#ollama-chatbot-container.theme-tech-advisor .new-btn:focus-visible,
#ollama-chatbot-container.theme-tech-advisor .send-btn:focus-visible,
#ollama-chatbot-container.theme-tech-advisor #ollama-chat-input:focus-visible {
    outline: 2px solid var(--tech-gold);
    outline-offset: 2px;
}

/* ============================================
   ALTERNATE AVATAR STYLES
   ============================================ */

/* Avatar: Mei (Caring Customer Service) - Base Hidden */
.avatar-mei {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

/* Avatar: Tech Advisor (Cartoon Engineer) */
.avatar-tech {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Engineer Avatar - CSS Cartoon */
.engineer-face {
    position: relative;
    width: 44px;
    height: 44px;
}

.engineer-hair {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 12px;
    background: #2d3748;
    border-radius: 16px 16px 0 0;
}

.engineer-head {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 30px;
    background: #fbd5b5;
    border-radius: 18px 18px 14px 14px;
}

.engineer-glasses {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
}

.engineer-lens {
    width: 12px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid #1a365d;
    border-radius: 3px;
}

.engineer-lens.left {
    border-radius: 3px 4px 4px 3px;
}

.engineer-lens.right {
    border-radius: 4px 3px 3px 4px;
}

.engineer-smile {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 5px;
    border: 2px solid #c4886a;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.engineer-collar {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 8px;
    background: #ffffff;
    border-radius: 0 0 4px 4px;
    border: 1px solid #e2e8f0;
}

.engineer-collar::before,
.engineer-collar::after {
    content: '';
    position: absolute;
    top: -2px;
    width: 10px;
    height: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.engineer-collar::before {
    left: -2px;
    transform: rotate(-15deg);
    border-radius: 2px;
}

.engineer-collar::after {
    right: -2px;
    transform: rotate(15deg);
    border-radius: 2px;
}

/* ============================================
   COMMENT @MENTION HINT
   ============================================ */

.ollama-mention-hint {
    background: #f0f6fc;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #57606a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ollama-mention-hint .dashicons {
    color: #0969da;
}