/* /widget/chat-widget.css - Time to Win Theme - Clean & Responsive */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main Widget Container */
.chat-widget {
    position: fixed;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Position Options */
.chat-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.chat-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* ========== CHAT WIDGET BUTTON ========== */
.chat-widget-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-radius: 60px;
    background: linear-gradient(135deg, #F5A623, #E8871E);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3);
    transition: all 0.3s ease;
    position: relative;
    animation: launcherPulse 2s infinite ease-in-out;
}

@keyframes launcherPulse {
    0% { box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3); transform: scale(1); }
    50% { box-shadow: 0 6px 25px rgba(245, 166, 35, 0.5); transform: scale(1.02); }
    100% { box-shadow: 0 4px 15px rgba(245, 166, 35, 0.3); transform: scale(1); }
}

.chat-icon i {
    color: white;
    font-size: 22px;
}

.chat-button-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.chat-widget-button:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(245, 166, 35, 0.4);
}

/* ========== TOOLTIP ========== */
.chat-tooltip {
    position: absolute;
    bottom: 70px;
    right: 10px;
    background: #1A2A2A;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: tooltipBounce 0.5s ease;
    z-index: 10000;
}

.chat-tooltip.hide {
    animation: tooltipFadeOut 0.5s ease forwards;
}

.tooltip-arrow {
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #1A2A2A;
    transform: rotate(45deg);
}

/* ========== NOTIFICATION BADGE ========== */
.chat-notification {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #E63946;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border: 2px solid white;
    z-index: 1;
}

.notification-count {
    color: white;
    font-size: 10px;
    font-weight: bold;
}

/* ========== CHAT WINDOW ========== */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 420px;
    height: 600px;
    max-height: calc(100vh - 100px);
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(245, 166, 35, 0.15);
}

.chat-window.show {
    display: flex !important;
}

/* ========== CHAT HEADER ========== */
.chat-header {
    background: linear-gradient(135deg, #1A2A2A, #0F2B1F);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(245, 166, 35, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #F5A623;
}

.chat-header-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: white;
    margin-bottom: 3px;
}

.chat-header-text p {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 5px;
}

.online-dot {
    width: 7px;
    height: 7px;
    background: #06D6A0;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-green 1.5s infinite;
}

/* ========== HEADER ACTIONS ========== */
.chat-header-actions {
    display: flex;
    gap: 12px;
}

.chat-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.chat-close:hover {
    background: rgba(245, 166, 35, 0.2);
    transform: scale(1.05);
}

/* ========== MESSAGES AREA ========== */
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #F8F9FA;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

/* Messages List */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message Bubbles */
.message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.message.user {
    justify-content: flex-end;
}

.message.support {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #F5A623, #E8871E);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.message.support .message-bubble {
    background: white;
    color: #334155;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-text {
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-time {
    font-size: 9px;
    margin-top: 5px;
    opacity: 0.7;
}

/* Bot Action Buttons */
.bot-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.bot-action-btn {
    background: #f0f2f5;
    border: none;
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 500;
    color: #1f2a44;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bot-action-btn:hover {
    background: #F5A623;
    color: white;
    transform: translateY(-1px);
}

/* Login Buttons */
.login-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.login-btn-action,
.signup-btn-action {
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn-action:hover,
.signup-btn-action:hover {
    transform: translateY(-1px);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    margin-top: 10px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #94A3B8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

.typing-text {
    margin-left: 8px;
    font-size: 11px;
    color: #94A3B8;
}

/* Date Divider */
.date-divider {
    text-align: center;
    margin: 15px 0;
    position: relative;
}

.date-divider span {
    background: #E2E8F0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 10px;
    color: #64748B;
}

/* No Messages */
.no-messages {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.no-messages i {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 12px;
}

.no-messages p {
    font-size: 13px;
    margin: 0;
}

/* ========== CATEGORY PILLS ========== */
.category-menu {
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #eef2f6;
}

.category-menu-header {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-menu-header i {
    color: #F5A623;
    font-size: 11px;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1f2a44;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-pill i {
    font-size: 0.85rem;
    color: #F5A623;
}

.category-pill:hover {
    background: linear-gradient(135deg, #F5A623, #E8871E);
    border-color: #F5A623;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.2);
}

.category-pill:hover i {
    color: white;
}

.category-pill:active {
    transform: scale(0.96);
}

/* ========== INPUT AREA ========== */
.chat-input-area {
    border-top: 1px solid #E2E8F0;
    background: white;
    flex-shrink: 0;
}

/* Input Wrapper */
.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 16px;
    background: white;
}

.textarea-container {
    flex: 1;
    position: relative;
}

#chatMessageInput {
    width: 100%;
    border: 2px solid #eef2f6;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    min-height: 40px;
    transition: all 0.2s;
    background: #f8fafc;
}

#chatMessageInput:focus {
    outline: none;
    border-color: #F5A623;
    background: white;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

.send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F5A623, #E8871E);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}

.send-btn:active {
    transform: scale(0.95);
}

.chat-footer {
    padding: 8px 16px;
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
    border-top: 1px solid #eef2f6;
    background: white;
}

.chat-footer i {
    margin-right: 4px;
}

/* ========== TOAST ========== */
.widget-toast {
    position: fixed;
    bottom: 100px;
    right: 20px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 10000;
    animation: slideInOut 3s ease;
    font-family: 'Inter', sans-serif;
}

.widget-toast.success {
    background: #10b981;
    color: white;
}

.widget-toast.error {
    background: #ef4444;
    color: white;
}

.widget-toast.info {
    background: #F5A623;
    color: #1f2a44;
}

/* ========== SCROLLBAR ========== */
.chat-messages-area::-webkit-scrollbar {
    width: 5px;
}

.chat-messages-area::-webkit-scrollbar-track {
    background: #E2E8F0;
    border-radius: 10px;
}

.chat-messages-area::-webkit-scrollbar-thumb {
    background: #F5A623;
    border-radius: 10px;
}

.chat-messages-area::-webkit-scrollbar-thumb:hover {
    background: #E8871E;
}

/* ========== ANIMATIONS ========== */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes slideInOut {
    0% { opacity: 0; transform: translateX(100%); }
    10% { opacity: 1; transform: translateX(0); }
    90% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(100%); }
}

@keyframes tooltipBounce {
    0% { opacity: 0; transform: translateY(10px); }
    60% { opacity: 1; transform: translateY(-5px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes tooltipFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); visibility: hidden; }
}

/* ========== ENGAGEMENT MODAL ========== */
.engagement-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.engagement-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    animation: modalFadeIn 0.3s ease forwards;
}

.engagement-modal-container {
    position: relative;
    background: white;
    border-radius: 24px;
    width: 380px;
    margin-right: 30px;
    margin-bottom: 95px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
    z-index: 20001;
    animation: modalSlideUpDesktop 0.4s ease forwards;
}

.engagement-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 16px;
    transition: all 0.2s;
    z-index: 1;
}

.engagement-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.engagement-modal-content {
    padding: 32px 28px;
    text-align: center;
}

.engagement-modal-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #F5A62320, #E8871E20);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.engagement-modal-icon i {
    font-size: 32px;
    color: #F5A623;
}

.engagement-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2a44;
    margin-bottom: 10px;
}

