/* ============================================
   GlobalTrust Bank - Live Chat Widget Styles
   ============================================ */

/* Chat Widget Button */
.gtb-chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37, #B8941F);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #081120;
    font-size: 24px;
}
.gtb-chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.6);
}
.gtb-chat-fab .chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}
.gtb-chat-fab .chat-label {
    position: absolute;
    right: 70px;
    background: #081120;
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}
.gtb-chat-fab:hover .chat-label {
    opacity: 1;
    transform: translateX(0);
}

/* Chat Window */
.gtb-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    z-index: 10000;
    width: 380px;
    height: 540px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s ease;
}
.gtb-chat-window.active {
    display: flex;
}
@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Chat Header */
.gtb-chat-header {
    background: linear-gradient(135deg, #081120, #0D2B52);
    color: white;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.gtb-chat-header .chat-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    filter: brightness(0) invert(1);
    background: rgba(255,255,255,0.1);
    padding: 4px;
}
.gtb-chat-header .chat-info {
    flex: 1;
    min-width: 0;
}
.gtb-chat-header .chat-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}
.gtb-chat-header .chat-status {
    font-size: 11px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 5px;
}
.gtb-chat-header .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}
.gtb-chat-header .status-dot.offline { background: #ef4444; }
.gtb-chat-header .status-dot.waiting { background: #f59e0b; animation: pulse 1.5s infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.gtb-chat-header .chat-actions {
    display: flex;
    gap: 6px;
}
.gtb-chat-header .chat-actions button {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}
.gtb-chat-header .chat-actions button:hover {
    background: rgba(255,255,255,0.2);
}

/* Chat Messages Area */
.gtb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gtb-chat-messages::-webkit-scrollbar { width: 5px; }
.gtb-chat-messages::-webkit-scrollbar-track { background: transparent; }
.gtb-chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* Message Bubbles */
.gtb-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}
.gtb-msg.bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.gtb-msg.agent {
    align-self: flex-start;
    background: #0D2B52;
    color: white;
    border-bottom-left-radius: 4px;
}
.gtb-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #D4AF37, #B8941F);
    color: #081120;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}
.gtb-msg.system {
    align-self: center;
    background: transparent;
    color: #999;
    font-size: 11px;
    text-align: center;
    padding: 6px 12px;
    max-width: 90%;
}
.gtb-msg .msg-sender {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 3px;
    opacity: 0.8;
}
.gtb-msg .msg-time {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 4px;
    text-align: right;
}
.gtb-msg .msg-attachment {
    display: block;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(0,0,0,0.06);
    border-radius: 8px;
    font-size: 12px;
    text-decoration: none;
    color: inherit;
}
.gtb-msg .msg-attachment:hover {
    background: rgba(0,0,0,0.1);
}
.gtb-msg .msg-attachment img {
    max-width: 100%;
    border-radius: 6px;
    margin-top: 4px;
}

/* Quick Replies */
.gtb-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 10px;
    background: #f8f9fa;
}
.gtb-quick-reply {
    padding: 6px 14px;
    background: white;
    border: 1px solid #D4AF37;
    border-radius: 20px;
    font-size: 12px;
    color: #0D2B52;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.gtb-quick-reply:hover {
    background: #D4AF37;
    color: #081120;
}

/* Typing Indicator */
.gtb-typing {
    align-self: flex-start;
    padding: 12px 18px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: none;
}
.gtb-typing.active { display: flex; }
.gtb-typing .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #999;
    margin: 0 2px;
    animation: typingBounce 1.4s infinite ease-in-out;
}
.gtb-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.gtb-typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* Chat Input Area */
.gtb-chat-input {
    padding: 12px 14px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.gtb-chat-input .attach-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    border-radius: 8px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.gtb-chat-input .attach-btn:hover { color: #D4AF37; }
.gtb-chat-input textarea {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    resize: none;
    max-height: 80px;
    min-height: 36px;
    line-height: 1.4;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.gtb-chat-input textarea:focus { border-color: #D4AF37; }
.gtb-chat-input .send-btn {
    background: linear-gradient(135deg, #D4AF37, #B8941F);
    border: none;
    color: #081120;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.gtb-chat-input .send-btn:hover { transform: scale(1.1); }
.gtb-chat-input .send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Offline Form */
.gtb-offline-form {
    padding: 16px;
    background: #f8f9fa;
    flex: 1;
    overflow-y: auto;
}
.gtb-offline-form h4 {
    font-size: 15px;
    font-weight: 700;
    color: #081120;
    margin-bottom: 4px;
}
.gtb-offline-form p {
    font-size: 12px;
    color: #666;
    margin-bottom: 14px;
}
.gtb-offline-form .form-group {
    margin-bottom: 10px;
}
.gtb-offline-form label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 3px;
    text-transform: uppercase;
}
.gtb-offline-form input,
.gtb-offline-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.gtb-offline-form input:focus,
.gtb-offline-form textarea:focus { border-color: #D4AF37; }
.gtb-offline-form textarea { resize: vertical; min-height: 60px; }
.gtb-offline-form .submit-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #D4AF37, #B8941F);
    color: #081120;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    margin-top: 6px;
    transition: transform 0.2s;
}
.gtb-offline-form .submit-btn:hover { transform: scale(1.02); }

/* Guest Login Form (shown before chat starts) */
.gtb-guest-form {
    padding: 24px 16px;
    background: #f8f9fa;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.gtb-guest-form img { height: 50px; margin-bottom: 12px; }
.gtb-guest-form h4 { font-size: 16px; font-weight: 700; color: #081120; margin-bottom: 4px; }
.gtb-guest-form p { font-size: 12px; color: #666; margin-bottom: 16px; }
.gtb-guest-form input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 8px;
    outline: none;
}
.gtb-guest-form input:focus { border-color: #D4AF37; }
.gtb-guest-form .start-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #D4AF37, #B8941F);
    color: #081120;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    margin-top: 4px;
}

/* Talk to Human Button */
.gtb-talk-human {
    display: block;
    width: calc(100% - 32px);
    margin: 0 16px 10px;
    padding: 8px;
    background: transparent;
    border: 1px dashed #D4AF37;
    border-radius: 10px;
    color: #0D2B52;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.gtb-talk-human:hover {
    background: rgba(212, 175, 55, 0.1);
    border-style: solid;
}

/* File preview */
.gtb-file-preview {
    padding: 6px 14px;
    background: #fff3cd;
    border-top: 1px solid #eee;
    font-size: 12px;
    display: none;
    align-items: center;
    gap: 8px;
}
.gtb-file-preview.active { display: flex; }
.gtb-file-preview .remove-file {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 14px;
    margin-left: auto;
}

/* Powered by footer */
.gtb-chat-footer {
    padding: 6px;
    text-align: center;
    font-size: 10px;
    color: #bbb;
    background: white;
    border-top: 1px solid #f0f0f0;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .gtb-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    .gtb-chat-fab {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }
}
