/* =========================================================================
   TEGHRA TECHNOLOGIES - CUSTOM AI CHATBOT WIDGET STYLING
   ========================================================================= */

:root {
    --gold: #F37021;          /* Maps to brand accent (orange) */
    --navy: #0A4D34;          /* Maps to brand primary (green) */
    --white: #ffffff;
    --border-color: #E2E8F0;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --shadow-gold: 0 8px 24px rgba(243, 112, 33, 0.4);
}

/* Global display utility helper for widget collapse */
.d-none {
    display: none !important;
}

.teghra-chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    font-family: var(--font-heading);
}

/* Chat bubble button style */
.teghra-chatbot-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--gold);
    color: var(--white);
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(244, 123, 0, 0.4);
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: chatWidgetFloat 3s ease-in-out infinite;
}

.teghra-chatbot-bubble i {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.teghra-chatbot-bubble:hover {
    background-color: var(--navy);
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 30px rgba(6, 42, 24, 0.5);
}

/* Pulsing effect around the bubble button */
.teghra-chatbot-bubble .bubble-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(243, 112, 33, 0.4); /* Transparent brand orange */
    top: 0;
    left: 0;
    z-index: -1;
    animation: chatWidgetPulse 2s infinite ease-out;
}

/* Chatbot Window Styling */
.teghra-chatbot-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    height: 520px;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: bottom right;
    animation: chatWindowSlideUp 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    border: 1px solid var(--border-color);
}

/* Window Header Styling */
.teghra-chatbot-header {
    background-color: var(--navy);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--gold);
}

.chatbot-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background-color: #10B981;
    border: 2px solid var(--navy);
    border-radius: 50%;
}

.chatbot-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--white) !important;
}

.chatbot-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    display: block;
}

/* Messages area styling */
.teghra-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Message Bubbles styling */
.chat-msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    font-family: var(--font-body);
}

.chat-msg.bot {
    background-color: var(--white);
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(6, 42, 24, 0.05);
}

.chat-msg.user {
    background-color: var(--navy);
    color: var(--white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg a {
    color: var(--gold);
    text-decoration: underline;
    font-weight: 600;
}

.chat-msg a:hover {
    color: var(--navy);
}

/* Typing indicator animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
    background-color: var(--white);
    align-self: flex-start;
    border-radius: var(--border-radius-md);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(6, 42, 24, 0.05);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Prompt suggestion chips styling */
.teghra-chatbot-prompts {
    padding: 10px 16px;
    background-color: #f8fafc;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.prompt-chip {
    background-color: var(--white);
    color: var(--navy);
    border: 1px solid rgba(6, 42, 24, 0.15);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12.5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    font-family: var(--font-heading);
}

.prompt-chip:hover {
    background-color: var(--gold);
    color: var(--white);
    border-color: var(--gold);
    transform: translateY(-1px);
    box-shadow: var(--shadow-gold);
}

/* Input Area Styling */
.teghra-chatbot-input-area {
    padding: 14px 20px;
    background: var(--white);
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.teghra-chatbot-input-area input {
    flex: 1;
    border: 1px solid #cbd5e1;
    outline: none;
    padding: 10px 16px;
    border-radius: 100px;
    font-size: 13.5px;
    transition: border-color 0.25s ease;
    font-family: var(--font-body);
}

.teghra-chatbot-input-area input:focus {
    border-color: var(--navy);
}

.teghra-chatbot-input-area button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--gold);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.teghra-chatbot-input-area button:hover {
    background-color: var(--navy);
    transform: scale(1.05);
}

.teghra-chatbot-input-area button i {
    font-size: 16px;
}

/* Scrollbar Customization for Messages Container */
.teghra-chatbot-messages::-webkit-scrollbar {
    width: 5px;
}
.teghra-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
.teghra-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 100px;
}

/* Keyframe Animations */
@keyframes chatWidgetFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes chatWidgetPulse {
    0% {
        transform: scale(1);
        opacity: 0.85;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes chatWindowSlideUp {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Mobile Responsive Adjustments */
@media (max-width: 480px) {
    .teghra-chatbot-container {
        bottom: 16px;
        right: 16px;
    }
    .teghra-chatbot-window {
        width: calc(100vw - 32px);
        height: 480px;
        bottom: 70px;
    }
}

/* Restart Chat Confirmation Style */
.restart-confirm-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.restart-confirm-btn {
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 14px;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
}

.restart-confirm-btn.yes {
    background-color: #dc3545;
    color: var(--white);
}

.restart-confirm-btn.yes:hover {
    background-color: #b02a37;
    transform: translateY(-1px);
}

.restart-confirm-btn.no {
    background-color: #e2e8f0;
    color: #1e293b;
}

.restart-confirm-btn.no:hover {
    background-color: #cbd5e1;
    transform: translateY(-1px);
}

/* =========================================================================
   ADDITIONAL INTERACTIVE COMPONENTS STYLING (Cards, Actions, WhatsApp CTA)
   ========================================================================= */

/* Visual cards for service selection during lead flow */
.service-cards-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
}

.service-card {
    background-color: var(--white);
    color: var(--navy);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 2px 4px rgba(6, 42, 24, 0.02);
    font-family: var(--font-heading);
    text-align: left;
    display: block;
    width: 100%;
}

.service-card:hover {
    background-color: var(--navy);
    color: var(--white);
    border-color: var(--navy);
    transform: translateX(4px);
    box-shadow: 0 4px 8px rgba(6, 42, 24, 0.1);
}

/* Quick action buttons row */
.chatbot-action-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    flex-wrap: wrap;
}

.chatbot-action-btn {
    flex: 1;
    min-width: 90px;
    text-align: center;
    padding: 8px 10px;
    font-size: 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--gold);
    color: var(--gold);
    background-color: var(--white);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-heading);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chatbot-action-btn:hover {
    background-color: var(--gold);
    color: var(--white) !important;
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-gold);
    text-decoration: none;
}

/* WhatsApp post-submit redirect button */
.chatbot-wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #25D366;
    color: var(--white) !important;
    font-weight: 700;
    padding: 10px 16px;
    font-size: 13.5px;
    border-radius: var(--border-radius-sm);
    margin-top: 10px;
    text-decoration: none;
    transition: all 0.25s ease-in-out;
    border: none;
    font-family: var(--font-heading);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
}

.chatbot-wa-btn:hover {
    background-color: #1ebe54;
    transform: translateY(-1.5px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
    text-decoration: none;
}
