/* Floating Chat Widget Styles */
.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8CE4FF 0%, #5CC8FF 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(140, 228, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    animation: chatPulse 2s infinite;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(140, 228, 255, 0.6);
}

.chat-widget-button:active {
    transform: scale(0.95);
}

.chat-widget-icon {
    font-size: 28px;
    color: white;
}

.chat-widget-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF4444;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: badgePulse 1.5s infinite;
}

@keyframes chatPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(140, 228, 255, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(140, 228, 255, 0.6), 0 0 0 10px rgba(140, 228, 255, 0.1);
    }
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.chat-widget-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-widget-popup.active {
    display: flex;
}

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

.chat-widget-header {
    background: linear-gradient(135deg, #8CE4FF 0%, #5CC8FF 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-widget-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-widget-header-icon {
    font-size: 24px;
}

.chat-widget-header-text h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.chat-widget-header-text p {
    margin: 2px 0 0 0;
    font-size: 11px;
    opacity: 0.9;
}

.chat-widget-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
}

.chat-widget-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.chat-widget-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.chat-widget-message-item {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.chat-widget-message-item.user {
    align-items: flex-end;
}

.chat-widget-message-item.admin {
    align-items: flex-start;
}

.chat-widget-message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* User messages - Green (Sent) */
.chat-widget-message-item.user .chat-widget-message-bubble {
    background: #dcf8c6;
    color: #333;
    border-bottom-right-radius: 2px;
}

.chat-widget-message-item.user .chat-widget-message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border-top: 10px solid #dcf8c6;
    border-right: 10px solid transparent;
}

/* Admin messages - White (Received) */
.chat-widget-message-item.admin .chat-widget-message-bubble {
    background: #ffffff;
    color: #333;
    border-bottom-left-radius: 2px;
}

.chat-widget-message-item.admin .chat-widget-message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 10px solid #ffffff;
    border-left: 10px solid transparent;
}

.chat-widget-message-time {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    padding: 0 6px;
}

.chat-widget-input-container {
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
}

.chat-widget-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    transition: border-color 0.2s;
}

.chat-widget-input:focus {
    outline: none;
    border-color: #8CE4FF;
}

.chat-widget-send {
    padding: 10px 20px;
    background: linear-gradient(135deg, #8CE4FF 0%, #5CC8FF 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-widget-send:hover {
    transform: scale(1.05);
}

.chat-widget-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-widget-login-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    text-align: center;
}

.chat-widget-login-prompt-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.chat-widget-login-prompt h3 {
    margin: 0 0 8px 0;
    color: #333;
}

.chat-widget-login-prompt p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 13px;
}

.chat-widget-login-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #8CE4FF 0%, #5CC8FF 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s;
}

.chat-widget-login-btn:hover {
    transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-widget-container {
        bottom: 15px;
        right: 15px;
    }

    .chat-widget-button {
        width: 55px;
        height: 55px;
    }

    .chat-widget-icon {
        font-size: 24px;
    }

    .chat-widget-popup {
        width: calc(100vw - 30px);
        height: calc(100vh - 150px);
        bottom: 70px;
        right: -15px;
    }
}
