/* --- Wrapper utama --- */
#ged-chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    font-family: Arial, sans-serif;
}

/* --- Tombol floating: hanya icon --- */
#ged-chat-toggle {
    display: inline-flex;          /* ikut ukuran icon */
    align-items: center;
    justify-content: center;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;

    /* Hapus bentuk bulat + background + shadow */
    border-radius: 0;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
}

#ged-chat-toggle:hover {
    transform: translateY(-1px);
    box-shadow: none !important;
}

/* icon pada tombol dibuat besar */
.ged-chat-agent-icon {
    width: 88px;
    height: 88px;
    border-radius: 0;
    object-fit: contain;
}

/* text di tombol disembunyikan */
.ged-chat-toggle-text {
    display: none;
}

/* --- Panel kontak --- */
#ged-chat-panel {
    position: absolute;
    right: 0;
    bottom: 80px;
    width: 340px;
    max-width: 92vw;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-height: calc(100vh - 120px); /* supaya tidak mentok menu */
}

/* class ketika panel terbuka */
#ged-chat-panel.ged-chat-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- Header panel --- */
.ged-chat-panel-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
    background: #212c65;
    color: #fff;
}

.ged-chat-header-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ged-chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
}

.ged-chat-title {
    font-weight: bold;
    font-size: 15px;
}

.ged-chat-subtitle {
    font-size: 11px;
}

.ged-chat-close {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
}

/* --- Body panel --- */
.ged-chat-panel-body {
    padding: 12px;
    max-height: calc(100vh - 180px); /* tinggi body yang bisa scroll */
    overflow-y: auto;
}

/* Item contact (Call / Chat / WA) */
.ged-chat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background: #f6f6f6;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
    cursor: pointer;
    border: none;
    width: 100%;
}
/* Tombol contact yang sedang dinonaktifkan */
.ged-chat-item-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    position: relative;
}

.ged-chat-item-disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.ged-chat-item-disabled:hover {
    background: #f6f6f6; /* jangan berubah saat hover */
}


/* .ged-chat-item-disabled::after {
    content: "Sedang dalam pengembangan";
    position: absolute;
    right: 10px;
    bottom: 6px;
    font-size: 10px;
    color: #e60012;
    font-weight: 600;
} */


.ged-chat-item:hover {
    background: #ececec;
}

.ged-chat-item-icon {
    font-size: 20px;
    min-width: 28px;
    text-align: center;
}
/* Icon gambar di dalam ged-chat-item-icon */
.ged-chat-item-icon-img {
    width: 22px;      /* boleh diubah kalau mau lebih besar/kecil */
    height: 22px;
    display: block;
}
.ged-chat-btn-wa-icon {
    width: 16px;
    height: 16px;
    display: block;
}


.ged-chat-item-text {
    text-align: left;
}

.ged-chat-item-title {
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

.ged-chat-item-subtitle {
    font-size: 11px;
    color: #666;
}

/* --- Social --- */
.ged-chat-social {
    margin-top: 10px;
    text-align: center;
}

.ged-chat-social-title {
    font-size: 11px;
    color: #777;
    margin-bottom: 6px;
}

.ged-chat-social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #ddd;
    margin: 0 4px;
    font-size: 13px;
    text-decoration: none;
    color: #555;
}

.ged-chat-social-links a img {
    width: 14px;
    height: 14px;
    display: block;
}
.ged-chat-call {
    cursor: default !important; /* supaya card tidak dianggap tombol besar */
}

.ged-chat-call-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 3px;
}

.ged-chat-call-number {
    color: #212c65;
    text-decoration: underline;
    font-size: 12px;
}

.ged-chat-call-number:hover {
    color: #000;
}


/* --- Form pra-chat --- */
#ged-chat-form-wrapper {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.ged-chat-form-title {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 6px;
}
/* Banner kecil di atas form */
.ged-chat-form-banner {
    margin-top: 8px;
    margin-bottom: 10px;
    border-radius: 10px;
    overflow: hidden;
}

.ged-chat-form-banner img {
    display: block;
    width: 100%;
    height: auto;          /* biar rasio aslinya terjaga */
    max-height: 150px;     /* opsional: batasi tinggi kalau perlu */
    object-fit: contain;   /* jangan di-crop, tampilkan penuh */
}

/* Tombol kembali dari form ke opsi chat */
.ged-chat-form-back {
    border: none;
    background: transparent;
    color: #e60012;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ged-chat-form-back:hover {
    text-decoration: underline;
}
/* Icon panah kiri melengkung (SVG) */
.ged-chat-form-back-icon {
    width: 16px;
    height: 16px;
    stroke: #e60012;
    stroke-width: 2;
    fill: none;
}

/* Biar SVG sejajar rapi dengan teks */
.ged-chat-form-back-icon path {
    stroke-linecap: round;
    stroke-linejoin: round;
}



#ged-chat-form label {
    display: block;
    font-size: 11px;
    margin-bottom: 6px;
}

#ged-chat-form input[type="text"],
#ged-chat-form input[type="email"] {
    width: 100%;
    padding: 6px;
    margin-top: 2px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 12px;
}

.ged-chat-btn-submit {
    margin-top: 4px;
    width: 100%;
    padding: 7px;
    border-radius: 8px;
    border: none;
    background: #212c65; /* default: merah (livechat internal) */
    color: #fff;
    font-size: 12px;
    cursor: pointer;

    /* untuk icon + text di tengah */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Tombol submit dalam keadaan loading */
.ged-chat-btn-submit.ged-chat-loading {
    position: relative;
    opacity: 0.8;
    cursor: default;
    pointer-events: none;
}

/* Lingkaran loading di kanan teks */
.ged-chat-btn-submit.ged-chat-loading::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    animation: ged-chat-spin 0.8s linear infinite;
}

