/**
 * Shipzeno Flight - Modern Floating Livechat Widget Styles
 * Color Theme: Light Blue & Sky Blue Mixed
 */

/* Floating Launcher Button */
.chat-launcher-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.chat-launcher-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 28px rgba(2, 132, 199, 0.5);
}

.chat-launcher-btn .pulse-ring {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid #38bdf8;
    animation: chatPulse 2s infinite;
    pointer-events: none;
}

@keyframes chatPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0; }
}

.chat-unread-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Chat Widget Window Container */
.chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 375px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    border: 1px solid #e0f2fe;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    animation: chatSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-main, -apple-system, BlinkMacSystemFont, 'Plus Jakarta Sans', sans-serif);
}

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

/* Header */
.chat-header {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar-box {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #ffffff;
}

.chat-header-info h4 {
    font-size: 0.98rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.chat-header-info span {
    font-size: 0.74rem;
    color: #e0f2fe;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-header-actions button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-actions button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

/* Pre-Chat Welcome Screen */
.chat-prechat {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    overflow-y: auto;
    background: #f8fafc;
}

.prechat-welcome-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.prechat-welcome-card h5 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.prechat-welcome-card p {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

.quick-topics-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.quick-chips-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-chip-btn {
    background: #ffffff;
    border: 1px solid #e0f2fe;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0284c7;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.quick-chip-btn:hover {
    background: #f0f9ff;
    border-color: #38bdf8;
    transform: translateX(3px);
}

/* Chat Messages View Body */
.chat-messages-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.chat-bubble-row {
    display: flex;
    gap: 8px;
    max-width: 86%;
}

.chat-bubble-row.admin-row {
    align-self: flex-start;
}

.chat-bubble-row.user-row {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-bubble {
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.48;
    position: relative;
    word-break: break-word;
}

.admin-row .chat-bubble {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.user-row .chat-bubble {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.chat-meta-time {
    font-size: 0.68rem;
    margin-top: 4px;
    display: block;
    opacity: 0.75;
}

.admin-row .chat-meta-time {
    color: #64748b;
}

.user-row .chat-meta-time {
    color: #e0f2fe;
    text-align: right;
}

/* Typing Indicator */
.chat-typing {
    display: none;
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    border-radius: 16px;
    gap: 4px;
    align-items: center;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    background: #0284c7;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.chat-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Chat Footer Input Area */
.chat-footer {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.chat-footer input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.chat-footer input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    background: #0284c7;
}

/* Email Notification Banner in Active Chat */
.chat-notify-banner {
    background: #f0f9ff;
    border-bottom: 1px solid #bae6fd;
    padding: 8px 14px;
    font-size: 0.78rem;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.chat-notify-banner.has-email {
    background: #f0fdf4;
    border-bottom-color: #bbf7d0;
    color: #166534;
}

.chat-notify-form {
    display: flex;
    gap: 6px;
    width: 100%;
    align-items: center;
}

.chat-notify-input {
    flex: 1;
    font-size: 0.78rem;
    padding: 4px 8px;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
}

.chat-notify-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.chat-notify-save-btn {
    background: #0284c7;
    color: #ffffff;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.chat-notify-save-btn:hover {
    background: #0369a1;
}

.chat-notify-edit-btn {
    background: transparent;
    border: none;
    color: #0284c7;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-left: 6px;
}

/* Pre-Chat Form Inputs */
.prechat-form-group {
    margin-bottom: 10px;
}

.prechat-form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    display: block;
    margin-bottom: 4px;
}

.prechat-form-group input {
    font-size: 0.86rem;
    padding: 9px 12px;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    background: #ffffff;
    color: #0f172a;
    transition: border 0.2s;
    box-sizing: border-box;
}

.prechat-form-group input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.prechat-email-hint {
    font-size: 0.74rem;
    color: #0284c7;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 480px) {
    .chat-launcher-btn {
        bottom: 18px;
        right: 18px;
        width: 54px;
        height: 54px;
    }

    .chat-window {
        bottom: 12px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: calc(100vw - 20px);
        height: calc(100dvh - 24px);
        max-height: 640px;
        border-radius: 20px;
    }

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

    .chat-prechat-body {
        padding: 20px 16px;
    }

    .chat-messages-body {
        padding: 16px;
    }
}


