/* ==========================================================================
   HaiZuka Academy - AI Course Counseling Chatbot Styles
   ========================================================================== */

/* Floating Toggle Button - Matching Facebook & Zalo Squircle Shape & Column Alignment */
.haizuka-chat-toggle {
    position: fixed !important;
    bottom: 144px !important;
    right: 20px !important;
    left: auto !important;
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #7367f0 0%, #9e5cf7 100%) !important;
    box-shadow: 0 4px 14px rgba(115, 103, 240, 0.45) !important;
    border: none !important;
    color: #ffffff !important;
    cursor: pointer !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.25s ease !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.haizuka-chat-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 18px rgba(115, 103, 240, 0.6);
}

.haizuka-chat-toggle:active {
    transform: scale(0.95);
}

.haizuka-chat-toggle .haizuka-icon-chat,
.haizuka-chat-toggle .haizuka-icon-close {
    width: 26px;
    height: 26px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    color: #ffffff;
}

.haizuka-chat-toggle .haizuka-icon-chat {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.haizuka-chat-toggle .haizuka-icon-close {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

.haizuka-chat-toggle.active .haizuka-icon-chat {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.haizuka-chat-toggle.active .haizuka-icon-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Badge Pulse Glow */
.haizuka-chat-toggle::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(115, 103, 240, 0.6) 0%, rgba(168, 85, 247, 0) 70%);
    animation: haizuka-pulse 2.2s infinite;
    pointer-events: none;
}

.haizuka-chat-toggle:not(.active)::before {
    opacity: 0.8;
}

@keyframes haizuka-pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

/* Floating Tooltip Callout */
.haizuka-chat-tooltip {
    position: fixed;
    bottom: 150px;
    right: 84px;
    background: #ffffff;
    color: #2b2c40;
    padding: 10px 16px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    font-weight: 700;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    animation: haizuka-bounce-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    border: 1px solid rgba(115, 103, 240, 0.2);
}

.haizuka-chat-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-top: 1px solid rgba(115, 103, 240, 0.2);
    border-right: 1px solid rgba(115, 103, 240, 0.2);
}

