/* -------------------------------------------------------------
   MAGIC AI CHAT WIDGET — DARK MODE + FROSTED GLASS STYLE
-------------------------------------------------------------- */

/* Launcher Icon */
#magicsai-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 84px;   /* Bigger circle */
    height: 84px;  /* Bigger circle */
    background: rgba(40, 116, 252, 0.95);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease;
}

#magicsai-launcher:hover {
    transform: scale(1.07);
}

#magicsai-launcher img {
    width: 80%;    /* Icon fills ~80% of circle */
    height: 80%;
    object-fit: contain;
}

/* Chat Window Wrapper */
#magicsai-window {
    position: fixed;
    bottom: 110px;
    right: 24px;
    width: 360px;
    height: 560px;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: rgba(15, 15, 15, 0.75);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    z-index: 1000000;
    opacity: 1;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}

/* Hidden state (start here) */
.magicsai-hidden {
    opacity: 0;
    pointer-events: none !important;
    transform: translateY(40px);
}

/* Header */
#magicsai-header {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.55);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 10px;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

#magicsai-header img.magicsai-header-logo {
    height: 32px;
    margin-right: 10px;
}

.magicsai-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    flex-grow: 1;
}

#magicsai-close {
    font-size: 22px;
    color: #ffffff;
    cursor: pointer;
    padding: 0 8px;
    transition: 0.2s;
}

#magicsai-close:hover {
    color: rgb(252,185,0);
}

/* Messages Area */
#magicsai-messages {
    flex-grow: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* User Message */
.magicsai-msg-user {
    align-self: flex-end;
    background: rgb(40,116,252);
    padding: 10px 14px;
    max-width: 75%;
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    line-height: 1.4;
}

/* Bot Message */
.magicsai-msg-bot {
    align-self: flex-start;
    background: rgba(255,255,255,0.08);
    padding: 10px 14px;
    max-width: 75%;
    border-radius: 14px;
    color: #f0f0f0;
    font-size: 15px;
    line-height: 1.4;
    border-left: 3px solid rgb(252,185,0);
}

/* Input Area */
#magicsai-input-area {
    padding: 10px;
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.5);
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}

#magicsai-input {
    flex-grow: 1;
    padding: 10px;
    border-radius: 12px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
}

#magicsai-input::placeholder {
    color: rgba(255,255,255,0.6);
}

#magicsai-input:focus {
    outline: 2px solid rgb(40,116,252);
}

#magicsai-send {
    background: rgb(40,116,252);
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: 500;
}

#magicsai-send:hover {
    background: rgba(40,116,252,0.85);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    #magicsai-window {
        width: 92%;
        height: 70%;
        right: 4%;
        bottom: 90px;
    }
}
