:root {
    --chat-accent: #2DCAEE;
    --chat-bg: rgba(17, 17, 17, 0.9);
    --chat-glass: rgba(255, 255, 255, 0.05);
    --chat-border: rgba(255, 255, 255, 0.1);
}

.ai-chat-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%);
    border-radius: 50%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 198, 255, 0.3);
    border: none;
    transition: transform 0.3s;
    cursor: pointer;
}

.ai-chat-trigger i {
    color: white;
    font-size: 26px;
}

.ai-chat-container {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: var(--chat-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--chat-border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ai-chat-header {
    padding: 20px;
    background: var(--chat-glass);
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    background: var(--chat-accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-avatar i {
    color: white;
}

.ai-chat-status {
    font-size: 0.7rem;
    color: var(--chat-accent);
}

.ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.msg-ai {
    align-self: flex-start;
    background: var(--chat-glass);
    border: 1px solid var(--chat-border);
    color: white;
}

.msg-user {
    align-self: flex-end;
    background: var(--chat-accent);
    color: #000;
    font-weight: 500;
}

.ai-chat-footer {
    padding: 15px;
    background: var(--chat-glass);
    border-top: 1px solid var(--chat-border);
}

.ai-chat-input-wrapper {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 5px 12px;
    align-items: center;
}

.ai-chat-input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    padding: 8px 0;
    outline: none;
}

.ai-chat-send {
    background: none;
    border: none;
    color: var(--chat-accent);
    cursor: pointer;
}

/* Tombol Pilihan */
.chat-btn {
    display: inline-block;
    margin: 4px 4px 0 0;
    padding: 7px 14px;
    background: linear-gradient(135deg, var(--chat-accent), #1a9cb8);
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.chat-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.chat-btn:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

/* Pesan Admin */
.msg-admin .chat-bubble {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-admin-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.chat-admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--chat-accent);
}

.chat-admin-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--chat-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.chat-admin-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--chat-accent);
}

/* Typing Indicator */
.chat-typing .chat-bubble {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chat-accent);
    opacity: 0.5;
    animation: typing 1.2s ease-in-out infinite;
}

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

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

@keyframes typing {

    0%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Bubble wrapper */
.chat-msg-wrap {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.msg-user {
    align-items: flex-end;
}

.msg-ai,
.msg-admin {
    align-items: flex-start;
}

.msg-user .chat-bubble {
    background: var(--chat-accent);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
    padding: 10px 14px;
    max-width: 80%;
}

.msg-ai .chat-bubble,
.msg-admin .chat-bubble {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 18px 18px 18px 4px;
    padding: 10px 14px;
    max-width: 85%;
}

/* ============================================
   CHAT — MISSING STYLES (TAMBAHKAN KE AKHIR)
   ============================================ */

/* Badge notifikasi pada trigger */
.chat-trigger-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #FF4757;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
}

/* Hover effect trigger */
.ai-chat-trigger:hover {
    transform: scale(1.08);
}

/* Header: flex space-between untuk tabs + close */
.ai-chat-header {
    justify-content: space-between !important;
    padding: 12px 14px !important;
}

/* ---- TABS ---- */
.ai-chat-tabs {
    display: flex;
    gap: 6px;
    flex: 1;
}

.chat-tab {
    flex: 1;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid var(--chat-border);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

.chat-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

.chat-tab.active {
    background: linear-gradient(135deg, var(--chat-accent), #1a9cb8);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(45, 202, 238, 0.3);
}

/* ---- CLOSE BUTTON ---- */
.ai-chat-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--chat-border);
    color: rgba(255, 255, 255, 0.5);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-chat-close:hover {
    background: rgba(255, 80, 80, 0.2);
    color: #FF6B6B;
}

/* ---- PANELS ---- */
.ai-chat-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.ai-chat-panel.active {
    display: flex;
}

/* ---- FOOTER (flex row langsung, tanpa wrapper) ---- */
.ai-chat-footer {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}

.ai-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid var(--chat-border) !important;
    border-radius: 12px !important;
    padding: 9px 14px !important;
    font-size: 13px;
}

.ai-chat-input:focus {
    border-color: rgba(45, 202, 238, 0.5) !important;
    outline: none;
}

.ai-chat-send {
    background: linear-gradient(135deg, var(--chat-accent), #1a9cb8) !important;
    width: 38px;
    height: 38px;
    border-radius: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s;
    box-shadow: 0 4px 12px rgba(45, 202, 238, 0.25);
}

.ai-chat-send:hover {
    transform: scale(1.08);
}

/* ---- ADMIN WELCOME SCREEN ---- */
.chat-admin-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
    gap: 8px;
    height: 100%;
}

.chat-admin-welcome-icon {
    font-size: 40px;
    margin-bottom: 6px;
}

.chat-admin-welcome h4 {
    color: white;
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.chat-admin-welcome p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

/* ---- STATUS ---- */
.chat-status-online {
    font-size: 11px;
    font-weight: 700;
    color: #2ECC71;
    margin-top: 8px;
    display: inline-block;
}

.chat-status-offline {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
    display: inline-block;
}

/* ---- CLOSED OVERLAY ---- */
.chat-closed-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 15, 0.97);
    backdrop-filter: blur(10px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    gap: 10px;
}

.chat-closed-icon {
    font-size: 48px;
}

.chat-closed-overlay h4 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.chat-closed-overlay p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin: 0 0 8px;
}

/* ---- BRANDING FOOTER ---- */
.chat-branding {
    padding: 7px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--chat-border);
    text-align: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.28);
    flex-shrink: 0;
}

