.gc-chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --gc-chat-primary: var(--primary-color, #0b5cff);
    --gc-chat-primary-dark: var(--secondary-color, #073a9b);
    --gc-chat-primary-soft: rgba(11, 92, 255, 0.1);
    --gc-chat-black: #0f172a;
    --gc-chat-gray: #64748b;
    --gc-chat-border: rgba(15, 23, 42, 0.08);
    view-transition-name: gc-chat-widget;
}

.gc-chat-widget__toggle {
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 30px;
    background: var(--gc-chat-primary);
    color: #fff;
    box-shadow: 0 10px 25px -5px rgba(11, 92, 255, 0.4), 0 8px 10px -6px rgba(11, 92, 255, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gc-bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gc-chat-widget__toggle:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 20px 25px -5px rgba(11, 92, 255, 0.4), 0 10px 10px -5px rgba(11, 92, 255, 0.4);
}

.gc-chat-widget__panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(400px, calc(100vw - 48px));
    height: 640px;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transform-origin: bottom right;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gc-chat-widget.is-open .gc-chat-widget__panel {
    display: flex;
    opacity: 1;
    transform: scale(1) translateY(0);
}

.gc-chat-widget.is-open .gc-chat-widget__toggle {
    transform: scale(0.9) rotate(-90deg);
    opacity: 0;
    pointer-events: none;
}

@keyframes gc-bounce-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.gc-chat-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(11, 92, 255, 0.05);
    border-bottom: 1px solid var(--gc-chat-border);
}

.gc-chat-widget__header-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.gc-chat-widget__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--gc-chat-black);
    letter-spacing: -0.01em;
}

.gc-chat-widget__subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--gc-chat-gray);
    line-height: 1.4;
}

.gc-chat-widget__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.04);
    color: var(--gc-chat-black);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gc-chat-widget__close:hover {
    background: rgba(15, 23, 42, 0.08);
    transform: rotate(90deg);
}

.gc-chat-widget__messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 10px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.1) transparent;
}

.gc-chat-widget__messages::-webkit-scrollbar {
    width: 5px;
}

.gc-chat-widget__messages::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 10px;
}

.gc-chat-widget__empty {
    color: var(--gc-chat-gray);
    font-size: 14px;
    text-align: center;
    margin-top: 40px;
    opacity: 0.8;
}

.gc-chat-widget__bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    animation: gc-fade-slide-up 0.3s ease-out backwards;
}

@keyframes gc-fade-slide-up {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.gc-chat-widget__bubble--customer {
    margin-left: auto;
    background: var(--gc-chat-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 10px 15px -3px rgba(11, 92, 255, 0.2);
}

.gc-chat-widget__bubble--system,
.gc-chat-widget__bubble--agent,
.gc-chat-widget__bubble--bot {
    background: #fff;
    color: var(--gc-chat-black);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--gc-chat-border);
}

.gc-chat-widget__meta {
    margin-top: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    opacity: 0.5;
}

.gc-chat-widget__bubble--customer .gc-chat-widget__meta {
    color: #fff;
    opacity: 0.8;
}

.gc-chat-widget__composer {
    position: relative;
    padding: 16px 20px 20px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--gc-chat-border);
}

.gc-chat-widget__form {
    display: grid;
    gap: 12px;
    position: relative;
}

.gc-chat-widget__composer-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.gc-chat-widget__tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 0;
    background: rgba(15, 23, 42, 0.04);
    color: var(--gc-chat-black);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gc-chat-widget__tool-btn:hover {
    background: rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.gc-chat-widget__input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--gc-chat-border);
    border-radius: 16px;
    padding: 12px 16px;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.gc-chat-widget__input:focus {
    outline: none;
    border-color: var(--gc-chat-primary);
    box-shadow: 0 0 0 4px rgba(11, 92, 255, 0.1);
}

.gc-chat-widget__submit {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 0;
    background: var(--gc-chat-primary);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(11, 92, 255, 0.3);
}

.gc-chat-widget__submit:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(11, 92, 255, 0.4);
}

.gc-chat-widget__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.gc-chat-widget__file-input {
    display: none;
}

.gc-chat-widget__emoji-picker {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    width: 100%;
    display: none;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.18);
}

.gc-chat-widget__emoji-picker.is-open {
    display: grid;
}

.gc-chat-widget__emoji-btn {
    border: 0;
    height: 40px;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 20px;
    cursor: pointer;
}

.gc-chat-widget__attachment-preview {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.gc-chat-widget__attachment-preview.is-visible {
    display: flex;
}

.gc-chat-widget__attachment-preview-image {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 12px;
    background: #eef2f7;
    flex-shrink: 0;
}

.gc-chat-widget__attachment-preview-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-width: 0;
    font-size: 12px;
    color: #344054;
}

