/* --- CSS VARIABLES FOR MVM BRANDING --- */
:root {
    --mvm-blue: #224177;
    --mvm-navy: #1a2235;         /* Deep navy from hero sections */
    --mvm-navy-dark: #111624;    /* Darker navy for gradients/hover */
    --mvm-orange: #f27c38;       /* Vibrant accent orange */
    --mvm-orange-hover: #da682a; /* Darker orange for hover states */
    --mvm-light-bg: #f4f6f9;     /* Light background for chat area */
    --mvm-border: #e2e8f0;       /* Soft structural borders */
    --mvm-text-dark: #2d3748;    /* High readability dark text */
}

/* --- 1. FLOATING ACTION BUTTON (FAB) --- */
.mvm-fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mvm-fab {
    width: 65px;
    height: 65px;
    /* Blended gradient using MVM Orange and Navy[cite: 8] */
    background: linear-gradient(135deg, var(--mvm-orange) 0%, var(--mvm-blue) 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(26, 34, 53, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: mvm-pulse 2s infinite;
}

.mvm-fab:hover {
    transform: scale(1.1) rotate(5deg);
    /* Flips the gradient direction on hover for a dynamic effect */
    background: linear-gradient(135deg, var(--mvm-blue) 0%, var(--mvm-orange) 100%);
}

.mvm-fab .chat-icon {
    font-size: 30px;
    color: white;
}

@keyframes mvm-pulse {
    0% { box-shadow: 0 0 0 0 rgba(26, 34, 53, 0.6); }
    70% { box-shadow: 0 0 0 18px rgba(26, 34, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 34, 53, 0); }
}

/* --- 2. MAIN CHAT WINDOW --- */
#modern-chatbot {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: 85vh;
    border-radius: 24px;
    background: white;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 1000000;
    overflow: hidden;
    display: none;
    flex-direction: column;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header & Navigation */
#chat-header {
    background: var(--mvm-navy); /* MVM Navy */
    color: white;
    padding: 20px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-bottom: 3px solid var(--mvm-orange); /* Orange accent tie-in */
}

.header-left {
    display: flex;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.status-dot {
    height: 9px;
    width: 9px;
    background: var(--mvm-orange); /* MVM Orange */
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(242, 124, 56, 0.2);
}

#chat-back {
    font-size: 20px;
    padding-right: 12px;
    transition: transform 0.2s;
    cursor: pointer;
}

#chat-back:hover {
    transform: translateX(-3px);
}

/* --- 3. SCREENS --- */
#chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

/* Home Screen */
#chat-home {
    padding: 40px 25px;
    text-align: center;
    background: linear-gradient(to bottom, var(--mvm-light-bg), #ffffff);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.home-greeting h3 {
    font-size: 26px;
    margin: 0 0 10px;
    color: var(--mvm-navy); /* MVM Navy */
}

.home-greeting p {
    color: var(--mvm-text-dark);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 35px;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    padding: 15px;
    border: 1px solid var(--mvm-border);
    border-radius: 50px; /* Updated to pill shape matching MVM site buttons */
    background: white;
    color: var(--mvm-navy);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    font-size: 14px;
    text-align: center;
    outline: none;
}

.action-btn:hover {
    background: var(--mvm-light-bg);
    border-color: var(--mvm-navy);
    transform: translateY(-2px);
}

.action-btn.primary {
    /* Blended gradient using MVM Orange and Navy */
    background: linear-gradient(135deg, var(--mvm-orange) 0%, var(--mvm-blue) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(242, 124, 56, 0.3);
    margin-top: 8px;
    transition: all 0.3s ease; /* Ensures smooth transition for the gradient and hover lift */
}

.action-btn.primary:hover {
    /* Flips the gradient direction on hover */
    background: linear-gradient(135deg, var(--mvm-blue) 0%, var(--mvm-orange) 100%);
    transform: translateY(-2px); 
}

/* --- 4. CONVERSATION VIEW --- */
#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--mvm-light-bg); /* Match site contrast */
}

.chat-message {
    max-width: 82%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

/* Styled like the white solution cards on the homepage */
.bot-msg {
    align-self: flex-start;
    background: #ffffff;
    color: var(--mvm-text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid var(--mvm-border);
}

/* Styled with the accent orange */
.user-msg {
    align-self: flex-end;
    background: var(--mvm-orange);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(242, 124, 56, 0.2);
}

/* --- 5. INPUT AREA --- */
#chat-input-container {
    padding: 18px;
    border-top: 1px solid var(--mvm-border);
    display: flex;
    gap: 12px;
    background: white;
}

#chat-input {
    flex: 1;
    border: 1px solid var(--mvm-border);
    padding: 12px 20px;
    border-radius: 50px; /* Pill shape */
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
    color: var(--mvm-text-dark);
}

#chat-input:focus {
    border-color: var(--mvm-navy);
}

#chat-send {
    background: var(--mvm-navy);
    color: white;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
}

#chat-send:hover {
    background: var(--mvm-orange);
    transform: scale(1.05);
}

/* --- 6. MOBILE RESPONSIVENESS --- */
@media (max-width: 480px) {
    #modern-chatbot {
        width: 92vw;
        height: 75vh;
        bottom: 20px;
        right: 4vw;
        left: 4vw;
        border-radius: 20px;
        max-height: 75vh;
        position: fixed;
        display: none;
        flex-direction: column;
        transition: bottom 0.3s ease;
    }

    #chat-header {
        padding: 15px 15px;
        min-height: 60px;
    }

    .header-info {
        font-size: 14px;
    }

    #chat-back, #minimize-chat {
        font-size: 26px !important;
        padding: 8px 12px;
        color: #ffffff;
        z-index: 1000001;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .home-greeting h3 {
        font-size: 20px;
    }
    
    .home-greeting p {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .action-btn {
        padding: 12px;
        font-size: 13px;
    }

    .mvm-fab {
        width: 55px;
        height: 55px;
    }
}