/**
 * Hello Kitty Chat Widget Styles
 *
 * @package HelloKittyPants
 */

/* =====================
   TOGGLE BUTTON
   ===================== */

.hk-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #D4538A 0%, #ff4da6 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.4);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.hk-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 105, 180, 0.5);
}

.hk-chat-toggle .chat-icon {
    width: 28px;
    height: 28px;
    color: white;
}

.hk-chat-toggle.active {
    display: none;
}

/* =====================
   CHAT WINDOW
   ===================== */

.hk-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    z-index: 99998;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.hk-chat-window.open {
    display: flex;
    animation: hkSlideUp 0.3s ease;
}

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

/* =====================
   HEADER
   ===================== */

.hk-chat-header {
    background: linear-gradient(135deg, #D4538A 0%, #ff4da6 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.hk-chat-header .hk-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 3px;
    object-fit: contain;
}

.hk-chat-title {
    font-weight: 600;
    font-size: 15px;
    display: block;
}

.hk-chat-status {
    font-size: 12px;
    opacity: 0.9;
}

.hk-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.hk-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* =====================
   MESSAGES AREA
   ===================== */

.hk-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hk-message {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.hk-message-bot {
    flex-direction: row;
}

.hk-message-user {
    flex-direction: row-reverse;
}

.hk-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
    padding: 2px;
    flex-shrink: 0;
}

.hk-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.hk-message-bot .hk-message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hk-message-user .hk-message-bubble {
    background: #D4538A;
    color: white;
    border-bottom-right-radius: 4px;
}

.hk-message-bubble a {
    color: #D4538A;
    font-weight: 500;
}

.hk-message-user .hk-message-bubble a {
    color: white;
    text-decoration: underline;
}

/* =====================
   QUICK REPLIES
   ===================== */

.hk-chat-quick-replies {
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: white;
    border-top: 1px solid #f0f0f0;
}

.hk-quick-btn {
    background: #fff5f8;
    border: 1px solid #ffcce0;
    color: #D4538A;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.hk-quick-btn:hover {
    background: #D4538A;
    border-color: #D4538A;
    color: white;
}

/* =====================
   INPUT AREA
   ===================== */

.hk-chat-input-area {
    padding: 15px;
    display: flex;
    gap: 10px;
    background: white;
    border-top: 1px solid #f0f0f0;
}

.hk-chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hk-chat-input:focus {
    border-color: #D4538A;
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.hk-chat-input::placeholder {
    color: #aaa;
}

.hk-chat-send {
    width: 45px;
    height: 45px;
    background: #D4538A;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.hk-chat-send:hover {
    background: #ff4da6;
    transform: scale(1.05);
}

.hk-chat-send svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* =====================
   TYPING INDICATOR
   ===================== */

.hk-typing-dots {
    display: inline-flex;
    gap: 4px;
}

.hk-typing-dots span {
    animation: hkTypingBounce 1.4s infinite;
    font-size: 20px;
    line-height: 1;
}

.hk-typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.hk-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.hk-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes hkTypingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Disabled state for input/button */
.hk-chat-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.hk-chat-send:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* =====================
   MOBILE RESPONSIVE
   ===================== */

@media (max-width: 480px) {
    .hk-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .hk-chat-window.open {
        border-radius: 0;
    }

    .hk-chat-toggle {
        bottom: 15px;
        right: 15px;
    }
}