.chat-branding strong {
    color: rgba(255, 255, 255, 0.5);
}

.chat-vixel-brand {
    color: var(--chat-accent);
    font-weight: 700;
    letter-spacing: 1px;
}

/* ---- SCROLLBAR BODY ---- */
.ai-chat-body::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

/* ============================================
   MOBILE — CHAT WIDGET FIX
   ============================================ */
@media (max-width: 600px) {
    .ai-chat-container {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        bottom: 90px;
        height: calc(100vh - 120px);
        max-height: 520px;
        border-radius: 20px;
    }

    .ai-chat-trigger {
        bottom: 18px;
        right: 16px;
        width: 58px;
        height: 58px;
    }

    .chat-tab {
        font-size: 10px;
        padding: 7px 8px;
    }
}

/* ============================================
   MOBILE — HEADER FIX
   Sembunyikan toggle + nav, tampilkan logo + CTA
   ============================================ */
@media (max-width: 768px) {

    /* Sembunyikan hamburger toggle */
    .menu-button_button__hHosa,
    .hero-sticky_menuBtn__a2I5H {
        display: none !important;
    }

    /* Sembunyikan navigasi tengah */
    .header-nav {
        display: none !important;
    }

    /* Header: logo kiri, tombol kanan */
    .header {
        padding: 14px 20px;
    }

    /* Tampilkan hanya logo + tombol mulai */
    .header-right {
        display: flex;
        align-items: center;
    }

    .header-right .become-client {
        display: inline-flex !important;
        font-size: 13px;
        padding: 9px 18px;
    }
}

    /* Gaya untuk Teks yang Dinonaktifkan */
    .ai-chat-input:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }
    .ai-chat-send:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    /* Custom Warna Tombol dari Database */
    .chat-btn-primary {
        background: linear-gradient(135deg, var(--chat-accent), #1a9cb8) !important;
    }

    .chat-btn-outline {
        background: transparent !important;
        color: var(--chat-accent) !important;
        border: 1px solid var(--chat-accent) !important;
    }

    .chat-btn-back {
        background: rgba(255, 60, 60, 0.15) !important;
        color: #ff6b6b !important;
        border: 1px solid rgba(255, 60, 60, 0.4) !important;
    }

    .chat-btn-back:hover {
        background: rgba(255, 60, 60, 0.3) !important;
    }

    /* Inline Form dalam Chat Bubble */
    /* =========================================
       PREMIUM FORM INLINE CHAT (ULTRA-DESIGN)
       ========================================= */
    form.chat-inline-form {
        background: #16181B !important;
        padding: 18px !important;
        border-radius: 16px !important;
        margin-top: 15px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 8px 20px rgba(0,0,0,0.4) !important;
        position: relative;
        overflow: hidden;
    }

    /* Garis Neon Aksentuasi di Atas Form */
    form.chat-inline-form::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 3px;
        background: linear-gradient(90deg, #2DCAEE, #0072FF);
    }

    .chat-form-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .form-icon-circle {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: rgba(45, 202, 238, 0.15);
        color: var(--chat-accent);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        flex-shrink: 0;
    }

    .form-title-wrapper {
        display: flex;
        flex-direction: column;
    }

    .form-subtitle {
        font-size: 9px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: rgba(255, 255, 255, 0.4);
        margin-bottom: 3px;
    }

    .chat-form-header .form-title {
        font-size: 13px !important;
        font-weight: 700;
        color: #ffffff !important;
        line-height: 1.3;
    }

    /* Layout Row untuk Menghemat Ruang vertikal */
    .chat-form-row {
        display: flex;
        gap: 12px;
    }
    .chat-form-row .chat-form-group {
        flex: 1;
    }

    .chat-form-group {
        margin-bottom: 14px;
    }

    .chat-form-group label {
        display: block;
        font-size: 10px;
        text-transform: uppercase;
        font-weight: 700;
        letter-spacing: 0.5px;
        color: rgba(255, 255, 255, 0.5);
        margin-bottom: 6px;
        padding-left: 2px;
    }

    .chat-form-input {
        width: 100%;
        background: #0a0a0a !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        color: #fff !important;
        padding: 10px 14px !important;
        border-radius: 10px !important;
        font-size: 12px !important;
        transition: all 0.3s ease !important;
        box-sizing: border-box; /* Hindari membesar ke samping */
    }

    .chat-form-input:focus {
        border-color: var(--chat-accent) !important;
        background: #000 !important;
        box-shadow: 0 0 0 3px rgba(45, 202, 238, 0.2) !important;
        outline: none !important;
    }

    .chat-form-input::placeholder {
        color: rgba(255, 255, 255, 0.2) !important;
    }



    .chat-form-input.readonly {
        background: transparent;
        border: none;
        padding: 0;
        color: var(--chat-accent);
        font-weight: bold;
    }

    .chat-form-btn {
        width: 100%;
        margin-top: 10px;
        padding: 14px;
        font-size: 13px;
        font-weight: 800;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        border-radius: 10px;
        background: linear-gradient(135deg, #2DCAEE, #0072FF) !important;
        color: white !important;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3) !important;
    }

    .chat-form-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 114, 255, 0.5) !important;
    }

    .chat-form-btn:disabled {
        background: rgba(255,255,255,0.05) !important;
        color: rgba(255,255,255,0.2) !important;
        transform: none !important;
        box-shadow: none !important;
        cursor: not-allowed !important;
    }


    .chat-form-group {
        margin-bottom: 10px;
    }

    .chat-form-group label {
        display: block;
        font-size: 11px;
        color: rgba(255, 255, 255, 0.6);
        margin-bottom: 4px;
    }

   

    /* Titik Indikator Merah di Tab */
    .chat-tab .tab-badge {
        display: inline-block;
        width: 7px;
        height: 7px;
        background: #FF4757;
        border-radius: 50%;
        margin-left: 6px;
        vertical-align: middle;
        box-shadow: 0 0 6px rgba(255, 71, 87, 0.6);
    }

    /* --- UKURAN DESKTOP & SCROLL FIX --- */
    @media (min-width: 768px) {
        .ai-chat-container {
            width: 420px !important;
            height: 550px !important;
        }
    }

    .ai-chat-body {
        /* Mencegah scroll chat berlanjut ke body website */
        overscroll-behavior: contain;
    }


