/* =====================================================
   InfoBot Widget Styles
   ===================================================== */

:root {
    --infobot-primary: #1e88e5;
    --infobot-secondary: #42a5f5;
    --infobot-dark: #0d47a1;
    --infobot-text: #333;
    --infobot-light-bg: #f5f5f5;
}

/* Floating Icon */
.infobot-float-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--infobot-primary) 0%, var(--infobot-secondary) 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(30, 136, 229, 0.4);
    display: flex !important; /* Force display */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999 !important; /* Higher than reCAPTCHA (z-index: 1000) */
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    opacity: 1 !important;
    visibility: visible !important;
}

.infobot-float-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(30, 136, 229, 0.6);
}

.infobot-float-icon i {
    color: white;
    font-size: 28px;
}

.infobot-float-icon.hidden {
    display: none !important;
}

/* Notification Badge */
.infobot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 1;
    display: block !important;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(30, 136, 229, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(30, 136, 229, 0.7);
    }
}

/* Chat Window */
.infobot-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 100000 !important; /* Higher than floating icon */
    overflow: hidden;
    transition: all 0.3s ease;
}

.infobot-chat-window.hidden {
    display: none;
}

.infobot-chat-window.minimized {
    height: 60px;
    overflow: hidden;
}

/* Chat Header */
.infobot-chat-header {
    background: linear-gradient(135deg, var(--infobot-primary) 0%, var(--infobot-dark) 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.infobot-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.infobot-chat-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.15) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
    border: 2px solid rgba(255,255,255,0.4);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: iconPulse 3s infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.infobot-chat-avatar i {
    font-size: 24px;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.infobot-chat-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}

.infobot-chat-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.95;
    font-weight: 400;
}

.infobot-chat-actions {
    display: flex;
    gap: 8px;
}

.infobot-chat-actions button {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    cursor: pointer;
    padding: 8px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 14px;
}

.infobot-chat-actions button:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
    border-color: rgba(255,255,255,0.5);
}

/* User Session Info Bar */
.infobot-user-session {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-bottom: 2px solid var(--infobot-primary);
    padding: 10px 15px;
    display: none;
}

.infobot-session-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--infobot-text);
}

.infobot-session-info i {
    color: var(--infobot-primary);
    margin-right: 5px;
}

.infobot-edit-btn {
    background: var(--infobot-primary);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s;
}

.infobot-edit-btn:hover {
    background: var(--infobot-dark);
    transform: scale(1.05);
}

.infobot-edit-btn i {
    color: white;
    margin-right: 3px;
}

/* Chat Body */
.infobot-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

.infobot-message {
    margin-bottom: 15px;
    display: flex;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.infobot-message.bot {
    justify-content: flex-start;
}

.infobot-message.user {
    justify-content: flex-end;
}

.infobot-message-bubble {
    max-width: 75%;
    padding: 12px 15px;
    border-radius: 15px;
    word-wrap: break-word;
}

.infobot-message.bot .infobot-message-bubble {
    background: white;
    color: var(--infobot-text);
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.infobot-message.user .infobot-message-bubble {
    background: linear-gradient(135deg, var(--infobot-primary) 0%, var(--infobot-secondary) 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.infobot-message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 5px;
}

/* Typing Indicator */
.infobot-typing {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 15px;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.infobot-typing span {
    width: 8px;
    height: 8px;
    background: var(--infobot-primary);
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.infobot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.infobot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Footer / Input */
.infobot-chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.infobot-input-group {
    display: flex;
    gap: 10px;
}

.infobot-input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s;
}

.infobot-input-group input:focus {
    border-color: var(--infobot-primary);
}

.infobot-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--infobot-primary) 0%, var(--infobot-secondary) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.infobot-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.5);
}

.infobot-send-btn:active {
    transform: scale(0.95);
}

.infobot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Quick Replies */
.infobot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.infobot-quick-reply {
    padding: 8px 15px;
    background: white;
    border: 1px solid var(--infobot-primary);
    color: var(--infobot-primary);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.infobot-quick-reply:hover {
    background: var(--infobot-primary);
    color: white;
}

/* Form Elements in Chat */
.infobot-form-field {
    margin-bottom: 15px;
}

.infobot-form-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--infobot-text);
}

.infobot-form-field input,
.infobot-form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.infobot-form-field input:focus,
.infobot-form-field select:focus {
    border-color: var(--infobot-primary);
}

.infobot-skip-btn {
    background: none;
    border: none;
    color: var(--infobot-primary);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 5px;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .infobot-chat-window {
        width: calc(100% - 40px);
        height: calc(100vh - 120px);
        bottom: 90px;
        right: 20px;
    }
    
    .infobot-float-icon {
        width: 55px;
        height: 55px;
    }
    
    .infobot-float-icon i {
        font-size: 24px;
    }
}

/* Scrollbar Styles */
.infobot-chat-body::-webkit-scrollbar {
    width: 6px;
}

.infobot-chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.infobot-chat-body::-webkit-scrollbar-thumb {
    background: var(--infobot-primary);
    border-radius: 3px;
}

.infobot-chat-body::-webkit-scrollbar-thumb:hover {
    background: var(--infobot-dark);
}

