/* ==========================================================================
   WINSAFY FLOATING CHATBOT STYLESheet
   ========================================================================== */

/* 1. Floating Action Button (FAB) */
.winsafy-chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1A3FD8 0%, #00A3FF 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 163, 255, 0.4);
    z-index: 99999;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.winsafy-chat-fab:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 0 25px rgba(0, 163, 255, 0.6);
}

.winsafy-chat-fab:active {
    transform: scale(0.95);
}

/* FAB Breathing Pulse Effect */
@keyframes winsafyPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 163, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(0, 163, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 163, 255, 0);
    }
}

.winsafy-chat-fab {
    animation: winsafyPulse 2.5s infinite;
}

/* 2. Chat Box Window */
.winsafy-chat-box-container {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 360px;
    height: 520px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    z-index: 99998;
    overflow: hidden;
    
    /* Premium Glassmorphism */
    background: rgba(7, 11, 40, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Header */
.winsafy-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(90deg, rgba(26, 63, 216, 0.2) 0%, rgba(0, 163, 255, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.winsafy-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1A3FD8 0%, #00A3FF 100%);
    position: relative;
    box-shadow: 0 0 10px rgba(0, 163, 255, 0.4);
}

/* Mini checkmark inside avatar */
.winsafy-chat-avatar::after {
    content: '';
    position: absolute;
    top: 11px;
    left: 14px;
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.winsafy-chat-header h4 {
    margin: 0;
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.online-indicator {
    font-size: 10px;
    color: #00C853;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.online-indicator .pulse {
    width: 6px;
    height: 6px;
    background-color: #00C853;
    border-radius: 50%;
    display: inline-block;
    animation: winsafyPulseGreen 2s infinite;
}

@keyframes winsafyPulseGreen {
    0% { transform: scale(0.9); opacity: 0.9; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.9; }
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #ffffff;
}

/* Messages Area */
.winsafy-chat-messages-area {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.winsafy-chat-messages-area::-webkit-scrollbar {
    width: 6px;
}

.winsafy-chat-messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.winsafy-chat-messages-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.winsafy-chat-messages-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Message Bubbles */
.winsafy-message {
    display: flex;
    max-width: 85%;
    animation: bubbleFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.winsafy-message.bot {
    align-self: flex-start;
}

.winsafy-message.user {
    align-self: flex-end;
}

.winsafy-message.error {
    align-self: center;
    max-width: 100%;
}

.message-content {
    padding: 10px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
}

/* Bot Message Styling */
.winsafy-message.bot .message-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    border-radius: 12px 12px 12px 2px;
}

/* User Message Styling */
.winsafy-message.user .message-content {
    background: linear-gradient(135deg, #1A3FD8 0%, #00A3FF 100%);
    color: #ffffff;
    border-radius: 12px 12px 2px 12px;
    box-shadow: 0 4px 12px rgba(26, 63, 216, 0.2);
}

/* Error Message Styling */
.winsafy-message.error .message-content {
    background: rgba(226, 75, 74, 0.1);
    border: 1px solid rgba(226, 75, 74, 0.3);
    color: #E24B4A;
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
}

/* 3. Input Form Area */
.winsafy-chat-input-area {
    display: flex;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.winsafy-chat-input-area input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 10px 18px;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    outline: none;
    transition: all 0.3s ease;
}

.winsafy-chat-input-area input:focus {
    border-color: #00A3FF;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 10px rgba(0, 163, 255, 0.15);
}

.winsafy-chat-input-area input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.send-btn {
    background: none;
    border: none;
    color: #00A3FF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 0 12px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.send-btn:hover:not(:disabled) {
    color: #1A3FD8;
    transform: scale(1.08);
}

.send-btn:disabled {
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
}

/* 4. Typing/Loading Indicator Bouncing Dots */
.loading-indicator .message-content {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
}

.loading-indicator .dot {
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    animation: winsafyBouncingDot 1.4s infinite both;
}

.loading-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes winsafyBouncingDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.2); opacity: 1; }
}

/* 5. Responsive Adaptations */
@media (max-width: 480px) {
    .winsafy-chat-box-container {
        width: calc(100vw - 20px) !important;
        height: 460px !important;
        max-height: calc(100vh - 110px) !important;
        right: 10px !important;
        bottom: 80px !important;
    }
    .winsafy-chat-fab {
        bottom: 16px !important;
        right: 16px !important;
        width: 50px !important;
        height: 50px !important;
    }
}
