/**
 * SideKick360 AI Chatbot Styles
 */

/* ---------- Toggle Button ---------- */
#sk-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#sk-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5);
}

#sk-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: sk-badge-pulse 2s infinite;
}

@keyframes sk-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ---------- Chat Window ---------- */
#sk-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sk-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ---------- Header ---------- */
#sk-chat-header {
    background: #2563eb;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#sk-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#sk-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.5px;
}

#sk-chat-header-title {
    font-weight: 700;
    font-size: 16px;
}

#sk-chat-header-status {
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 6px;
}

#sk-chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    animation: sk-dot-pulse 2s infinite;
}

@keyframes sk-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#sk-chat-minimize {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

#sk-chat-minimize:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* ---------- Messages ---------- */
#sk-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

#sk-chat-messages::-webkit-scrollbar {
    width: 4px;
}

#sk-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#sk-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.sk-chat-msg {
    display: flex;
    max-width: 85%;
    animation: sk-msg-in 0.3s ease;
}

@keyframes sk-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

.sk-chat-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.sk-chat-bot .sk-chat-bubble {
    background: #fff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sk-chat-user .sk-chat-bubble {
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.sk-typing {
    display: flex;
    gap: 5px;
    padding: 16px 20px !important;
}

.sk-typing span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: sk-typing-bounce 1.4s infinite ease-in-out;
}

.sk-typing span:nth-child(1) { animation-delay: 0s; }
.sk-typing span:nth-child(2) { animation-delay: 0.2s; }
.sk-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes sk-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* ---------- Input Area ---------- */
#sk-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}

#sk-chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

#sk-chat-input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    padding: 10px 18px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
    background: #f8fafc;
}

#sk-chat-input:focus {
    border-color: #2563eb;
    background: #fff;
}

#sk-chat-input::placeholder {
    color: #94a3b8;
}

#sk-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#sk-chat-send:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

#sk-chat-powered {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 8px;
}

/* ---------- Booking Button ---------- */
.sk-chat-book-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2563eb;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin: 4px 0 4px 40px;
    transition: background 0.2s;
}
.sk-chat-book-btn:hover {
    background: #1d4ed8;
}
.sk-chat-book-btn svg {
    flex-shrink: 0;
}

/* ---------- Handoff Form ---------- */
.sk-handoff-form {
    padding: 16px !important;
}
.sk-handoff-input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
}
.sk-handoff-input:focus {
    border-color: #2563eb;
    background: #fff;
}
.sk-handoff-input::placeholder {
    color: #94a3b8;
}
select.sk-handoff-input {
    color: #1e293b;
    cursor: pointer;
}
.sk-handoff-submit {
    display: block;
    width: 100%;
    padding: 10px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
    margin-top: 4px;
}
.sk-handoff-submit:hover {
    background: #1d4ed8;
}
.sk-handoff-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
    #sk-chat-window {
        width: calc(100vw - 16px);
        height: calc(100vh - 120px);
        bottom: 88px;
        right: 8px;
        border-radius: 12px;
    }

    #sk-chat-toggle {
        bottom: 16px;
        right: 16px;
    }
}