.engagement-modal-text {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
}

.engagement-modal-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 28px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.feature-item i {
    font-size: 20px;
    color: #F5A623;
}

.feature-item span {
    font-size: 11px;
    font-weight: 500;
    color: #1f2a44;
}

.engagement-modal-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #F5A623, #E8871E);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-bottom: 14px;
}

.engagement-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 166, 35, 0.3);
}

.engagement-modal-footer {
    font-size: 11px;
    color: #94a3b8;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUpDesktop {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalBottomSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .chat-widget.bottom-right,
    .chat-widget.bottom-left {
        bottom: 16px;
        right: 16px;
        left: auto;
    }
    
    .chat-widget-button {
        padding: 12px 20px;
    }
    
    .chat-button-text {
        font-size: 14px;
    }
    
    .chat-icon i {
        font-size: 18px;
    }
    
    .chat-tooltip {
        display: none;
    }
    
    .chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .chat-window.show {
        display: flex !important;
        animation: fadeIn 0.3s ease;
    }
    
    /* Category pills on mobile - horizontal scroll */
    .category-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-pills::-webkit-scrollbar {
        display: none;
    }
    
    .category-pill {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 0.75rem;
    }
    
    .category-pill i {
        font-size: 0.7rem;
    }
    
    .send-btn {
        width: 42px;
        height: 42px;
    }
    
    .chat-close {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    #chatMessageInput {
        font-size: 16px !important;
        padding: 12px 16px !important;
    }
    
    .message-bubble {
        max-width: 85%;
        padding: 10px 14px;
    }
    
    .message-text {
        font-size: 14px;
    }
    
    .chat-footer {
        font-size: 9px;
    }
    
    /* Engagement modal mobile */
    .engagement-modal {
        justify-content: center;
    }
    
    .engagement-modal-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
        animation: modalBottomSheetUp 0.4s ease forwards;
    }
    
    .engagement-modal-container::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background-color: #cbd5e1;
        border-radius: 2px;
    }
    
    .engagement-modal-content {
        padding: 30px 20px 20px;
    }
    
    .engagement-modal-title {
        font-size: 20px;
    }
    
    .engagement-modal-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
    }
    
    .engagement-modal-icon i {
        font-size: 28px;
    }
    
    .engagement-modal-features {
        gap: 16px;
        margin-bottom: 20px;
    }
    
    .feature-item i {
        font-size: 18px;
    }
    
    .feature-item span {
        font-size: 10px;
    }
    
    .engagement-modal-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .chat-widget-button {
        padding: 10px 16px;
    }
    
    .chat-button-text {
        font-size: 12px;
    }
    
    .chat-icon i {
        font-size: 16px;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .chat-header-text h3 {
        font-size: 14px;
    }
    
    .chat-messages-area {
        padding: 14px;
    }
    
    .send-btn {
        width: 38px;
        height: 38px;
    }
}

/* Hide button when chat is open */
body:has(.chat-window.show) .chat-widget-button {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: all 0.3s ease;
}