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

.etech-fab {
    width: 65px;
    height: 65px;
    /* SWAPPED: Brand Blue Gradient */
    background: linear-gradient(135deg, #1C4C9B 0%, #163d7a 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* SWAPPED: Blue Shadow */
    box-shadow: 0 10px 30px rgba(28, 76, 155, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: etech-pulse 2s infinite;
}

.etech-fab:hover {
    transform: scale(1.1) rotate(5deg);
}

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

@keyframes etech-pulse {
    /* SWAPPED: Blue Pulse */
    0% { box-shadow: 0 0 0 0 rgba(28, 76, 155, 0.6); }
    70% { box-shadow: 0 0 0 18px rgba(28, 76, 155, 0); }
    100% { box-shadow: 0 0 0 0 rgba(28, 76, 155, 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; /* Controlled by JS */
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header & Navigation */
#chat-header {
    /* SWAPPED: Official eTech Blue */
    background: #1C4C9B;
    color: white;
    padding: 20px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.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;
    /* SWAPPED: eTech Orange Status Indicator */
    background: #F39812;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(243, 152, 18, 0.2);
}

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

#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, #f8fafc, #ffffff);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.home-greeting h3 {
    font-size: 26px;
    margin: 0 0 10px;
    color: #1C4C9B; /* eTech Blue for titles */
}

.home-greeting p {
    color: #64748b;
    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 #e2e8f0;
    border-radius: 16px;
    background: white;
    color: #1C4C9B; /* Text in brand blue */
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    font-size: 14px;
    text-align: center;
    outline: none;
}

.action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.action-btn.primary {
    /* SWAPPED: Brand Orange for CTA */
    background: #F39812;
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(243, 152, 18, 0.3);
    margin-top: 8px;
}

.action-btn.primary:hover {
    background: #d98710;
}

/* --- 4. CONVERSATION VIEW --- */
#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fcfcfc;
}

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

.bot-msg {
    align-self: flex-start;
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.user-msg {
    align-self: flex-end;
    /* SWAPPED: Brand Blue */
    background: #1C4C9B;
    color: white;
    border-bottom-right-radius: 4px;
}

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

#chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 30px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

#chat-input:focus {
    /* SWAPPED: Brand Blue border on focus */
    border-color: #1C4C9B;
}

#chat-send {
    /* SWAPPED: Brand Blue button */
    background: #1C4C9B;
    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: #163d7a;
    transform: scale(1.05);
}

/* --- 6. MOBILE RESPONSIVENESS --- */
@media (max-width: 480px) {
    #modern-chatbot {
        width: 92vw;          /* Leaves a small gutter on left/right */
        height: 75vh;         /* Leaves the top 25% of the screen visible */
        bottom: 20px;         /* Floats above the bottom edge */
        right: 4vw;           /* Centers the widget */
        left: 4vw;
        border-radius: 20px;  /* Keeps the professional rounded look */
        max-height: 75vh;
        position: fixed;
        display: none;        /* Controlled by JS */
        flex-direction: column;
        transition: bottom 0.3s ease; /* Smooth move when keyboard appears */
    }

    /* Header adjustments for visibility */
    #chat-header {
        padding: 15px 15px;
        min-height: 60px;
    }

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

    /* Large touch targets for Back and Close */
    #chat-back, #minimize-chat {
        font-size: 26px !important;
        padding: 8px 12px;
        color: #ffffff;
        z-index: 1000001; /* Ensures they stay on top */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Prevent text overlapping on small screens */
    .home-greeting h3 {
        font-size: 20px;
    }
    
    .home-greeting p {
        font-size: 13px;
        margin-bottom: 20px;
    }

    /* Ensure buttons are easy to tap */
    .action-btn {
        padding: 12px;
        font-size: 13px;
    }

    /* Keep the FAB small and out of the way on mobile */
    .etech-fab {
        width: 55px;
        height: 55px;
    }
}