 
/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Roboto', sans-serif;
    box-sizing: border-box;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00FFFF 0%, #00d8d8 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    font-size: 24px;
    transition: all 0.3s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

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

.chat-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #1e1e1e;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    box-sizing: border-box;
}

.chat-window.active {
    display: flex;
}

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

/* Mobile slide up animation */
@media (max-width: 768px) {
    @keyframes slideUpMobile {
        from {
            opacity: 0;
            transform: translateY(100px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    .chat-window.active {
        animation: slideUpMobile 0.3s ease !important;
    }
}

.chat-header {
    background: linear-gradient(135deg, #00FFFF 0%, #00d8d8 100%);
    color: #000000;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 15px 15px 0 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-header .close-btn {
    background: none;
    border: none;
    color: #000000;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 1000;
    position: relative;
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-select: none;
}

.chat-header .close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #00FFFF;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #00d8d8;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

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

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

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #00FFFF 0%, #00d8d8 100%);
    color: #000000;
    border-bottom-right-radius: 4px;
}

.chat-message.bot .message-bubble {
    background: #2d2d2d;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.message-bubble strong {
    font-weight: 600;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    padding: 0 5px;
}

.chat-input-container {
    padding: 15px;
    background: #1e1e1e;
    border-top: 1px solid #3a3a3a;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #3a3a3a;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    background: #2d2d2d;
    color: #e0e0e0;
}

.chat-input:focus {
    border-color: #00FFFF;
}

.chat-input:disabled {
    background: #252525;
    cursor: not-allowed;
    opacity: 0.6;
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00FFFF 0%, #00d8d8 100%);
    border: none;
    color: #000000;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 255, 255, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: #2d2d2d;
    border-radius: 18px;
    border: 1px solid #3a3a3a;
    align-self: flex-start;
    max-width: 80px;
}

.typing-indicator.active {
    display: flex;
    gap: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00FFFF;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Welcome message */
.welcome-message {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
    line-height: 1.6;
}

.welcome-message strong {
    color: #00FFFF;
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
}

/* Language Selection */
.language-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 200px;
}

.language-selection-content {
    text-align: center;
    width: 100%;
}

.language-selection-content h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #e0e0e0;
    font-weight: 600;
}

.language-selection-content p {
    margin: 0 0 25px 0;
    color: #999;
    font-size: 14px;
}

.language-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-btn {
    flex: 1;
    min-width: 120px;
    max-width: 150px;
    padding: 20px 15px;
    border: 2px solid #3a3a3a;
    border-radius: 12px;
    background: #2d2d2d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.lang-btn:hover {
    border-color: #00FFFF;
    background: rgba(0, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.4);
}

.lang-btn:active {
    transform: translateY(0);
}

.lang-flag {
    font-size: 32px;
    line-height: 1;
}

.lang-name {
    font-size: 16px;
    font-weight: 600;
    color: #e0e0e0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 15px;
        right: 15px;
        left: auto;
        z-index: 999999;
    }
    
    .chat-window {
        position: fixed !important;
        width: calc(100vw - 20px) !important;
        max-width: 100vw !important;
        height: 85vh !important;
        height: 85dvh !important; /* Dynamic viewport height for mobile */
        max-height: 85vh !important;
        max-height: 85dvh !important;
        bottom: 80px !important;
        right: 10px !important;
        left: 10px !important;
        top: auto !important;
        margin: 0 auto !important;
        padding: 0 !important;
        border-radius: 15px !important;
        z-index: 999999 !important;
        transform: translateZ(0) !important; /* Force hardware acceleration */
        -webkit-transform: translateZ(0) !important;
        will-change: transform;
        overflow: hidden !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8) !important;
    }
    
    .chat-window.active {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    .chat-button {
        width: 55px;
        height: 55px;
        font-size: 22px;
        bottom: 15px;
        right: 15px;
        z-index: 1000000;
        position: fixed;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    .chat-header {
        padding: 15px 20px;
        border-radius: 15px 15px 0 0 !important;
        position: relative;
        z-index: 10;
        flex-shrink: 0;
        pointer-events: auto;
    }
    
    .chat-header h3 {
        font-size: 18px;
    }
    
    .chat-header .close-btn {
        width: 40px;
        height: 40px;
        font-size: 28px;
        flex-shrink: 0;
        z-index: 1001 !important;
        position: relative;
        pointer-events: auto !important;
        cursor: pointer !important;
        min-width: 40px;
        min-height: 40px;
    }
    
    .chat-messages {
        padding: 15px;
        gap: 12px;
        -webkit-overflow-scrolling: touch;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }
    
    .chat-message {
        max-width: 85%;
    }
    
    .message-bubble {
        padding: 10px 14px;
        font-size: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .chat-input-container {
        padding: 12px;
        gap: 8px;
        border-top: 1px solid #3a3a3a;
        flex-shrink: 0;
        border-radius: 0 0 15px 15px;
    }
    
    .chat-input {
        padding: 10px 12px;
        font-size: 14px;
        -webkit-appearance: none;
        border-radius: 25px;
    }
    
    .chat-send-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        flex-shrink: 0;
    }
    
    /* Chat button visibility handled by JavaScript on mobile */
    
    .language-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .lang-btn {
        max-width: 100%;
        padding: 18px 15px;
    }
    
    .language-selection {
        padding: 30px 15px;
        min-height: 180px;
    }
    
    .language-selection-content h3 {
        font-size: 18px;
    }
    
    .typing-indicator {
        max-width: 70px;
        padding: 10px 14px;
    }
    
    .rating-container {
        padding: 15px;
        margin: 12px 0;
    }
    
    .rating-prompt p {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .rating-star {
        font-size: 28px;
    }
    
    /* Prevent body scroll when chat is open on mobile - but allow scrolling in chat */
    body.chat-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Add backdrop overlay for better visibility */
    .chat-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999998;
        pointer-events: auto;
        animation: fadeIn 0.3s ease;
    }
    
    /* Ensure chat window is always on top on mobile */
    .chat-window.active {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    /* Override any other z-index that might interfere */
    body .chat-widget,
    body .chat-window,
    body .chat-window.active {
        z-index: 999999 !important;
    }
    
    /* Ensure no other elements cover the chat */
    body.mobile-nav-active .chat-window.active {
        z-index: 1000000 !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .chat-widget {
        bottom: 10px;
        right: 10px;
        z-index: 999999;
    }
    
    .chat-window {
        position: fixed !important;
        width: calc(100vw - 16px) !important;
        max-width: 100vw !important;
        height: 80vh !important;
        height: 80dvh !important; /* Dynamic viewport height */
        max-height: 80vh !important;
        max-height: 80dvh !important;
        bottom: 75px !important;
        right: 8px !important;
        left: 8px !important;
        top: auto !important;
        margin: 0 auto !important;
        padding: 0 !important;
        border-radius: 15px !important;
        z-index: 999999 !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        will-change: transform;
        overflow: hidden !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8) !important;
    }
    
    .chat-window.active {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    .chat-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 10px;
        right: 10px;
        z-index: 1000000;
        position: fixed;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    .chat-header {
        border-radius: 15px 15px 0 0 !important;
        pointer-events: auto;
        padding: 10px 12px;
    }
    
    .chat-header h3 {
        font-size: 15px;
    }
    
    .chat-header .close-btn {
        width: 42px;
        height: 42px;
        font-size: 30px;
        z-index: 1002 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        min-width: 42px;
        min-height: 42px;
        position: relative;
    }
    
    .chat-input-container {
        border-radius: 0 0 15px 15px;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .message-bubble {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .chat-input-container {
        padding: 10px;
    }
    
    .chat-input {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .chat-send-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
}

/* Rating System */
.rating-container {
    padding: 20px;
    text-align: center;
    background: #2d2d2d;
    border-radius: 12px;
    margin: 15px 0;
    border: 2px solid #00FFFF;
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.4);
}

.rating-prompt p {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #e0e0e0;
}

.rating-stars-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.rating-star {
    font-size: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.rating-star:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

.rating-stars {
    cursor: pointer;
    display: inline-block;
    transition: all 0.2s ease;
}

.rating-stars:hover {
    transform: scale(1.1);
}

.rating-thanks {
    padding: 15px;
    background: rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    font-weight: 600;
    font-size: 16px;
}

/* Message bubble links */
.chat-message .message-bubble a {
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}

.chat-message.user .message-bubble a {
    color: #000000;
    text-decoration: underline;
}

.chat-message.bot .message-bubble a {
    color: #00FFFF;
    text-decoration: underline;
}

