/* ================================================================
   KRYZON AI — Sleek Minimalist UI (Small Fonts & Clean Aesthetic)
   ================================================================ */

#krazy-chat-container {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* --- SLEEK FLOATING TOGGLE BUTTON --- */
#krazy-chat-toggle {
    width: 50px !important;
    height: 50px !important;
    border-radius: 14px !important;
    background: #E51923 !important;
    border: none !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(229, 25, 35, 0.35) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

#krazy-chat-toggle:hover {
    transform: scale(1.06) !important;
    box-shadow: 0 6px 18px rgba(229, 25, 35, 0.5) !important;
}

/* --- SLEEK CHAT WINDOW --- */
#krazy-chat-window {
    position: absolute !important;
    bottom: 66px !important;
    right: 0 !important;
    width: 350px !important;
    height: 500px !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transition: all 0.25s ease !important;
    transform-origin: bottom right !important;
}

#krazy-chat-window.krazy-hidden {
    opacity: 0 !important;
    transform: scale(0.9) translateY(15px) !important;
    pointer-events: none !important;
}

/* --- HEADER --- */
.krazy-chat-header {
    background: #E51923 !important;
    color: #ffffff !important;
    padding: 12px 16px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.krazy-header-info {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.krazy-status-dot {
    width: 7px !important;
    height: 7px !important;
    background: #22c55e !important;
    border-radius: 50% !important;
}

.krazy-title {
    font-weight: 600 !important;
    font-size: 13.5px !important;
    letter-spacing: 0.2px !important;
    color: #ffffff !important;
}

#krazy-chat-close {
    background: none !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 4px !important;
}

#krazy-chat-close:hover {
    color: #ffffff !important;
}

/* --- MESSAGES AREA --- */
.krazy-chat-messages {
    flex: 1 !important;
    padding: 14px 16px !important;
    overflow-y: auto !important;
    background: #fafafa !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.krazy-msg {
    max-width: 82% !important;
    padding: 10px 14px !important;
    font-size: 12.5px !important;
    line-height: 1.45 !important;
    word-wrap: break-word !important;
}

.krazy-msg-bot {
    background: #ffffff !important;
    color: #1f2937 !important;
    align-self: flex-start !important;
    border-radius: 12px 12px 12px 3px !important;
    border: 1px solid #e5e7eb !important;
}

.krazy-msg-user {
    background: #E51923 !important;
    color: #ffffff !important;
    align-self: flex-end !important;
    border-radius: 12px 12px 3px 12px !important;
}

.krazy-msg a {
    color: inherit !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
}

.krazy-msg-bot a {
    color: #E51923 !important;
}

.krazy-msg-user a {
    color: #ffffff !important;
}

.krazy-msg-image {
    max-width: 100% !important;
    border-radius: 8px !important;
    margin-bottom: 6px !important;
    display: block !important;
}

/* TYPING INDICATOR */
.krazy-typing {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 10px 14px !important;
}

.krazy-typing span {
    width: 5px !important;
    height: 5px !important;
    background: #9ca3af !important;
    border-radius: 50% !important;
    animation: krazy-bounce 1.4s infinite ease-in-out both !important;
}

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

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

/* --- ACTION CHIPS --- */
.krazy-chat-suggestions {
    padding: 8px 14px !important;
    background: #ffffff !important;
    border-top: 1px solid #f3f4f6 !important;
    display: flex !important;
    gap: 6px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
}
.krazy-chat-suggestions::-webkit-scrollbar { display: none !important; }

.krazy-chip {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 5px 11px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    color: #4b5563 !important;
    transition: all 0.15s ease !important;
}

.krazy-chip:hover {
    background: #fff5f5 !important;
    border-color: #E51923 !important;
    color: #E51923 !important;
}

/* --- IMAGE PREVIEW CONTAINER FIX (HIDDEN BY DEFAULT) --- */
.krazy-image-preview-container {
    padding: 8px 14px !important;
    background: #ffffff !important;
    border-top: 1px solid #f3f4f6 !important;
    position: relative !important;
    display: none !important; /* HIDDEN BY DEFAULT */
    align-items: center !important;
    gap: 8px !important;
}

#krazy-image-preview {
    height: 44px !important;
    border-radius: 6px !important;
    object-fit: cover !important;
    border: 1px solid #e5e7eb !important;
}

#krazy-image-remove {
    background: #ef4444 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 11px !important;
}

/* --- INPUT AREA --- */
.krazy-chat-input-area {
    display: flex !important;
    padding: 10px 14px !important;
    background: #ffffff !important;
    border-top: 1px solid #f3f4f6 !important;
    gap: 8px !important;
    align-items: center !important;
}

#krazy-chat-input {
    flex: 1 !important;
    border: 1px solid #e5e7eb !important;
    background: #f9fafb !important;
    padding: 8px 12px !important;
    border-radius: 16px !important;
    outline: none !important;
    font-size: 12.5px !important;
    color: #111827 !important;
}

#krazy-chat-input:focus {
    border-color: #E51923 !important;
    background: #ffffff !important;
}

#krazy-image-btn {
    background: none !important;
    border: none !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#krazy-image-btn:hover {
    color: #E51923 !important;
}

#krazy-chat-send {
    background: #E51923 !important;
    border: none !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
}

#krazy-chat-send:hover {
    background: #c9141e !important;
}

@media (max-width: 480px) {
    #krazy-chat-window {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
    }
}
