/* ==========================================
   ZynkroHost Live Chat - Premium Widget CSS
   International Standard Design 2026
   ========================================== */

:root {
    --zyn-primary: #1a4a8a;
    --zyn-primary-light: #2563eb;
    --zyn-accent: #FF003F;
    --zyn-white: #ffffff;
    --zyn-bg: #f8fafc;
    --zyn-bg-dark: #f1f5f9;
    --zyn-text: #1e293b;
    --zyn-text-light: #64748b;
    --zyn-border: #e2e8f0;
    --zyn-shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --zyn-shadow: 0 8px 32px rgba(0,0,0,0.12);
    --zyn-shadow-lg: 0 12px 40px rgba(0,0,0,0.16);
    --zyn-radius: 18px;
    --zyn-radius-sm: 12px;
    --zyn-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   CHAT BUTTON - Floating with Pulse
   ========================================== */
#zynkro-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a4a8a 0%, #2563eb 100%);
    cursor: pointer;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(26, 74, 138, 0.35);
    transition: all var(--zyn-transition);
    border: none;
    animation: floatBtn 3s ease-in-out infinite;
}

@keyframes floatBtn {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

#zynkro-chat-button:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 32px rgba(26, 74, 138, 0.45);
}

#zynkro-chat-button:active {
    transform: scale(0.95);
}

/* Online Indicator Dot */
#zynkro-chat-button::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    border: 2.5px solid white;
    top: 3px;
    right: 3px;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

#zynkro-chat-button svg {
    width: 26px;
    height: 26px;
    fill: white;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* Notification Badge */
.zynkro-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--zyn-accent);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    display: none;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.zynkro-chat-badge.show { display: flex; }

/* ==========================================
   CHAT WINDOW
   ========================================== */
#zynkro-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 400px;
    height: 580px;
    background: white;
    border-radius: var(--zyn-radius);
    box-shadow: var(--zyn-shadow);
    z-index: 999999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#zynkro-chat-window.open { display: flex; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================
   CHAT HEADER
   ========================================== */
.zynkro-chat-header {
    background: linear-gradient(135deg, #1a4a8a 0%, #153a6a 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.zynkro-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zynkro-chat-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--zyn-accent), #e00038);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    box-shadow: 0 2px 8px rgba(255,0,63,0.3);
    letter-spacing: 0.5px;
}

.zynkro-chat-header-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.zynkro-chat-header-info span {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 400;
}

.zynkro-chat-header-actions button {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    opacity: 0.85;
    transition: all 0.2s;
}

.zynkro-chat-header-actions button:hover {
    opacity: 1;
    background: rgba(255,255,255,0.25);
}

/* ==========================================
   CHAT BODY
   ========================================== */
.zynkro-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zynkro-chat-body::-webkit-scrollbar { width: 5px; }
.zynkro-chat-body::-webkit-scrollbar-track { background: transparent; }
.zynkro-chat-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.zynkro-chat-body::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==========================================
   MESSAGES
   ========================================== */
.zynkro-message {
    max-width: 84%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.6;
    word-wrap: break-word;
    animation: msgIn 0.3s ease;
    position: relative;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Agent Message */
.zynkro-message-agent {
    background: white;
    color: var(--zyn-text);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    box-shadow: var(--zyn-shadow-sm);
}

/* Client Message */
.zynkro-message-client {
    background: linear-gradient(135deg, #1a4a8a 0%, #2563eb 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    margin-left: auto;
}

/* System Message */
.zynkro-message-system {
    background: #fefce8;
    color: #854d0e;
    align-self: center;
    font-size: 11.5px;
    border-radius: 20px;
    padding: 8px 16px;
    text-align: center;
    max-width: 92%;
    border: 1px solid #fde68a;
}

/* Bot/AI Message */
.zynkro-message-bot {
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    color: #5b21b6;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    border-left: 3px solid #7c3aed;
}

.zynkro-message-time {
    font-size: 10px;
    opacity: 0.55;
    margin-top: 4px;
    text-align: right;
}

/* ==========================================
   TYPING INDICATOR
   ========================================== */
.zynkro-typing {
    align-self: flex-start;
    display: none;
    padding: 10px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 6px;
    box-shadow: var(--zyn-shadow-sm);
}

.zynkro-typing.show {
    display: flex;
    gap: 5px;
    align-items: center;
}

.zynkro-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.zynkro-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.zynkro-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* ==========================================
   INPUT AREA
   ========================================== */
.zynkro-chat-input-area {
    display: flex;
    padding: 12px 16px;
    gap: 10px;
    border-top: 1px solid var(--zyn-border);
    background: white;
    align-items: flex-end;
    flex-shrink: 0;
}

.zynkro-chat-input-area textarea {
    flex: 1;
    border: 2px solid var(--zyn-border);
    border-radius: 24px;
    padding: 10px 18px;
    resize: none;
    font-size: 13.5px;
    font-family: inherit;
    max-height: 100px;
    min-height: 42px;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
    line-height: 1.4;
}

.zynkro-chat-input-area textarea:focus {
    border-color: var(--zyn-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 74, 138, 0.08);
}

.zynkro-chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF003F 0%, #e00038 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 0, 63, 0.3);
}

.zynkro-chat-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(255, 0, 63, 0.4);
}

.zynkro-chat-send-btn:active {
    transform: scale(0.95);
}

/* ==========================================
   RATING / CSAT
   ========================================== */
.zynkro-rating-area {
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--zyn-border);
    background: white;
    display: none;
}

.zynkro-rating-area.show { display: block; animation: slideUp 0.3s ease; }

.zynkro-rating-stars {
    font-size: 32px;
    cursor: pointer;
    margin: 10px 0;
}

.zynkro-rating-stars span {
    transition: all 0.2s;
    display: inline-block;
}

.zynkro-rating-stars span:hover { transform: scale(1.25); }

/* ==========================================
   BRANDING
   ========================================== */
.zynkro-branding {
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
    padding: 6px;
    background: #f8fafc;
    border-top: 1px solid var(--zyn-border);
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.zynkro-branding a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
}

.zynkro-branding a:hover { color: var(--zyn-primary); }

/* ==========================================
   AI SUGGESTIONS BAR
   ========================================== */
.zynkro-ai-suggestions {
    padding: 10px 14px;
    background: #f8fafc;
    border-top: 1px solid var(--zyn-border);
}

.zynkro-suggestion-btn {
    display: inline-block;
    margin: 3px;
    padding: 7px 13px;
    background: white;
    border: 2px solid var(--zyn-border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 500;
    transition: all 0.2s;
    color: #475569;
}

.zynkro-suggestion-btn:hover {
    background: linear-gradient(135deg, #1a4a8a, #2563eb);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 74, 138, 0.2);
}

/* ==========================================
   ACTION BAR (Agent Request / Ticket)
   ========================================== */
.zynkro-action-bar {
    padding: 10px 14px;
    background: #f8fafc;
    border-top: 1px solid var(--zyn-border);
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.zynkro-action-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    color: white;
}

.zynkro-action-btn.agent {
    background: linear-gradient(135deg, #1a4a8a, #2563eb);
    box-shadow: 0 2px 8px rgba(26, 74, 138, 0.25);
}

.zynkro-action-btn.agent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26, 74, 138, 0.35);
}

.zynkro-action-btn.ticket {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

.zynkro-action-btn.ticket:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */
@media (max-width: 480px) {
    #zynkro-chat-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    #zynkro-chat-button {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 16px;
    }
    
    .zynkro-message {
        max-width: 88%;
        font-size: 13px;
    }
}

/* ==========================================
   DARK MODE SUPPORT (Optional)
   ========================================== */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}