/* Georgian Transfer - Floating Chat Widget */

.floating-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Chat Button */
.chat-button {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ffb800 0%, #ffa500 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 184, 0, 0.4);
    transition: all 0.3s ease;
    position: relative;
    animation: pulse-button 2s ease-in-out infinite;
    z-index: 1; /* place below popup */
}

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

.chat-button.active {
    transform: rotate(90deg) scale(0.9);
    opacity: 0; /* hide when popup open */
    pointer-events: none;
}

.chat-button svg {
    color: #0E0E0E;
    transition: transform 0.3s ease;
}

.chat-button:hover svg {
    transform: scale(1.1);
}

/* Badge */
.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    animation: bounce-badge 1s ease-in-out infinite;
    transition: transform 0.3s ease;
}

@keyframes pulse-button {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(255, 184, 0, 0.4);
    }
    50% {
        box-shadow: 0 8px 24px rgba(255, 184, 0, 0.4), 0 0 0 10px rgba(255, 184, 0, 0.1);
    }
}

@keyframes bounce-badge {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* Chat Popup */
.chat-popup {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 320px;
    max-width: calc(100vw - 60px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: visible;
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    z-index: 2; /* above chat button */
}

.chat-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Popup Header */
.chat-popup-header {
    padding: 16px;
    background: linear-gradient(135deg, #ffb800 0%, #ffa500 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.chat-header-content {
    display: flex;
    gap: 12px;
    flex: 1;
}

.chat-header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 184, 0, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #ffb800;
}

.chat-header-icon svg {
    color: #ffb800;
}

.chat-header-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.chat-header-text p {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.chat-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.chat-close svg {
    color: #fff;
}

/* Popup Body */
.chat-popup-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* Chat Options */
.chat-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.chat-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.5s ease;
}

.chat-option:hover::before {
    left: 100%;
}

.chat-option:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.chat-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-option-content {
    flex: 1;
    min-width: 0; /* allow text to wrap in flex */
}

.chat-option-content h4 {
    margin: 0 0 3px 0;
    font-size: 15px;
    font-weight: 700;
    color: #0E0E0E;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
}

.chat-option-content p {
    margin: 0 0 3px 0;
    font-size: 11px;
    color: #666;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
}

.chat-number {
    font-size: 12px;
    font-weight: 600;
    color: #0E0E0E;
    font-family: monospace;
    white-space: normal;
    word-break: break-word;
}

.chat-option-arrow {
    flex-shrink: 0;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.chat-option:hover .chat-option-arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* WhatsApp */
.chat-option.whatsapp {
    border-color: transparent;
}

.chat-option.whatsapp:hover {
    border-color: #25D366;
    background: #e8f5e9;
}

.chat-option.whatsapp .chat-option-icon {
    background: #25D366;
}

.chat-option.whatsapp .chat-option-icon svg {
    color: #fff;
}

/* Telegram */
.chat-option.telegram {
    border-color: transparent;
}

.chat-option.telegram:hover {
    border-color: #0088cc;
    background: #e3f2fd;
}

.chat-option.telegram .chat-option-icon {
    background: #0088cc;
}

.chat-option.telegram .chat-option-icon svg {
    color: #fff;
}

/* Viber */
.chat-option.viber {
    border-color: transparent;
}

.chat-option.viber:hover {
    border-color: #7360f2;
    background: #ede7f6;
}

.chat-option.viber .chat-option-icon {
    background: #7360f2;
}

.chat-option.viber .chat-option-icon svg {
    color: #fff;
}

/* Popup Footer */
.chat-popup-footer {
    padding: 12px 14px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    flex-shrink: 0;
    border-radius: 0 0 20px 20px;
}

.chat-popup-footer p {
    margin: 0;
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

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

    .chat-button {
        width: 50px;
        height: 50px;
    }

    .chat-popup {
        width: calc(100vw - 40px);
        bottom: 90px; /* more clearance above button */
        right: 20px;
        max-height: calc(100vh - 120px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .chat-popup-header {
        padding: 14px 16px;
    }

    .chat-header-icon {
        width: 36px;
        height: 36px;
    }

    .chat-header-text h3 {
        font-size: 16px; /* improve readability */
    }

    .chat-header-text p {
        font-size: 12px; /* improve readability */
    }

    .chat-popup-body {
        padding: 12px 14px;
    }

    .chat-option {
        padding: 10px 12px;
        align-items: flex-start; /* keep text from vertical centering crowding */
    }

    .chat-option-icon {
        width: 36px;
        height: 36px;
    }

    .chat-option-content h4 {
        font-size: 15px;
    }

    .chat-option-content p {
        font-size: 12px;
    }

    .chat-number {
        font-size: 12px;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] .floating-chat-widget {
    right: auto;
    left: 30px;
}

[dir="rtl"] .chat-popup {
    right: auto;
    left: 30px;
}

[dir="rtl"] .chat-badge {
    right: auto;
    left: -5px;
}

[dir="rtl"] .chat-option:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .chat-option-arrow {
    transform: rotate(180deg);
}

[dir="rtl"] .chat-option:hover .chat-option-arrow {
    transform: rotate(180deg) translateX(5px);
}

@media (max-width: 768px) {
    [dir="rtl"] .floating-chat-widget {
        left: 20px;
    }

    [dir="rtl"] .chat-popup {
        left: -10px;
    }
}

/* Scrollbar Styling */
.chat-popup-body::-webkit-scrollbar {
    width: 6px;
}

.chat-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-popup-body::-webkit-scrollbar-thumb {
    background: #ffb800;
    border-radius: 10px;
}

.chat-popup-body::-webkit-scrollbar-thumb:hover {
    background: #ffa500;
}
