/* ============================================================
   ERIC AI ASSISTANT — Floating living blob + chat panel
   SmartPack 2026
============================================================ */

.eric-assistant {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* Ensure blob and its overflow rings are fully gone when open */
.eric-assistant.eric-open .eric-blob {
    display: none;
}

/* ============================================================
   THE BLOB
============================================================ */

.eric-blob {
    position: relative;
    width: 52px;
    height: 52px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    outline: none;
}

/* Aura rings — 3 layers, offset timing for organic feel */
.eric-blob-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: eric-pulse 2.8s ease-in-out infinite;
}

.eric-blob-ring-1 {
    inset: -6px;
    background: radial-gradient(circle, rgba(63,187,254,0.18) 0%, transparent 68%);
    animation-duration: 3.5s;
}

.eric-blob-ring-2 {
    inset: -14px;
    background: radial-gradient(circle, rgba(86,126,255,0.09) 0%, transparent 65%);
    animation-duration: 4.5s;
    animation-delay: 1.2s;
}

.eric-blob-ring-3 {
    inset: -24px;
    background: radial-gradient(circle, rgba(63,187,254,0.04) 0%, transparent 60%);
    animation-duration: 6s;
    animation-delay: 2.5s;
}

@keyframes eric-pulse {
    0%, 100% { transform: scale(0.96); opacity: 0.5; }
    50%       { transform: scale(1.04); opacity: 0.9; }
}

/* The morphing blob core */
.eric-blob-core {
    position: relative;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #3fbbfe 0%, #567eff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Slow, subtle morph — alive but calm */
    animation: eric-morph 12s ease-in-out infinite;
    box-shadow:
        0 4px 20px rgba(63,187,254,0.45),
        0 8px 40px rgba(86,126,255,0.25);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.eric-blob:hover .eric-blob-core {
    transform: scale(1.06);
    box-shadow:
        0 6px 28px rgba(63,187,254,0.65),
        0 12px 50px rgba(86,126,255,0.4);
}

/* More dramatic morph — bigger shape variance */
@keyframes eric-morph {
    0%   { border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%; }
    10%  { border-radius: 40% 60% 70% 30% / 50% 60% 40% 50%; }
    20%  { border-radius: 55% 45% 35% 65% / 38% 62% 38% 62%; }
    30%  { border-radius: 30% 70% 55% 45% / 65% 35% 65% 35%; }
    40%  { border-radius: 68% 32% 42% 58% / 42% 58% 42% 58%; }
    50%  { border-radius: 45% 55% 68% 32% / 55% 45% 55% 45%; }
    60%  { border-radius: 35% 65% 38% 62% / 70% 30% 70% 30%; }
    70%  { border-radius: 58% 42% 60% 40% / 35% 65% 35% 65%; }
    80%  { border-radius: 72% 28% 45% 55% / 48% 52% 48% 52%; }
    90%  { border-radius: 48% 52% 30% 70% / 62% 38% 62% 38%; }
    100% { border-radius: 62% 38% 46% 54% / 60% 44% 56% 40%; }
}

/* Logo inside blob — bigger, fills the blob */
.eric-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.95;
    position: relative;
    z-index: 1;
    animation: eric-logo-float 12s ease-in-out infinite;
}

@keyframes eric-logo-float {
    0%, 100% { transform: scale(1)    rotate(-1deg); }
    25%       { transform: scale(1.05) rotate(1.5deg); }
    50%       { transform: scale(0.96) rotate(-0.5deg); }
    75%       { transform: scale(1.03) rotate(1deg); }
}

/* ============================================================
   CHAT PANEL — clean white/light mode
============================================================ */

.eric-panel {
    width: 340px;
    height: 480px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.04),
        0 20px 60px rgba(0,0,0,0.12),
        0 0 0 1px rgba(63,187,254,0.1);
    animation: eric-panel-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom right;
}

@keyframes eric-panel-in {
    from { opacity: 0; transform: scale(0.82) translateY(16px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* Header */
.eric-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
    background: linear-gradient(135deg, #f0f9ff 0%, #f5f0ff 100%);
}

.eric-panel-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eric-panel-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3fbbfe, #567eff);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: eric-morph 12s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(63,187,254,0.35);
}

.eric-panel-avatar img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.eric-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.eric-panel-subtitle {
    font-size: 11px;
    color: rgba(15,23,42,0.4);
    margin-top: 1px;
}

.eric-panel-close {
    background: none;
    border: none;
    color: rgba(15,23,42,0.3);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.15s, color 0.15s;
}

.eric-panel-close:hover {
    background: rgba(0,0,0,0.06);
    color: #0f172a;
}

/* Messages */
.eric-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.08) transparent;
    background: #fafafa;
}

.eric-messages::-webkit-scrollbar { width: 3px; }
.eric-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 99px; }

/* Welcome state — big dimmed logo, no blob */
.eric-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 16px;
    padding: 24px;
    text-align: center;
    color: rgba(15,23,42,0.45);
    font-size: 13.5px;
    line-height: 1.65;
}

.eric-welcome-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    opacity: 0.15;
    filter: saturate(0);
}

/* Message bubbles */
.eric-message {
    display: flex;
    max-width: 85%;
}

.eric-message-user   { align-self: flex-end;   margin-left: auto; }
.eric-message-assistant { align-self: flex-start; }

.eric-message-bubble {
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
}

.eric-message-user .eric-message-bubble {
    background: linear-gradient(135deg, #3fbbfe, #567eff);
    color: var(--text-bright);
    border-bottom-right-radius: 4px;
}

.eric-message-assistant .eric-message-bubble {
    background: var(--bg-primary);
    color: #1e293b;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0,0,0,0.07);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Thinking dots */
.eric-thinking {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
}

.eric-thinking span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(63,187,254,0.7);
    animation: eric-dot 1.2s ease-in-out infinite;
}

.eric-thinking span:nth-child(2) { animation-delay: 0.2s; }
.eric-thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes eric-dot {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.35; }
    40%            { transform: scale(1.1); opacity: 1;    }
}

/* Input row */
.eric-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
    background: var(--bg-primary);
}

.eric-input {
    flex: 1;
    background: #f1f5f9;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 12px;
    padding: 9px 13px;
    font-size: 13px;
    color: #0f172a;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.eric-input::placeholder { color: rgba(15,23,42,0.3); }

.eric-input:focus {
    border-color: rgba(63,187,254,0.5);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(63,187,254,0.1);
}

.eric-send {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: #f1f5f9;
    color: rgba(15,23,42,0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.eric-send.active {
    background: linear-gradient(135deg, #3fbbfe, #567eff);
    color: var(--text-bright);
    box-shadow: 0 2px 10px rgba(63,187,254,0.4);
}

.eric-send.active:hover {
    box-shadow: 0 4px 18px rgba(63,187,254,0.6);
    transform: scale(1.06);
}

.eric-send:disabled { cursor: default; }
