/* ============================================
   RentFlow Chatbot Styles
   Brand: Purple/Indigo gradient
   ============================================ */

.sk-chat-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: sk-pulse 2s infinite;
}
.sk-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.5);
}
.sk-chat-btn:active {
    transform: scale(0.92);
}
.sk-chat-btn svg {
    width: 26px;
    height: 26px;
}
.sk-chat-btn .sk-close-icon {
    display: none;
}
.sk-chat-btn.open .sk-chat-icon {
    display: none;
}
.sk-chat-btn.open .sk-close-icon {
    display: block;
}
.sk-chat-btn .sk-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: sk-bounce 0.6s ease;
}

@keyframes sk-pulse {
    0%,
    100% {
        box-shadow: 0 8px 32px rgba(124, 58, 237, 0.35);
    }
    50% {
        box-shadow: 0 8px 40px rgba(124, 58, 237, 0.55);
    }
}
@keyframes sk-bounce {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

.sk-chat-panel {
    position: fixed;
    bottom: 104px;
    right: 28px;
    z-index: 9998;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: none;
    flex-direction: column;
    transform-origin: bottom right;
    animation: sk-slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.sk-chat-panel.open {
    display: flex;
}

@keyframes sk-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sk-chat-header {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.sk-chat-header .sk-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    backdrop-filter: blur(4px);
}
.sk-chat-header .sk-info h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.sk-chat-header .sk-info p {
    font-size: 11px;
    opacity: 0.85;
    margin: 2px 0 0;
}
.sk-chat-header .sk-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    display: inline-block;
    margin-right: 4px;
    animation: sk-pulse-dot 1.5s infinite;
}

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

.sk-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
    scroll-behavior: smooth;
}
.sk-chat-messages::-webkit-scrollbar {
    width: 4px;
}
.sk-chat-messages::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.sk-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
    animation: sk-msgIn 0.3s ease;
}
@keyframes sk-msgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.sk-msg.bot {
    background: white;
    color: #334155;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}
.sk-msg.user {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.sk-msg a {
    color: #7c3aed;
    text-decoration: underline;
    font-weight: 600;
}
.sk-msg.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.sk-typing {
    display: none;
    align-self: flex-start;
    padding: 12px 14px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    gap: 4px;
}
.sk-typing.show {
    display: flex;
}
.sk-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    animation: sk-dotBounce 1.4s infinite;
}
.sk-typing span:nth-child(2) {
    animation-delay: 0.2s;
}
.sk-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

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

.sk-chat-input {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.sk-chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
    outline: none;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
}
.sk-chat-input input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.sk-chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.sk-chat-input button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}
.sk-chat-input button:active {
    transform: scale(0.95);
}
.sk-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sk-wa-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ecfdf5;
    color: #059669;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #a7f3d0;
    margin-top: 4px;
    transition: all 0.2s;
    text-decoration: none;
    width: fit-content;
}
.sk-wa-cta:hover {
    background: #d1fae5;
}

@media (max-width: 480px) {
    .sk-chat-btn {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
    .sk-chat-panel {
        bottom: 84px;
        right: 10px;
        width: calc(100vw - 20px);
        height: 460px;
        border-radius: 16px;
    }
}