/* ------------------------------------------------------
   MAGIC AI CHAT WIDGET — CLEAN, SAFE, MOBILE FRIENDLY
-------------------------------------------------------*/

/* ------------------------------------------------------
   LAUNCHER BUTTON
-------------------------------------------------------*/
#magicsai-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 100px;
    height: 100px;
    background: #2874fc;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: background 0.25s ease;
    z-index: 999999;
}

/* Hover effect: circle turns black */
#magicsai-launcher:hover {
    background: #000;
}

#magicsai-launcher img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}



/* ------------------------------------------------------
   CHAT WINDOW
-------------------------------------------------------*/
#magicsai-window {
    position: fixed;
    bottom: 110px;
    right: 24px;
    width: 360px;
    height: 480px;
    background: #111;
    color: #fff;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    z-index: 1000000;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}



/* ------------------------------------------------------
   HEADER
-------------------------------------------------------*/
#magicsai-header {
    padding: 10px;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
}

#magicsai-header img.magicsai-header-logo {
    height: 48px;
    margin-right: 8px;
}

.magicsai-title {
    flex-grow: 1;
    font-weight: bold;
}

#magicsai-close {
    cursor: pointer;
}



/* ------------------------------------------------------
   MESSAGE AREA WITH SCROLLBAR
-------------------------------------------------------*/
#magicsai-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;

    /* Simple scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #2874fc #222;

    /* Smooth scroll on mobile */
    -webkit-overflow-scrolling: touch;
}

/* Chrome scrollbar styling */
#magicsai-messages::-webkit-scrollbar {
    width: 8px;
}
#magicsai-messages::-webkit-scrollbar-track {
    background: #222;
    border-radius: 4px;
}
#magicsai-messages::-webkit-scrollbar-thumb {
    background-color: #2874fc;
    border-radius: 4px;
}



/* ------------------------------------------------------
   INPUT AREA
-------------------------------------------------------*/
#magicsai-input-area {
    padding: 10px;
    display: flex;
    gap: 6px;
}

#magicsai-input {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #222;
    color: #fff;

    /* ?? MOBILE SAFE FONT SIZE: prevents zoom-in on tap */
    font-size: 16px !important;
}

#magicsai-send {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: #2874fc;
    color: #fff;
    cursor: pointer;

    /* prevent button text zoom issues */
    font-size: 16px !important;
}



/* ------------------------------------------------------
   MESSAGE BUBBLES
-------------------------------------------------------*/
.magicsai-msg-user {
    background: #2874fc;
    color: #fff;
    margin: 4px 0;
    padding: 6px 8px;
    border-radius: 8px;
    align-self: flex-end;
    max-width: 75%;

    /* ensure Elementor doesn't apply tiny font on mobile */
    font-size: 16px;
}

.magicsai-msg-bot {
    background: #333;
    color: #fff;
    margin: 4px 0;
    padding: 6px 8px;
    border-radius: 8px;
    align-self: flex-start;
    max-width: 75%;
    font-size: 16px;
}



/* ------------------------------------------------------
   MOBILE FRIENDLY BEHAVIOR
-------------------------------------------------------*/
@media (max-width: 600px) {

    #magicsai-launcher {
        width: 75px;
        height: 75px;
        bottom: 16px;
        right: 16px;
    }

    #magicsai-launcher img {
        width: 75%;
        height: 75%;
    }

    #magicsai-window {
        width: 90%;
        height: 70%;
        bottom: 95px;
        right: 5%;
        left: 5%;
    }
}



/* ------------------------------------------------------
   MESSAGE BUBBLES
-------------------------------------------------------*/
.magicsai-msg-user {
    background: #2874fc;
    color: #fff;
    margin: 4px 0;
    padding: 6px 8px;
    border-radius: 8px;
    align-self: flex-end;
    max-width: 75%;

    /* ensure Elementor doesn't apply tiny font on mobile */
    font-size: 16px;
}

.magicsai-msg-bot {
    background: #333;
    color: #fff;
    margin: 4px 0;
    padding: 6px 8px;
    border-radius: 8px;
    align-self: flex-start;
    max-width: 75%;
    font-size: 16px;
}



/* ------------------------------------------------------
   MOBILE FRIENDLY BEHAVIOR
-------------------------------------------------------*/
@media (max-width: 600px) {

    #magicsai-launcher {
        width: 75px;
        height: 75px;
        bottom: 16px;
        right: 16px;
    }

    #magicsai-launcher img {
        width: 75%;
        height: 75%;
    }

    #magicsai-window {
        width: 90%;
        height: 70%;
        bottom: 95px;
        right: 5%;
        left: 5%;
    }
}
