/* ============================================ */
/* CHATBOT WIDGET – PREMIUM PROFESSIONAL DESIGN */
/* ============================================ */

/* ============================================ */
/* MAIN CHATBOT CONTAINER                       */
/* ============================================ */

#chatbot-widget {
    position: fixed;
    bottom: 100px;
    left: 30px; /* Left side as user mentioned */
    z-index: 9999;
    font-family: var(--font-body);
}

/* ============================================ */
/* CHATBOT TOGGLE BUTTON                        */
/* ============================================ */

.chatbot-toggle-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
    border: 2px solid var(--color-gold);
    color: var(--color-navy);
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 0 60px rgba(228, 161, 27, 0.08);
    transition: var(--transition-medium);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Glow Ring Behind Button */
.chatbot-toggle-btn::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold), transparent, var(--color-gold));
    opacity: 0.2;
    z-index: -1;
    animation: toggleGlow 3s ease-in-out infinite;
}

@keyframes toggleGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.5;
    }
}

.chatbot-toggle-btn:hover {
    transform: scale(1.08) rotate(-5deg);
    border-color: var(--color-gold-hover);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.2), 0 0 80px rgba(228, 161, 27, 0.15);
}

.chatbot-toggle-btn i {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
    animation: iconBounce 3s ease-in-out infinite;
    color: var(--color-gold);
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Notification Badge */
.chatbot-notification {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-gold);
    color: var(--color-navy);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    border: 2px solid #FFFFFF;
    box-shadow: 0 4px 15px rgba(228, 161, 27, 0.4);
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* ============================================ */
/* CHATBOT WINDOW – IMPROVED GLASSY             */
/* ============================================ */

.chatbot-window {
    position: absolute;
    bottom: 85px;
    left: 0;
    width: 420px;
    max-width: calc(100vw - 40px);
    height: 560px;
    max-height: calc(100vh - 200px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Decorative Glass Glow */
.chatbot-window::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(228, 161, 27, 0.04), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Gold Border Accent on Top */
.chatbot-window::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    z-index: 2;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================ */
/* CHATBOT HEADER                               */
/* ============================================ */

.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-navy);
    font-size: 18px;
    box-shadow: 0 4px 20px rgba(228, 161, 27, 0.25);
    flex-shrink: 0;
}

.chatbot-header-info h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    color: var(--color-navy);
    margin: 0;
    line-height: 1.2;
}

.chatbot-header-info small {
    font-size: 12px;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-header-info small::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22C55E;
    display: inline-block;
    animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.chatbot-close-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--color-text-light);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.chatbot-close-btn:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.15);
    color: #DC2626;
    transform: rotate(90deg);
}

/* ============================================ */
/* CHATBOT MESSAGES AREA                        */
/* ============================================ */

.chatbot-messages {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
    scroll-behavior: smooth;
    background: rgba(255, 255, 255, 0.3);
}

/* Custom Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--color-gold);
    border-radius: var(--radius-full);
}

/* ============================================ */
/* INDIVIDUAL MESSAGES                          */
/* ============================================ */

.chatbot-message {
    max-width: 85%;
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Bot Message (Left) – Light Glassy */
.chatbot-message.bot {
    align-self: flex-start;
}

.chatbot-message.bot .chatbot-message-content {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    color: var(--color-text-body);
    padding: 12px 18px;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* User Message (Right) – Gold Premium */
.chatbot-message.user {
    align-self: flex-end;
}

.chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-hover));
    border: 1px solid rgba(228, 161, 27, 0.2);
    border-radius: var(--radius-md) 0 var(--radius-md) var(--radius-md);
    color: var(--color-navy);
    padding: 12px 18px;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(228, 161, 27, 0.15);
}

/* Message Time */
.chatbot-message-time {
    font-size: 10px;
    color: var(--color-text-light);
    margin-top: 4px;
    padding: 0 4px;
}

.chatbot-message.user .chatbot-message-time {
    text-align: right;
    color: rgba(11, 52, 114, 0.4);
}

/* ============================================ */
/* TYPING INDICATOR                             */
/* ============================================ */

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    align-self: flex-start;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-gold);
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.3;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ============================================ */
/* CHATBOT INPUT AREA                           */
/* ============================================ */

.chatbot-input-area {
    display: flex;
    gap: 10px;
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-input {
    flex: 1;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-full);
    color: var(--color-text-body);
    font-family: var(--font-body);
    font-size: 14px;
    transition: var(--transition-fast);
    outline: none;
}

.chatbot-input::placeholder {
    color: var(--color-text-light);
}

.chatbot-input:focus {
    border-color: var(--color-gold);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(228, 161, 27, 0.08);
}

.chatbot-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-hover));
    border: none;
    color: var(--color-navy);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(228, 161, 27, 0.2);
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(228, 161, 27, 0.35);
}

.chatbot-send-btn:active {
    transform: scale(0.92);
}

/* ============================================ */
/* QUICK REPLY BUTTONS                          */
/* ============================================ */

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 16px 8px;
    background: rgba(255, 255, 255, 0.15);
}

.quick-reply-btn {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--color-text-body);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-body);
    font-weight: 500;
}

.quick-reply-btn:hover {
    background: rgba(228, 161, 27, 0.15);
    border-color: var(--color-gold);
    color: var(--color-navy);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(228, 161, 27, 0.1);
}

.quick-reply-btn:active {
    transform: scale(0.95);
}

/* ============================================ */
/* RESPONSIVE – Tablet                         */
/* ============================================ */

@media (max-width: 991.98px) {
    #chatbot-widget {
        bottom: 90px;
        left: 20px;
    }
    
    .chatbot-toggle-btn {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .chatbot-window {
        width: 380px;
        height: 500px;
        bottom: 75px;
        left: 0;
    }
}

/* ============================================ */
/* RESPONSIVE – Mobile                         */
/* ============================================ */

@media (max-width: 575.98px) {
    #chatbot-widget {
        bottom: 80px;
        left: 15px;
    }
    
    .chatbot-toggle-btn {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
    
    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 160px);
        max-height: 500px;
        bottom: 70px;
        left: -5px;
        border-radius: var(--radius-md);
    }
    
    .chatbot-header {
        padding: 12px 16px;
    }
    
    .chatbot-avatar {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
    
    .chatbot-header-info h6 {
        font-size: 14px;
    }
    
    .chatbot-messages {
        padding: 12px 14px;
    }
    
    .chatbot-message.bot .chatbot-message-content,
    .chatbot-message.user .chatbot-message-content {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .chatbot-input-area {
        padding: 8px 12px 12px;
        gap: 8px;
    }
    
    .chatbot-input {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .chatbot-send-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    
    .quick-replies {
        padding: 4px 12px 6px;
        gap: 6px;
    }
    
    .quick-reply-btn {
        font-size: 11px;
        padding: 4px 12px;
    }
}

/* ============================================ */
/* REDUCED MOTION PREFERENCE                   */
/* ============================================ */

@media (prefers-reduced-motion: reduce) {
    .chatbot-toggle-btn::before {
        animation: none !important;
    }
    
    .chatbot-toggle-btn i {
        animation: none !important;
    }
    
    .chatbot-notification {
        animation: none !important;
    }
    
    .chatbot-window {
        animation: none !important;
    }
    
    .chatbot-message {
        animation: none !important;
    }
    
    .typing-indicator span {
        animation: none !important;
    }
    
    .chatbot-header-info small::before {
        animation: none !important;
    }
}