/* Chatbot Widget Styles for MK Dreza Cabling Services */
/* Clean Structure & Modern Glassmorphism Design */

:root {
    /* MK Dreza Brand Colors */
    --cb-primary: #E00000;
    --cb-primary-dark: #B30000;
    --cb-primary-alpha: rgba(224, 0, 0, 0.8);
    --cb-primary-glow: rgba(224, 0, 0, 0.6);
    
    /* Glassmorphism Backgrounds */
    --cb-bg-base: rgba(0, 0, 20, 0.7);
    --cb-bg-input: rgba(0, 10, 25, 0.5);
    --cb-bg-bot-msg: rgba(255, 255, 255, 0.1);
    --cb-bg-hover: rgba(255, 255, 255, 0.2);
    
    /* Text & Borders */
    --cb-text-main: #ffffff;
    --cb-text-muted: rgba(255, 255, 255, 0.7);
    --cb-text-highlight: #ff3333;
    --cb-border: rgba(255, 255, 255, 0.1);
    
    /* Layout & Z-Index */
    --cb-z-toggle: 10000;
    --cb-z-container: 10001;
    --cb-radius-lg: 15px;
    --cb-radius-md: 5px;
}

/* --- Floating Toggle Button --- */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--cb-primary-alpha);
    backdrop-filter: blur(10px);
    border: 1px solid var(--cb-border);
    border-radius: 50%;
    cursor: pointer;
    z-index: var(--cb-z-toggle);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cb-text-main);
    font-size: 24px;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    background: var(--cb-primary);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.chatbot-toggle.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px var(--cb-primary-glow);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

/* --- Chat Container --- */
.chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: var(--cb-bg-base);
    backdrop-filter: blur(12px);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: var(--cb-z-container);
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.chatbot-container.active {
    transform: scale(1);
    opacity: 1;
}

/* --- Header --- */
.chatbot-header {
    background: var(--cb-primary-alpha);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--cb-text-main);
    border-bottom: 1px solid var(--cb-border);
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-title-icon {
    width: 30px;
    height: 30px;
    background: var(--cb-bg-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.chatbot-title-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-title-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--cb-text-main);
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: var(--cb-bg-hover);
}

/* --- Messages Area --- */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: rgba(0, 5, 15, 0.6);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: var(--cb-bg-bot-msg);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--cb-primary-glow);
    border-radius: 3px;
}

/* --- Message Bubbles --- */
.chatbot-message {
    max-width: 85%;
    padding: 12px 15px;
    border-radius: var(--cb-radius-lg);
    line-height: 1.4;
    font-size: 14px;
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    align-self: flex-end;
    background: var(--cb-primary-alpha);
    color: var(--cb-text-main);
    border-bottom-right-radius: var(--cb-radius-md);
}

.chatbot-message.bot {
    align-self: flex-start;
    background: var(--cb-bg-bot-msg);
    color: var(--cb-text-main);
    border: 1px solid var(--cb-border);
    border-bottom-left-radius: var(--cb-radius-md);
}

.chatbot-message strong {
    color: var(--cb-text-highlight);
}

.chatbot-link {
    color: var(--cb-primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dotted var(--cb-primary);
    transition: color 0.2s;
}

.chatbot-link:hover {
    color: var(--cb-primary-dark);
}

.chatbot-link.btn-chatbot-primary {
    background: var(--cb-primary-alpha);
    color: var(--cb-text-main) !important;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 8px;
    border: none;
    text-decoration: none;
}

.service-recommendations {
    margin-top: 10px;
    padding: 10px;
    background: rgba(224, 0, 0, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--cb-primary);
}

.service-recommendations ul {
    margin: 5px 0;
    padding-left: 20px;
}

.service-recommendations li {
    margin-bottom: 5px;
    color: #ffd700;
}

/* --- Input Area --- */
.chatbot-input-container {
    padding: 15px;
    background: var(--cb-bg-input);
    border-top: 1px solid var(--cb-border);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    background: var(--cb-bg-bot-msg);
    border: 1px solid var(--cb-border);
    border-radius: 25px;
    padding: 10px 15px;
    color: var(--cb-text-main);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input::placeholder {
    color: var(--cb-text-muted);
}

.chatbot-input:focus {
    border-color: var(--cb-primary-glow);
}

.chatbot-send {
    background: var(--cb-primary-alpha);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--cb-text-main);
}

.chatbot-send:hover {
    background: var(--cb-primary);
    transform: scale(1.05);
}

.chatbot-loading {
    display: inline-block;
    font-size: 12px;
    color: var(--cb-text-muted);
}

.chatbot-typing {
    animation: typing 1.5s infinite;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
    .chatbot-container {
        width: 90vw;
        right: 5vw;
        left: 5vw;
        bottom: 80px;
        height: 60vh;
    }

    .chatbot-toggle {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* --- Additional Indicators & Utilities --- */
.chatbot-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 12px;
    background: var(--cb-bg-bot-msg);
    border-radius: 12px;
    align-self: flex-start;
    animation: messageAppear 0.3s ease;
}

.chatbot-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cb-primary-alpha);
    display: inline-block;
    animation: typingDot 1.4s infinite;
}

.chatbot-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Welcome message styling */
.chatbot-welcome {
    background: rgba(224, 0, 0, 0.1);
    border: 1px solid rgba(224, 0, 0, 0.3);
    color: var(--cb-text-main);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chatbot-quick-reply {
    background: rgba(224, 0, 0, 0.2);
    border: 1px solid rgba(224, 0, 0, 0.4);
    color: var(--cb-text-highlight);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-quick-reply:hover {
    background: rgba(224, 0, 0, 0.3);
    transform: translateY(-1px);
}