/**
 * Zoé Chatbot — MySongOriginal Design System
 * Primary: Sage #7d9a78 | Forest #3d5a3d | Terracotta #c67b5c | Cream #faf8f5 | Sand #e8e2d9
 * Fonts: Cormorant Garamond (display) + Outfit (body)
 */

:root {
    --zoe-sage: #7d9a78;
    --zoe-sage-dark: #5f7e5a;
    --zoe-forest: #3d5a3d;
    --zoe-terracotta: #c67b5c;
    --zoe-cream: #faf8f5;
    --zoe-sand: #e8e2d9;
    --zoe-white: #ffffff;
    --zoe-text: #2d2d2d;
    --zoe-text-light: #6b6b6b;
    --zoe-light-sage: #a8c4a2;
    --zoe-shadow: 0 8px 32px rgba(125, 154, 120, 0.18);
    --zoe-shadow-light: 0 2px 12px rgba(125, 154, 120, 0.10);
    --zoe-radius: 12px;
    --zoe-radius-sm: 8px;
}

/* ═══ CHATBOT MODAL ═══ */

.zoe-modal {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    animation: zoe-slide-up 0.3s ease;
}

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

.zoe-modal-content {
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 100px);
    background: var(--zoe-white);
    border-radius: 16px;
    box-shadow: var(--zoe-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--zoe-sand);
}

.zoe-chat-header {
    background: var(--zoe-sage);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

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

.zoe-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

.zoe-avatar-circle-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--zoe-sage);
}

.zoe-avatar-circle-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

.zoe-chat-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--zoe-cream);
    display: block;
    line-height: 1.2;
}

.zoe-chat-role {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    color: var(--zoe-light-sage);
    display: block;
}

.zoe-close-btn {
    background: none;
    border: none;
    color: var(--zoe-cream);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.zoe-close-btn:hover {
    opacity: 1;
}

/* Messages area */
.zoe-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--zoe-cream);
}

.zoe-messages::-webkit-scrollbar {
    width: 4px;
}

.zoe-messages::-webkit-scrollbar-thumb {
    background: var(--zoe-sand);
    border-radius: 4px;
}

.zoe-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    animation: zoe-msg-in 0.2s ease;
}

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

.zoe-msg-assistant {
    background: var(--zoe-white);
    color: var(--zoe-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--zoe-sand);
}

.zoe-msg-user {
    background: var(--zoe-sage);
    color: var(--zoe-cream);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.zoe-typing {
    display: flex;
    gap: 4px;
    padding: 8px 14px;
    align-self: flex-start;
}

.zoe-typing span {
    width: 7px;
    height: 7px;
    background: var(--zoe-sage);
    border-radius: 50%;
    animation: zoe-bounce 1.4s infinite;
}

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

@keyframes zoe-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Input area */
.zoe-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--zoe-sand);
    background: var(--zoe-white);
    flex-shrink: 0;
}

.zoe-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.zoe-input {
    flex: 1;
    border: 1px solid var(--zoe-sand);
    border-radius: 20px;
    padding: 10px 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: var(--zoe-text);
    background: var(--zoe-cream);
    outline: none;
    transition: border-color 0.2s;
}

.zoe-input:focus {
    border-color: var(--zoe-sage);
}

.zoe-input::placeholder {
    color: var(--zoe-text-light);
}

.zoe-send-btn {
    background: var(--zoe-sage);
    color: var(--zoe-cream);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.zoe-send-btn:hover {
    background: var(--zoe-sage-dark);
    transform: scale(1.05);
}

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

/* ═══ FAB (Floating Action Button) ═══ */

.zoe-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99998;
    background: var(--zoe-sage);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--zoe-shadow);
    transition: all 0.3s ease;
    padding: 0;
    overflow: hidden;
}

.zoe-fab img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.zoe-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 40px rgba(125, 154, 120, 0.3);
}

.zoe-fab.zoe-fab-hidden {
    display: none;
}

/* ═══ FOOTER LINK ═══ */

.zoe-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--zoe-sage) !important;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    text-decoration: none !important;
    transition: color 0.2s;
}

.zoe-footer-link:hover {
    color: var(--zoe-sage-dark) !important;
}

.zoe-footer-link img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* ═══ RESPONSIVE ═══ */

@media (max-width: 768px) {
    .zoe-modal {
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0;
    }

    .zoe-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
    }

    .zoe-chat-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .zoe-messages {
        flex: 1;
        min-height: 0;
        padding: 12px;
    }

    .zoe-chat-input-area {
        position: sticky;
        bottom: 0;
        z-index: 2;
        padding: 10px 12px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        background: var(--zoe-white);
    }

    .zoe-fab {
        bottom: 16px;
        right: 16px;
    }
}
