/* ==========================================
   NIXX DATA HUB - CUSTOMER SUPPORT WIDGET
   Visual layer only. customer-support.js builds the markup
   (button, panel, WhatsApp link, Nixx Assistant chat) and
   still controls everything that opens, closes or sends.
========================================== */

.nixx-support {
    position: fixed;
    right: 16px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: 55;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Floating button: the "?" the script writes is replaced by a chat icon */
.nixx-support-button {
    position: relative;
    width: 56px;
    height: 56px;
    border: 3px solid #ffffff;
    border-radius: 20px;
    font-size: 0;
    color: transparent;
    background-color: #1459d9;
    background-image: linear-gradient(160deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20.5l1.4-4.6A8 8 0 1 1 21 12z'/%3E%3Cpath d='M9 11.5h.01M12 11.5h.01M15 11.5h.01' stroke-width='2.6'/%3E%3C/svg%3E");
    background-size: auto, 26px;
    background-position: center, center;
    background-repeat: no-repeat;
    box-shadow: 0 14px 28px -10px rgba(13, 70, 184, 0.75), 0 2px 6px rgba(11, 27, 58, 0.15);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.2s ease, background-color 0.2s ease;
}

.nixx-support-button:hover {
    background-color: #0d46b8;
    transform: translateY(-2px);
}

.nixx-support-button:active { transform: scale(0.95); }

.nixx-support-button:focus-visible {
    outline: 3px solid #5a93f5;
    outline-offset: 3px;
}

.nixx-support-panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: min(380px, calc(100vw - 32px));
    max-height: min(540px, calc(100dvh - 190px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    color: #0b1b3a;
    border: 1px solid #dde6f3;
    border-radius: 22px;
    box-shadow: 0 28px 60px -20px rgba(6, 17, 40, 0.5);
    animation: nixx-pop 0.22s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    transform-origin: bottom right;
}

@keyframes nixx-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.nixx-support-panel[hidden],
.nixx-chatbot-area[hidden],
.nixx-support-options[hidden] {
    display: none !important;
}

.nixx-support-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 18px 18px 20px;
    color: #ffffff;
    background:
        radial-gradient(260px 140px at 100% 0%, rgba(90, 147, 245, 0.55), transparent 70%),
        linear-gradient(150deg, #0d46b8, #0a1b3f);
}

.nixx-support-header strong {
    display: block;
    font-size: 16.5px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.nixx-support-header span {
    display: block;
    margin-top: 2px;
    color: #c3d5f5;
    font-size: 13.5px;
    font-weight: 500;
}

.nixx-support-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.nixx-support-close:hover { background: rgba(255, 255, 255, 0.24); }
.nixx-support-close:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }

.nixx-support-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
}

.nixx-support-option {
    display: block;
    width: 100%;
    padding: 14px 16px 14px 60px;
    position: relative;
    border: 1.5px solid #dde6f3;
    border-radius: 16px;
    background: #ffffff;
    color: #0b1b3a;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.18s ease;
}

.nixx-support-option::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 34px;
    height: 34px;
    margin-top: -17px;
    border-radius: 11px;
    background-color: #eef4ff;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 19px;
}

.nixx-support-option.whatsapp::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231459d9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20.5l1.4-4.6A8 8 0 1 1 21 12z'/%3E%3C/svg%3E");
}

.nixx-support-option.chatbot::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231459d9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='8' width='16' height='11' rx='3'/%3E%3Cpath d='M12 4v4M9 13.5h.01M15 13.5h.01'/%3E%3C/svg%3E");
}

.nixx-support-option:hover {
    border-color: #5a93f5;
    background: #f4f8ff;
}

.nixx-support-option:active { transform: scale(0.99); }
.nixx-support-option:focus-visible { outline: 3px solid #2f74f0; outline-offset: 2px; }

.nixx-support-option strong,
.nixx-support-option span {
    display: block;
}

.nixx-support-option strong {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.nixx-support-option span {
    margin-top: 2px;
    color: #5b6b86;
    font-size: 13px;
    line-height: 1.4;
}

.nixx-chatbot-area {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    background: #f4f8ff;
}

.nixx-chat-messages {
    flex: 1;
    min-height: 140px;
    max-height: 260px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    overflow-y: auto;
}

.nixx-chat-message {
    max-width: 86%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14.5px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    animation: nixx-pop 0.2s ease both;
}

.nixx-chat-message.bot {
    align-self: flex-start;
    border: 1px solid #dde6f3;
    border-bottom-left-radius: 5px;
    background: #ffffff;
    color: #0b1b3a;
}

.nixx-chat-message.user {
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    background: #1459d9;
    color: #ffffff;
}

.nixx-chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 16px 12px;
}

.nixx-chat-quick button {
    min-height: 40px;
    padding: 0 14px;
    border: 1.5px solid #cfdcf2;
    border-radius: 999px;
    background: #ffffff;
    color: #0d46b8;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nixx-chat-quick button:hover {
    border-color: #2f74f0;
    background: #eef4ff;
}

.nixx-chat-form {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #dde6f3;
    background: #ffffff;
}

.nixx-chat-input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid #dde6f3;
    border-radius: 14px;
    background: #ffffff;
    color: #0b1b3a;
    font-family: inherit;
    font-size: 16px;
}

.nixx-chat-input::placeholder { color: #8493ad; }

.nixx-chat-input:focus {
    outline: none;
    border-color: #2f74f0;
    box-shadow: 0 0 0 3px rgba(47, 116, 240, 0.28);
}

.nixx-chat-form button {
    flex-shrink: 0;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: #1459d9;
    color: #ffffff;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.nixx-chat-form button:hover { background: #0d46b8; }

@media (min-width: 900px) {
    .nixx-support { right: 28px; bottom: 28px; }
}

@media (max-width: 480px) {
    .nixx-support { right: 12px; }
    .nixx-support-panel { right: -2px; width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
    .nixx-support-panel, .nixx-chat-message { animation: none; }
    .nixx-support-button, .nixx-support-option { transition: none; }
}
