/* ============================================
   ARINAS MUSIC — AI CHATBOT WIDGET
   Premium glassmorphism chatbot UI
   ============================================ */

/* ------- Floating Trigger Button ------- */
#arinas-chatbot-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #f5b000, #ffda73);
    box-shadow: 0 6px 24px rgba(245, 176, 0, 0.45), 0 0 0 0 rgba(245, 176, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.35s ease;
    animation: chatPulseRing 3s ease-in-out infinite;
}

#arinas-chatbot-trigger:hover {
    transform: scale(1.12);
    box-shadow: 0 8px 32px rgba(245, 176, 0, 0.6);
}

#arinas-chatbot-trigger svg {
    width: 28px;
    height: 28px;
    fill: #000;
    transition: transform 0.3s ease;
}

#arinas-chatbot-trigger.active svg.chat-icon { display: none; }
#arinas-chatbot-trigger.active svg.close-icon { display: block; }
#arinas-chatbot-trigger svg.close-icon { display: none; }

@keyframes chatPulseRing {
    0%   { box-shadow: 0 6px 24px rgba(245,176,0,0.45), 0 0 0 0 rgba(245,176,0,0.35); }
    50%  { box-shadow: 0 6px 24px rgba(245,176,0,0.45), 0 0 0 12px rgba(245,176,0,0); }
    100% { box-shadow: 0 6px 24px rgba(245,176,0,0.45), 0 0 0 0 rgba(245,176,0,0); }
}

/* Unread badge */
#arinas-chatbot-trigger .unread-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #ff4757;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #050505;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

#arinas-chatbot-trigger .unread-badge.visible {
    opacity: 1;
    transform: scale(1);
}

/* ------- Chat Window ------- */
#arinas-chatbot {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 9999;
    width: 400px;
    max-height: 600px;
    height: 75vh;
    border-radius: 20px;
    background: rgba(12, 12, 12, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(245, 176, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;

    /* Entry animation */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
                transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#arinas-chatbot.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ------- Chat Header ------- */
.chatbot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.chatbot-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5b000, #ffda73);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    color: #000;
    flex-shrink: 0;
}

.chatbot-header-info {
    flex: 1;
}

.chatbot-header-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.chatbot-header-info span {
    font-size: 0.75rem;
    color: #27c93f;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-header-info span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #27c93f;
    border-radius: 50%;
    display: inline-block;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chatbot-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ------- Quick Actions ------- */
.chatbot-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px 8px;
    flex-shrink: 0;
}

.chatbot-quick-actions button {
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid rgba(245, 176, 0, 0.25);
    background: rgba(245, 176, 0, 0.08);
    color: #f5b000;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.chatbot-quick-actions button:hover {
    background: rgba(245, 176, 0, 0.18);
    border-color: rgba(245, 176, 0, 0.5);
    transform: translateY(-1px);
}

.chatbot-quick-actions button i {
    margin-right: 5px;
    font-size: 0.7rem;
}

/* ------- Messages Area ------- */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 176, 0, 0.2) transparent;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(245, 176, 0, 0.2);
    border-radius: 2px;
}

/* Message bubbles */
.chatbot-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
    animation: msgSlideIn 0.3s ease forwards;
}

.chatbot-msg.bot {
    align-self: flex-start;
}

.chatbot-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

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

.chatbot-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}

.chatbot-msg.bot .chatbot-msg-avatar {
    background: linear-gradient(135deg, #f5b000, #ffda73);
    color: #000;
}

.chatbot-msg.user .chatbot-msg-avatar {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.chatbot-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #e0e0e0;
}

.chatbot-msg.bot .chatbot-msg-bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top-left-radius: 4px;
}

.chatbot-msg.user .chatbot-msg-bubble {
    background: linear-gradient(135deg, rgba(245, 176, 0, 0.18), rgba(245, 176, 0, 0.08));
    border: 1px solid rgba(245, 176, 0, 0.15);
    border-top-right-radius: 4px;
    color: #fff;
}

.chatbot-msg-bubble a {
    color: #f5b000;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chatbot-msg-bubble a:hover {
    color: #ffda73;
}

/* Typing indicator */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    border-top-left-radius: 4px;
    width: fit-content;
}

.chatbot-typing span {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

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

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

/* ------- Input Area ------- */
.chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.chatbot-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: #fff;
    outline: none;
    font-family: 'Outfit', sans-serif;
    transition: border-color 0.2s ease;
}

.chatbot-input-area input::placeholder {
    color: #666;
}

.chatbot-input-area input:focus {
    border-color: rgba(245, 176, 0, 0.3);
}

.chatbot-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #f5b000, #ffda73);
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(245, 176, 0, 0.4);
}

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

.chatbot-send-btn svg {
    width: 18px;
    height: 18px;
}

/* ------- Powered-by footer ------- */
.chatbot-footer {
    text-align: center;
    padding: 6px 0 10px;
    font-size: 0.65rem;
    color: #555;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* ========= MOBILE RESPONSIVE ========= */
@media (max-width: 480px) {
    #arinas-chatbot {
        width: calc(100vw - 16px);
        height: calc(100vh - 90px);
        max-height: none;
        bottom: 80px;
        right: 8px;
        border-radius: 16px;
    }

    #arinas-chatbot-trigger {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }

    #arinas-chatbot-trigger svg {
        width: 24px;
        height: 24px;
    }

    .chatbot-quick-actions {
        padding: 10px 14px 6px;
    }

    .chatbot-quick-actions button {
        font-size: 0.72rem;
        padding: 6px 11px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    #arinas-chatbot {
        width: 360px;
        max-height: 70vh;
    }
}