@keyframes ged-chat-spin {
    to { transform: rotate(360deg); }
}


/* span untuk icon di tombol (default disembunyikan) */
/* span untuk icon di tombol */
.ged-chat-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.ged-chat-btn-icon img {
    width: 16px;
    height: 16px;
    display: block;
}

/* style khusus kalau tombol dalam mode WhatsApp */
.ged-chat-btn-whatsapp {
    background: #25D366; /* warna hijau WhatsApp */
}

/* Required / optional label */
.ged-chat-required {
    color: #e60012;
    margin-left: 3px;
    font-weight: bold;
}

.ged-chat-optional {
    color: #999;
    margin-left: 4px;
    font-size: 10px;
}


/* --- Live chat box --- */
#ged-chat-box {
    margin-top: 10px;
    border-radius: 10px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    height: 260px;
}
/* Dipaksa tetap hilang kalau ada class ged-chat-hidden */
#ged-chat-box.ged-chat-hidden {
    display: none;
}
.ged-chat-box-header {
    padding: 6px 8px;
    font-size: 12px;
    font-weight: bold;
    background: #f6f6f6;
    border-bottom: 1px solid #eee;

    /* NEW: supaya tombol "Tutup chat" di kanan */
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ged-chat-end-btn {
    border: none;
    background: transparent;
    color: #e60012;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
}

.ged-chat-end-btn:hover {
    text-decoration: underline;
}

/* Box konfirmasi tutup chat */
.ged-chat-end-confirm {
    padding: 8px;
    border-top: 1px solid #eee;
    background: #fff6f6;
    font-size: 11px;
}

.ged-chat-end-confirm-text {
    margin-bottom: 6px;
}

.ged-chat-end-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.ged-chat-end-confirm-actions button {
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
}

.ged-chat-end-yes {
    background: #e60012;
    color: #fff;
}

.ged-chat-end-no {
    background: #f0f0f0;
    color: #333;
}

.ged-chat-messages {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    font-size: 12px;
}

.ged-chat-message {
    margin-bottom: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    max-width: 90%;
}

.ged-chat-message-admin {
    background: #f0f0f0;
    align-self: flex-start;
}

.ged-chat-message-user {
    background: #e60012;
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
}

#ged-chat-message-form {
    display: flex;
    border-top: 1px solid #eee;
}

#ged-chat-message-input {
    flex: 1;
    border: none;
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 0 0 0 10px;
    outline: none;
}

#ged-chat-message-form button {
    border: none;
    padding: 0 10px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 0 0 10px 0;
    background: #e60012;
    color: #fff;
}

/* Pesan error di bawah input */
.ged-chat-error {
    color: #e60012;
    font-size: 10px;
    margin-top: 2px;
    display: block;
}

/* Border merah untuk input yang tidak valid */
.ged-chat-input-invalid {
    border-color: #e60012 !important;
}


/* Utility */
.ged-chat-hidden {
    display: none;
}



/* Modal konfirmasi sebelum mulai chat */
#ged-chat-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;              /* di atas panel chat */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

/* ketika tidak punya class .ged-chat-hidden → tampilkan sebagai flex center */
#ged-chat-confirm-modal:not(.ged-chat-hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
}


.ged-chat-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.ged-chat-confirm-box {
    position: relative;
    max-width: 360px;
    width: calc(100% - 40px);
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 20px 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    text-align: left;
    z-index: 1;
    font-size: 13px;
}

/* judul & teks */
.ged-chat-confirm-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    color: #212c65;
}

.ged-chat-confirm-text {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 14px;
}

.ged-chat-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.ged-chat-confirm-actions button {
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ged-chat-confirm-yes {
    background: #212c65;
    color: #fff;
    border-color: #212c65;
    font-weight: 600;
}
.ged-chat-confirm-yes:hover {
    background: #1a234f;
    border-color: #1a234f;
}

.ged-chat-confirm-no {
    background: #f5f5f5;
    color: #333;
    border-color: #d0d0d0;
}
.ged-chat-confirm-no:hover {
    background: #e7e7e7;
}
#ged-chat-confirm-modal.ged-chat-hidden {
    display: none !important;
}
/* Office Hours */
.ged-chat-office-hours {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
    color: #f1f3ff;          /* sedikit lebih terang */
}

.ged-chat-office-icon {
    width: 18px;             /* dibesarkan supaya lebih kelihatan */
    height: 18px;
    flex-shrink: 0;
    display: block;
}

.ged-chat-office-text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
    margin-top: 2px;
}

.ged-chat-office-text span {
    display: block;            /* memastikan turun ke bawah */
    padding-left: 0px;         /* pastikan rata kiri */
    margin: 0;                 /* hilangkan jarak tidak perlu */
}




/* --- Responsif mobile --- */
@media (max-width: 480px) {

    .ged-chat-confirm-box {
        max-width: 92vw;
        padding: 16px 14px 14px;
    }

    .ged-chat-confirm-text {
        font-size: 12px;
    }
    .ged-chat-confirm-actions button {
        font-size: 11px;
        padding: 6px 10px;
    }
    #ged-chat-widget {
        right: 12px;
        bottom: 12px;
    }

    #ged-chat-panel {
        width: 92vw;
    }

    .ged-chat-agent-icon {
        width: 72px;
        height: 72px;
    }
}