@keyframes haizuka-bounce-in {
    0% {
        opacity: 0;
        transform: translateX(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Chat Window Modal */
.haizuka-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 390px;
    min-width: 310px;
    max-width: calc(100vw - 20px);
    height: 600px;
    min-height: 380px;
    max-height: calc(100vh - 40px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(115, 103, 240, 0.1);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(24px) scale(0.95);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.haizuka-chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* 8-Directional Resizer Handles (All borders & corners) */
.haizuka-resizer {
    position: absolute;
    z-index: 10005;
}

.haizuka-resizer-n { top: -4px; left: 12px; right: 12px; height: 8px; cursor: ns-resize; }
.haizuka-resizer-s { bottom: -4px; left: 12px; right: 12px; height: 8px; cursor: ns-resize; }
.haizuka-resizer-e { right: -4px; top: 12px; bottom: 12px; width: 8px; cursor: ew-resize; }
.haizuka-resizer-w { left: -4px; top: 12px; bottom: 12px; width: 8px; cursor: ew-resize; }

.haizuka-resizer-ne { top: -4px; right: -4px; width: 14px; height: 14px; cursor: nesw-resize; }
.haizuka-resizer-nw { top: -4px; left: -4px; width: 14px; height: 14px; cursor: nwse-resize; }
.haizuka-resizer-se { bottom: -4px; right: -4px; width: 14px; height: 14px; cursor: nwse-resize; }
.haizuka-resizer-sw { bottom: -4px; left: -4px; width: 14px; height: 14px; cursor: nesw-resize; }

/* Dark theme support */
html.dark-style .haizuka-chat-window,
body.dark-mode .haizuka-chat-window {
    background: #2b2c40;
    color: #d0d4f1;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Chat Header */
.haizuka-chat-header {
    background: linear-gradient(135deg, #7367f0 0%, #9e5cf7 50%, #6366f1 100%);
    color: #ffffff;
    padding: 14px 18px;
    cursor: grab;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(115, 103, 240, 0.25);
    position: relative;
    z-index: 2;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.haizuka-chat-header:active {
    cursor: grabbing;
}

.haizuka-chat-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.haizuka-avatar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}

.haizuka-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    padding: 3px;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.haizuka-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background-color: #28c76f;
    border: 2px solid #7367f0;
    border-radius: 50%;
}

.haizuka-chat-title-text h6 {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.haizuka-chat-title-text span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    display: block;
}

.haizuka-chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.haizuka-btn-icon {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.haizuka-btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Header Action Dropdown Menu */
.haizuka-action-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.haizuka-action-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.08);
    min-width: 210px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 10010;
}

.dark-style .haizuka-action-dropdown,
html.dark-style .haizuka-action-dropdown,
html[data-theme="dark"] .haizuka-action-dropdown,
[data-bs-theme="dark"] .haizuka-action-dropdown {
    background: #2f3349;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.haizuka-action-dropdown.show {
    display: flex;
    animation: haizuka-dropdown-fade 0.2s ease forwards;
}

@keyframes haizuka-dropdown-fade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.haizuka-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #33303c;
    text-decoration: none !important;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.dark-style .haizuka-dropdown-item,
html.dark-style .haizuka-dropdown-item,
html[data-theme="dark"] .haizuka-dropdown-item,
[data-bs-theme="dark"] .haizuka-dropdown-item {
    color: #cfd3ec;
}

.haizuka-dropdown-item:hover {
    background: rgba(115, 103, 240, 0.08);
    color: #7367f0;
}

.haizuka-dropdown-item.text-danger {
    color: #ea5455;
}

.haizuka-dropdown-item.text-danger:hover {
    background: rgba(234, 84, 85, 0.1);
    color: #ea5455;
}

/* Custom Reset Confirmation Modal Overlay & Card */
.haizuka-custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 20, 34, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.haizuka-custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.haizuka-custom-modal-card {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(10px);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid rgba(115, 103, 240, 0.15);
}

.haizuka-custom-modal-overlay.active .haizuka-custom-modal-card {
    transform: scale(1) translateY(0);
}

.dark-style .haizuka-custom-modal-card,
html.dark-style .haizuka-custom-modal-card,
html[data-theme="dark"] .haizuka-custom-modal-card,
[data-bs-theme="dark"] .haizuka-custom-modal-card {
    background: #2f3349;
    color: #cfd3ec;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.haizuka-custom-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.haizuka-custom-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(234, 84, 85, 0.12);
    color: #ea5455;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.haizuka-custom-modal-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #33303c;
}

.dark-style .haizuka-custom-modal-header h5,
html.dark-style .haizuka-custom-modal-header h5,
html[data-theme="dark"] .haizuka-custom-modal-header h5,
[data-bs-theme="dark"] .haizuka-custom-modal-header h5 {
    color: #ffffff;
}

.haizuka-custom-modal-body {
    font-size: 0.9rem;
    color: #5d596c;
    line-height: 1.5;
}

.dark-style .haizuka-custom-modal-body,
html.dark-style .haizuka-custom-modal-body,
html[data-theme="dark"] .haizuka-custom-modal-body,
[data-bs-theme="dark"] .haizuka-custom-modal-body {
    color: #b6bee3;
}

.haizuka-custom-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.haizuka-modal-btn {
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.haizuka-modal-btn-cancel {
    background: #f1f0f7;
    color: #6e6b7b;
}

.dark-style .haizuka-modal-btn-cancel,
html.dark-style .haizuka-modal-btn-cancel,
html[data-theme="dark"] .haizuka-modal-btn-cancel,
[data-bs-theme="dark"] .haizuka-modal-btn-cancel {
    background: #363b54;
    color: #b6bee3;
}

.haizuka-modal-btn-cancel:hover {
    background: #e2e0ed;
}

.haizuka-modal-btn-confirm {
    background: linear-gradient(135deg, #ea5455 0%, #ff4d4f 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(234, 84, 85, 0.35);
}

.haizuka-modal-btn-confirm:hover {
    box-shadow: 0 6px 16px rgba(234, 84, 85, 0.5);
    transform: translateY(-1px);
}

/* Config Settings Panel */
.haizuka-chat-config-panel {
    background: #f8f7fa;
    border-bottom: 1px solid #e7e7e8;
    padding: 12px 16px;
    font-size: 12px;
    display: none;
    animation: haizuka-slide-down 0.25s ease forwards;
}

html.dark-style .haizuka-chat-config-panel {
    background: #232333;
    border-bottom: 1px solid #3b3c54;
    color: #d0d4f1;
}

.haizuka-chat-config-panel.active {
    display: block;
}

@keyframes haizuka-slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.haizuka-chat-config-panel label {
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

.haizuka-chat-config-panel input {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #d9ade8;
    font-size: 12px;
    outline: none;
}

/* Chat Messages Container */
.haizuka-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8f7fa;
    scroll-behavior: smooth;
}

html.dark-style .haizuka-chat-messages {
    background: #232333;
}

/* Scrollbar styling */
.haizuka-chat-messages::-webkit-scrollbar {
    width: 5px;
}
.haizuka-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(115, 103, 240, 0.25);
    border-radius: 4px;
}

/* Message Rows */
.haizuka-msg-row {
    display: flex;
    gap: 10px;
    max-width: 85%;
    align-items: flex-end;
    animation: haizuka-msg-fade 0.3s ease forwards;
}

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

.haizuka-msg-row.haizuka-msg-bot {
    align-self: flex-start;
}

.haizuka-msg-row.haizuka-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.haizuka-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: contain;
    background: transparent;
    padding: 2px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    border: 1.5px solid rgba(115, 103, 240, 0.25);
}

html.dark-style .haizuka-msg-avatar,
.dark-style .haizuka-msg-avatar {
    background: transparent;
    border-color: rgba(115, 103, 240, 0.4);
}

.haizuka-msg-content {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}

.haizuka-msg-bot .haizuka-msg-content {
    background: #ffffff;
    color: #2b2c40;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

html.dark-style .haizuka-msg-bot .haizuka-msg-content {
    background: #2f3349;
    color: #d0d4f1;
    border-color: rgba(255, 255, 255, 0.05);
}

.haizuka-msg-user .haizuka-msg-content {
    background: linear-gradient(135deg, #7367f0 0%, #8054c7 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(115, 103, 240, 0.3);
}

.haizuka-msg-content p {
    margin: 0 0 8px 0;
}
.haizuka-msg-content p:last-child {
    margin-bottom: 0;
}

.haizuka-msg-content ul,
.haizuka-msg-content ol {
    margin: 4px 0 8px 18px;
    padding: 0;
}

.haizuka-msg-content a {
    color: #7367f0;
    font-weight: 600;
    text-decoration: underline;
}
.haizuka-msg-user .haizuka-msg-content a {
    color: #ffffff;
}

/* Typing Indicator */
.haizuka-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #ffffff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

html.dark-style .haizuka-typing-indicator {
    background: #2f3349;
}

.haizuka-typing-dot {
    width: 7px;
    height: 7px;
    background-color: #7367f0;
    border-radius: 50%;
    animation: haizuka-typing-bounce 1.4s infinite ease-in-out both;
}

.haizuka-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.haizuka-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes haizuka-typing-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Quick Suggestion Chips */
.haizuka-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.haizuka-chip-btn {
    background: rgba(115, 103, 240, 0.08);
    color: #7367f0;
    border: 1px solid rgba(115, 103, 240, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.haizuka-chip-btn:hover {
    background: #7367f0;
    color: #ffffff;
    border-color: #7367f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(115, 103, 240, 0.3);
}

/* Visual Course Card in Chat */
.haizuka-course-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(115, 103, 240, 0.2);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    margin: 10px 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html.dark-style .haizuka-course-card {
    background: #2b2c40;
    border-color: rgba(255, 255, 255, 0.12);
}

.haizuka-course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(115, 103, 240, 0.25);
}

.haizuka-card-banner {
    width: 100%;
    height: 95px;
    object-fit: cover;
    background: linear-gradient(135deg, #7367f0, #9e5cf7);
}

.haizuka-card-body {
    padding: 10px 12px;
}

.haizuka-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #2b2c40;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

html.dark-style .haizuka-card-title {
    color: #ffffff;
}

.haizuka-card-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    margin-bottom: 8px;
    gap: 4px;
    flex-wrap: wrap;
}

.haizuka-card-price {
    color: #28c76f;
    font-weight: 700;
}

.haizuka-card-lessons {
    color: #7367f0;
    font-weight: 600;
}

.haizuka-card-duration {
    color: #a1acb8;
    font-size: 11px;
}

.haizuka-card-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, #7367f0 0%, #8054c7 100%);
    color: #ffffff !important;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 4px 10px rgba(115, 103, 240, 0.3);
    transition: all 0.2s ease;
}

.haizuka-card-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 14px rgba(115, 103, 240, 0.45);
}

/* Chat Footer Input */
.haizuka-chat-footer {
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

html.dark-style .haizuka-chat-footer {
    background: #2b2c40;
    border-top-color: rgba(255, 255, 255, 0.06);
}

.haizuka-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f7fa;
    border-radius: 24px;
    padding: 4px 6px 4px 14px;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}

html.dark-style .haizuka-input-wrapper {
    background: #232333;
}

.haizuka-input-wrapper:focus-within {
    border-color: #7367f0;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.15);
}

html.dark-style .haizuka-input-wrapper:focus-within {
    background: #232333;
}

/* Image Preview Area in Footer */
.haizuka-img-preview-container {
    display: flex;
    gap: 8px;
    padding: 6px 4px 2px 4px;
    overflow-x: auto;
    max-width: 100%;
}

.haizuka-img-preview-item {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid #7367f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.haizuka-img-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.haizuka-img-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: none;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.haizuka-img-preview-remove:hover {
    background: #ea5455;
}

/* Image Attachment Button */
.haizuka-attach-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    color: #7367f0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.haizuka-attach-btn:hover {
    background: rgba(115, 103, 240, 0.12);
    transform: scale(1.08);
}

/* Image thumbnails inside chat bubbles */
.haizuka-msg-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.haizuka-msg-img-thumb {
    max-width: 180px;
    max-height: 140px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.haizuka-msg-img-thumb:hover {
    transform: scale(1.03);
}

/* QR Code & Inline Image Card Styling */
.haizuka-msg-img-container {
    margin: 10px 0;
    text-align: center;
}

.haizuka-msg-qr-img {
    max-width: 100%;
    width: 240px;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(115, 103, 240, 0.25);
    border: 1.5px solid rgba(115, 103, 240, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.haizuka-msg-qr-img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 22px rgba(115, 103, 240, 0.4);
}

.haizuka-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13.5px;
    outline: none;
    color: inherit;
    padding: 6px 0;
    resize: none;
    max-height: 80px;
}

.haizuka-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7367f0 0%, #8054c7 100%);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.haizuka-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(115, 103, 240, 0.4);
}

.haizuka-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.haizuka-chat-subtext {
    font-size: 10px;
    color: #a1acb8;
    text-align: center;
}

/* Mobile responsiveness - Optimized dimensions, floating card style, comfortable reading height */
@media (max-width: 768px) {
    .haizuka-chat-window {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        top: auto !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        height: 75dvh !important;
        height: 75vh !important;
        max-height: calc(100dvh - 60px) !important;
        border-radius: 18px !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(115, 103, 240, 0.2) !important;
        margin: 0 !important;
    }
    .haizuka-chat-toggle {
        bottom: 144px !important;
        right: 20px !important;
        left: auto !important;
        width: 48px !important;
        height: 48px !important;
        border-radius: 14px !important;
    }
    .haizuka-chat-tooltip {
        display: none;
    }
    .haizuka-chat-messages {
        padding: 12px 14px;
    }
}