.gc-chat-widget__attachment-preview-copy span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gc-chat-widget__remove-attachment {
    border: 0;
    background: transparent;
    color: #dc2626;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.gc-chat-widget__status {
    display: none;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.gc-chat-widget__status.is-visible {
    display: block;
}

.gc-chat-widget__status.is-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.gc-chat-widget__status.is-success {
    background: #ecfdf3;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.gc-chat-widget__otp-modal {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.gc-chat-widget__otp-modal.is-open {
    display: flex;
    animation: gc-fade-in 0.3s ease-out;
}

@keyframes gc-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gc-chat-widget__otp-card {
    width: 100%;
    max-width: 320px;
    background: #fff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: grid;
    gap: 16px;
    animation: gc-scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gc-scale-up {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Typing Indicator (New) */
.gc-chat-widget__typing {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 14px;
    width: fit-content;
    border: 1px solid var(--gc-chat-border);
    margin-bottom: 12px;
}

.gc-chat-widget__dot {
    width: 6px;
    height: 6px;
    background: var(--gc-chat-primary);
    border-radius: 50%;
    animation: gc-typing-dot 1.4s infinite ease-in-out both;
}

.gc-chat-widget__dot:nth-child(1) { animation-delay: -0.32s; }
.gc-chat-widget__dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes gc-typing-dot {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* Markdown Specific Styles */
.gc-chat-widget__message-copy strong {
    font-weight: 700;
}

.gc-chat-widget__message-copy ul, .gc-chat-widget__message-copy ol {
    margin: 8px 0;
    padding-left: 20px;
}

.gc-chat-widget__message-copy li {
    margin-bottom: 4px;
}

.gc-chat-widget__message-copy code {
    background: rgba(15, 23, 42, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.gc-chat-widget__message-copy pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 12px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.5;
}

.gc-chat-widget__otp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gc-chat-widget__otp-head h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.gc-chat-widget__otp-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: var(--gc-chat-primary-soft);
    color: var(--gc-chat-primary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.gc-chat-widget__otp-copy {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

.gc-chat-widget__otp-actions,
.gc-chat-widget__otp-row {
    display: flex;
    gap: 8px;
}

.gc-chat-widget__input--otp {
    height: 42px;
    border-radius: 14px;
}

@media (max-width: 576px) {
    .gc-chat-widget {
        right: 12px;
        bottom: 12px;
    }

    .gc-chat-widget__panel {
        width: calc(100vw - 24px);
        height: min(78vh, 640px);
    }

    .gc-chat-widget__otp-modal {
        align-items: flex-end;
        padding: 12px;
    }

    .gc-chat-widget__otp-card {
        max-width: none;
        border-radius: 20px;
    }

    .gc-chat-widget__select-row {
        flex-direction: column;
        align-items: stretch;
    }

    .gc-chat-widget__otp-actions,
    .gc-chat-widget__otp-row {
        flex-direction: column;
    }

    .gc-chat-widget__prompt-input-wrap {
        flex-direction: column;
    }

    .gc-chat-widget__field-chip-grid {
        grid-template-columns: 1fr;
    }

    .gc-chat-widget__product-table-row {
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 8px;
    }

    .gc-chat-widget__card-image--product-row {
        width: 60px;
        height: 60px;
        margin: 10px 0 10px 10px;
    }

    .gc-chat-widget__button,
    .gc-chat-widget__actions a {
        width: 100%;
    }
}

.gc-chat-widget__summary-item {
    display: grid;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.gc-chat-widget__summary-item-head,
.gc-chat-widget__summary-item-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.gc-chat-widget__summary-item-name {
    font-weight: 600;
    color: #0f172a;
}

.gc-chat-widget__qty-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 999px;
    background: var(--gc-chat-primary-soft);
}

.gc-chat-widget__qty-btn {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: var(--gc-chat-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.gc-chat-widget__qty-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}

.gc-chat-widget__qty-value {
    min-width: 18px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.gc-chat-widget__card--success {
    background: #ffffff;
    border: 1px solid rgba(34, 197, 94, 0.22);
    box-shadow: 0 14px 34px rgba(34, 197, 94, 0.10);
}

.gc-chat-widget__success-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 14px;
    background: #f0fdf4;
}

.gc-chat-widget__success-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.gc-chat-widget__success-title {
    font-size: 15px;
    font-weight: 800;
    color: #166534;
    line-height: 1.3;
}

.gc-chat-widget__success-subtitle {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: #3f6212;
}

/* Suggestion Chips / Welcome Questions */
.gc-chat-widget__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding: 0 4px;
}

.gc-chat-widget__chip {
    background: #fff;
    border: 1px solid var(--gc-chat-primary);
    color: var(--gc-chat-primary);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.gc-chat-widget__chip:hover {
    background: var(--gc-chat-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(11, 92, 255, 0.2);
}
