/* Hostboom Chatbot Styles */
/* Matching the website's professional blue gradient theme */

/* === Main Chatbot Container === */
.hostboom-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* === Chat Toggle Button === */
.chat-toggle {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(45deg, #56c8fb 0%, #627bed 100%);
    box-shadow: 0 8px 32px rgba(86, 200, 251, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.2);
    outline: none;
    backdrop-filter: blur(10px);
}

.chat-toggle:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 16px 40px rgba(86, 200, 251, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.chat-toggle.active {
    background: linear-gradient(45deg, #627bed 0%, #4a5fb8 100%);
    transform: scale(1.05);
}

.chat-icon,
.chat-close-icon {
    transition: all 0.3s ease;
    position: absolute;
}

.chat-close-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.8);
}

.chat-toggle.active .chat-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.8);
}

.chat-toggle.active .chat-close-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* === Notification Badge === */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 100%);
    display: none;
    align-items: center;
    justify-content: center;
    animation: pulse-notification 2s infinite;
    box-shadow: 0 4px 16px rgba(255, 71, 87, 0.4);
    border: 3px solid white;
}

.notification-pulse {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-notification {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(255, 71, 87, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(255, 71, 87, 0.6);
    }
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.8);
    }
}

/* === Chat Window === */
.chat-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 400px;
    height: 580px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 24px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(30px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* === Chat Header === */
.chat-header {
    background: linear-gradient(45deg, #56c8fb 0%, #627bed 100%);
    padding: 24px;
    color: white;
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.chat-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-avatar {
    position: relative;
    width: 48px;
    height: 48px;
}

.avatar-gradient {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #00e676;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 230, 118, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
    }
}

.agent-details h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.agent-status {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.chat-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* === Chat Messages === */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 280px;
    background: #ffffff;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #56c8fb 0%, #627bed 100%);
    border-radius: 4px;
}

/* === Message Styling === */
.message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    justify-content: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.message-avatar .avatar-gradient {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(45deg, #56c8fb 0%, #627bed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.message-content {
    max-width: 260px;
}

.user-message .message-content {
    max-width: 280px;
}

.message-text {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.bot-message .message-text {
    background: #f8f9fa;
    color: #000000;
    border: 1px solid #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.user-message .message-text {
    background: linear-gradient(45deg, #56c8fb 0%, #627bed 100%);
    color: white;
    margin-left: auto;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.bot-message .message-time {
    text-align: left;
}

/* === Quick Actions === */
.quick-actions {
    padding: 0 20px 15px;
    background: white;
}

.quick-action-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-chip {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-weight: 500;
}

.quick-chip:hover {
    background: linear-gradient(45deg, #56c8fb 0%, #627bed 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(86, 200, 251, 0.3);
}

/* === Chat Input === */
.chat-input-container {
    background: white;
    border-radius: 0 0 20px 20px;
    border-top: 1px solid #e1e5e9;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 20px;
}

.chat-input {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: all 0.2s ease;
    min-height: 44px;
    max-height: 120px;
    background: #f8f9fa;
}

.chat-input:focus {
    border-color: #56c8fb;
    background: white;
    box-shadow: 0 0 0 3px rgba(86, 200, 251, 0.1);
}

.chat-input::placeholder {
    color: #999;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #e1e5e9;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-send-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.chat-send-btn.active {
    background: linear-gradient(45deg, #56c8fb 0%, #627bed 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(86, 200, 251, 0.3);
}

.chat-send-btn.active:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(86, 200, 251, 0.4);
}

/* === Typing Indicator === */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 15px;
    background: white;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.typing-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #56c8fb;
    animation: typingDots 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-text {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* === Minimized State === */
.chat-minimized {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    border-radius: 25px;
    padding: 12px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.2);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chat-minimized.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.minimized-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(45deg, #56c8fb 0%, #627bed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.minimized-text span {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.restore-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: #f8f9fa;
    color: #666;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.restore-btn:hover {
    background: linear-gradient(45deg, #56c8fb 0%, #627bed 100%);
    color: white;
}

/* === Responsive Design === */
@media (max-width: 480px) {
    .hostboom-chatbot {
        bottom: 15px;
        right: 15px;
    }
    
    .chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        max-width: 350px;
        max-height: 500px;
        right: -10px;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .agent-avatar {
        width: 40px;
        height: 40px;
    }
    
    .avatar-gradient {
        font-size: 18px;
    }
    
    .agent-details h4 {
        font-size: 15px;
    }
    
    .agent-status {
        font-size: 12px;
    }
    
    .chat-messages {
        padding: 15px;
        height: 240px;
    }
    
    .message-content {
        max-width: 220px;
    }
    
    .user-message .message-content {
        max-width: 240px;
    }
    
    .chat-input-wrapper {
        padding: 15px;
    }
    
    .quick-actions {
        padding: 0 15px 12px;
    }
    
    .quick-chip {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .chat-toggle {
        width: 55px;
        height: 55px;
    }
    
    .notification-badge {
        width: 20px;
        height: 20px;
        font-size: 11px;
        top: -6px;
        right: -6px;
    }
}

@media (max-width: 380px) {
    .chat-window {
        width: calc(100vw - 20px);
        right: -5px;
    }
    
    .message-content {
        max-width: 180px;
    }
    
    .user-message .message-content {
        max-width: 200px;
    }
}

/* === High DPI Displays === */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hostboom-chatbot {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* === Light Theme Enforcement === */
/* Remove dark mode to ensure light theme always shows */
.chat-window {
    background: white !important;
    border-color: #007bff !important;
}

.chat-messages {
    background: white !important;
}

.bot-message .message-text {
    background: #f8f9fa !important;
    color: #000000 !important;
    border-color: #007bff !important;
}

.chat-input {
    background: #f8f9fa !important;
    color: #000000 !important;
    border-color: #e1e5e9 !important;
}

.chat-input:focus {
    background: white !important;
    color: #000000 !important;
}

.chat-input::placeholder {
    color: #666 !important;
}

.quick-actions,
.chat-input-container,
.typing-indicator {
    background: white !important;
}

.quick-chip {
    background: #f8f9fa !important;
    color: #495057 !important;
    border-color: #dee2e6 !important;
}

.chat-minimized {
    background: white !important;
    border-color: rgba(0, 123, 255, 0.2) !important;
}

.minimized-text span {
    color: #333 !important;
}

.restore-btn {
    background: #f8f9fa !important;
    color: #666 !important;
}

/* === Animation Performance === */
.hostboom-chatbot * {
    will-change: auto;
}

.chat-toggle,
.chat-window,
.chat-minimized {
    will-change: transform, opacity;
}

/* === Accessibility === */
.hostboom-chatbot [role="button"],
.hostboom-chatbot button {
    outline: none;
}

.hostboom-chatbot [role="button"]:focus-visible,
.hostboom-chatbot button:focus-visible {
    outline: 2px solid #56c8fb;
    outline-offset: 2px;
}

/* === Print Styles === */
@media print {
    .hostboom-chatbot {
        display: none !important;
    }
}

/* === Message Content Styling === */
.message-text a {
    color: #56c8fb;
    text-decoration: none;
    font-weight: 500;
}

.message-text a:hover {
    text-decoration: underline;
}

.user-message .message-text a {
    color: rgba(255, 255, 255, 0.9);
}

.message-text strong {
    font-weight: 600;
}

.message-text em {
    font-style: italic;
}

/* === Enhanced Shadow Effects === */
.chat-window {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(86, 200, 251, 0.1);
}

.chat-toggle {
    box-shadow: 
        0 8px 25px rgba(86, 200, 251, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.message-text {
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.04);
}

.user-message .message-text {
    box-shadow: 
        0 2px 8px rgba(86, 200, 251, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* === Smooth Transitions === */
.hostboom-chatbot * {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Message Links and Formatting === */
.message-text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 4px 0;
    line-height: 1.4;
}

.message-text p {
    margin: 8px 0;
}

.message-text p:first-child {
    margin-top: 0;
}

.message-text p:last-child {
    margin-bottom: 0;
}
