/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */


.loader {
    position: fixed; /* Changed from absolute to fixed */
    left: 50%;
    top: 50%; /* Center vertically */
    transform: translate(-50%, -50%); /* Perfect centering */
    z-index: 1;
    border: 6px solid #F3F3F3;
    border-radius: 50%;
    border-top: 6px solid #005fe1;
    width: 68px;
    height: 68px;
    -webkit-animation: spin 2s linear infinite;
    animation: spin 2s linear infinite;
}
.loader_name {
    position: fixed;
    left: 52%;
    top: 60%;
    transform: translate(-50%, -50%);
    z-index: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}
.bg_loader {
    background: #f0f5f9;
    opacity: 0.4;
    pointer-events: none;
}
.bg_sensor_loader, .bg_loader_new {
    background: #fff;
    opacity: 0.6;
    pointer-events: none;
}
#univeral-search-loader {
    position: absolute;
    left: 50%;
    top: -40%;
    z-index: 1;
    margin: 34px 0 0 -75px;
    border: 6px solid #F3F3F3;
    border-radius: 50%;
    border-top: 6px solid #3498DB;
    width: 68px;
    height: 68px;
    -webkit-animation: spin 2s linear infinite;
    animation: spin 2s linear infinite;
}
.loader_rt {
    position: absolute;
    left: 50%;
    bottom: 20%;
    z-index: 1;
    margin: 96px 0 0 -75px;
    border: 5px solid #F3F3F3;
    border-radius: 50%;
    border-top: 5px solid #005fe1;
    width: 50px;
    height: 50px;
    -webkit-animation: spin 2s linear infinite;
    animation: spin 2s linear infinite;
}
.alert-common {
    top: 2%;
    width: 60%;
    left: 20%;
}
/* Advanced Brain Modal CSS */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600&display=swap');

:root {
    --brain-primary: #4c327b;
    --brain-secondary: #dd4196;
    --brain-gradient: linear-gradient(135deg, #2c339b, #dd4196);
    --brain-bg: #ffffff;
    --brain-message-user: #e3f2fd;
    --brain-message-bot: #f3f4f6;
    --brain-text-color: #333;
    --brain-radius: 12px;
    --brain-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#askBtn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: url(/assets/cloud-button.png) no-repeat center center;
    background-size: 100% 100%;
    color: white;
    border: none;
    width: 130px;
    height: 70px;
    font-weight: 700;
    cursor: pointer;
    z-index: 1060;
    font-size: 15px;
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    font-family: 'Lexend', sans-serif;
    box-shadow: none;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

#askBtn span {
    position: relative;
    z-index: 2;
}

#askBtn:hover {
    transform: translateY(-2px);
}

#askBtn.slide-in {
    animation: slideInRight 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#chatbox {
    position: fixed;
    bottom: 0;
    right: -500px;
    width: 500px;
    height: calc(72vh - 20px);
    background-color: var(--brain-bg);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    font-family: 'Lexend', sans-serif;
    border-radius: 12px 0 0 0;
    overflow: hidden;
}

#chatbox.open {
    right: 0;
}

.chat-header {
    background: var(--brain-gradient);
    padding: 19px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-title span {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.close-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.close-btn::before,
.close-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
}

.close-btn::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-btn::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.close-btn:hover {
    background: white;
    border-color: white;
    color: var(--brain-primary);
    transform: rotate(90deg) scale(1.1);
}

#messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8faff;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

#messages::-webkit-scrollbar {
    width: 6px;
}

#messages::-webkit-scrollbar-track {
    background: transparent;
}

#messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.message-wrapper {
    display: flex;
    max-width: 96%;
    align-items: center;
    animation: fadeIn 0.3s ease;
    gap: 8px;
}

.message-wrapper.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-wrapper.bot {
    margin-right: 2%;
    margin-left: 2%;
}

.message-bubble {
    font-size: 14.5px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message-wrapper.user .message-bubble {
    background-color: #e9e9e980;
    color: #0d0d0d;
    border-bottom-right-radius: 4px;
    border-radius: 18px;
    padding: 10px 12px;
}

/* Analyzing Text */
.analyzing-text {
    font-size: 14px;
    color: #666;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Area */
.input-section {
    padding: 20px;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-container {
    flex: 1;
    position: relative;
    background: #f3f4f6;
    border-radius: 25px;
    padding: 5px 15px;
    transition: background 0.2s;
}

.input-container:focus-within {
    background: white;
    box-shadow: 0 0 0 2px rgba(44, 51, 155, 0.1);
}

input[type="text"]#userInput {
    width: 100%;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: var(--brain-text-color);
}

button.sendBtn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--brain-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

button.sendBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(221, 65, 150, 0.3);
}

button.sendBtn svg {
    width: 20px;
    height: 20px;
    transform: rotate(45deg);
    margin-right: 6px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #chatbox {
        margin-right: 6px;
        width: 97%;
        right: -100%;
        top: 80px;
        height: calc(100vh - 135px);
        border-radius: 5px;
    }

    .message-bubble {
        font-size: 13px;
        padding: 6px 8px;
    }

    #askBtn {
        bottom: 20px;
        right: 20px;
        width: 100px;
        height: 55px;
        font-size: 13px;
        padding-top: 14px;
    }

    .chat-header-title span {
        font-size: 15px;
    }

    .chat-header {
        padding: 10px 15px;
    }

    .chat-header-title img {
        height: 24px;
    }

    .message-wrapper {
        max-width: 98%;
    }


    .input-section {
        padding: 10px;
    }

    .input-container {
        padding: 2px 10px;
    }

    input[type="text"]#userInput {
        height: 32px;
        font-size: 13px;
    }

    button.sendBtn {
        width: 36px;
        height: 36px;
    }

    button.sendBtn svg {
        width: 16px;
        height: 16px;
    }

    body.brain-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 94;
        pointer-events: none;
    }
}
