.nefsha-chatbot {
    --chatbot-primary: #6366f1;
    --chatbot-secondary: #8b5cf6;
    --chatbot-dark: #0f172a;
    position: fixed;
    z-index: 99999;
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 14px;
    pointer-events: none;
}

.nefsha-chatbot--admin,
.nefsha-chatbot--user,
.nefsha-chatbot--vendor {
    right: 24px;
    bottom: 24px;
    left: auto;
    align-items: flex-end;
}

.nefsha-chatbot--frontend {
    left: 24px;
    bottom: 24px;
    right: auto;
}

.nefsha-chatbot * {
    pointer-events: auto;
}

.nefsha-chatbot__toggle {
    width: 62px;
    height: 62px;
    border: 3px solid rgba(15, 23, 42, 0.85);
    border-radius: 50%;
    color: #0f172a;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 2;
}

.nefsha-chatbot__toggle i {
    color: #0f172a;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35));
}

.nefsha-chatbot__toggle:hover,
.nefsha-chatbot__toggle:focus {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.34);
    outline: none;
}

.nefsha-chatbot.is-open .nefsha-chatbot__toggle {
    transform: scale(0.95);
}

.nefsha-chatbot__panel {
    width: min(525px, calc(100vw - 32px));
    height: min(816px, calc(100vh - 110px));
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(15, 23, 42, 0.08);
    transform-origin: bottom right;
    animation: chatbotSlideUp 0.25s ease;
}

.nefsha-chatbot--frontend .nefsha-chatbot__panel {
    transform-origin: bottom left;
}

.nefsha-chatbot--admin .nefsha-chatbot__panel,
.nefsha-chatbot--user .nefsha-chatbot__panel,
.nefsha-chatbot--vendor .nefsha-chatbot__panel {
    transform-origin: bottom right;
}

.nefsha-chatbot.is-open .nefsha-chatbot__panel {
    display: flex;
}

@keyframes chatbotSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.nefsha-chatbot__header {
    padding: 18px 20px;
    color: #0f172a;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.nefsha-chatbot__header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nefsha-chatbot__avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.nefsha-chatbot__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.nefsha-chatbot__subtitle {
    font-size: 12px;
    margin: 2px 0 0;
    color: rgba(15, 23, 42, 0.72);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nefsha-chatbot__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
}

.nefsha-chatbot__header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nefsha-chatbot__locale {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.12);
}

.nefsha-chatbot__locale--gate {
    width: 100%;
    justify-content: flex-start;
}

.nefsha-chatbot__locale-btn {
    border: 0;
    background: transparent;
    color: #0f172a;
    min-width: 38px;
    height: 28px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.nefsha-chatbot__locale-btn.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.nefsha-chatbot__language-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}

.nefsha-chatbot__close,
.nefsha-chatbot__minimize,
.nefsha-chatbot__clear {
    border: 0;
    background: rgba(15, 23, 42, 0.12);
    color: #0f172a;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nefsha-chatbot__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.nefsha-chatbot__body.is-hidden {
    display: none;
}

.nefsha-chatbot__gate {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.nefsha-chatbot__gate.is-hidden {
    display: none;
}

.nefsha-chatbot__gate-inner h5 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
}

.nefsha-chatbot__gate-text {
    font-size: 13px;
    line-height: 1.65;
    color: #334155;
    max-height: 220px;
    overflow-y: auto;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    margin-bottom: 14px;
}

.nefsha-chatbot__gate-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.nefsha-chatbot__gate-field {
    margin-bottom: 12px;
}

.nefsha-chatbot__gate-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.nefsha-chatbot__gate-field input {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
}

.nefsha-chatbot__gate-intro {
    font-size: 13px;
    color: #475569;
    margin-bottom: 14px;
}

.nefsha-chatbot__gate-kvkk.is-invalid,
.nefsha-chatbot__gate-guest.is-invalid {
    border: 2px solid #dc2626;
    border-radius: 14px;
    padding: 12px;
    background: rgba(220, 38, 38, 0.06);
    animation: chatbotPulseError 0.45s ease;
}

.nefsha-chatbot__gate-kvkk.is-invalid .nefsha-chatbot__gate-text,
.nefsha-chatbot__gate-kvkk.is-invalid .nefsha-chatbot__gate-check {
    color: #991b1b;
}

@keyframes chatbotPulseError {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35); }
    100% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
}

.nefsha-chatbot__profile {
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.04);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.nefsha-chatbot__profile.is-hidden {
    display: none;
}

.nefsha-chatbot__profile-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.nefsha-chatbot__profile-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.nefsha-chatbot__message--bot a {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: underline;
}

.nefsha-chatbot__gate-submit {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
    color: #0f172a;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    cursor: pointer;
}

.nefsha-chatbot__messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    scroll-behavior: smooth;
}

.nefsha-chatbot__message {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 16px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.nefsha-chatbot__message--bot {
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.nefsha-chatbot__message--bot p {
    margin: 0 0 8px;
}

.nefsha-chatbot__message--bot p:last-child {
    margin-bottom: 0;
}

.nefsha-chatbot__message--bot strong {
    color: #0f172a;
    font-weight: 700;
}

.nefsha-chatbot__list {
    margin: 0 0 8px 18px;
    padding: 0;
}

.nefsha-chatbot__list li {
    margin-bottom: 6px;
}

.nefsha-chatbot__message--bot a {
    color: #2563eb;
    text-decoration: underline;
}

.nefsha-chatbot__message--bot strong {
    font-weight: 700;
}

.nefsha-chatbot__inline-followup {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

.nefsha-chatbot__inline-followup-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 600;
}

.nefsha-chatbot__suggestion--inline {
    display: block;
    width: 100%;
    text-align: left;
    border-radius: 14px;
}

.nefsha-chatbot__suggestion--link {
    text-decoration: none;
    margin-bottom: 8px;
}

.nefsha-chatbot__suggestion--link:last-child {
    margin-bottom: 0;
}

.nefsha-chatbot__avatar img {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    object-fit: cover;
}

.nefsha-chatbot__suggestions.is-hidden {
    display: none !important;
}

.nefsha-chatbot__message--user {
    margin-left: auto;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: #0f172a;
    font-weight: 500;
    border-bottom-right-radius: 6px;
}

.nefsha-chatbot__message--notice {
    max-width: 100%;
    background: rgba(174, 255, 110, 0.18);
    border: 1px dashed rgba(15, 23, 42, 0.18);
    color: #334155;
    font-size: 13px;
}

.nefsha-chatbot__message--typing {
    opacity: 0.75;
    font-style: italic;
}

.nefsha-chatbot__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 18px 12px;
    background: #f8fafc;
}

.nefsha-chatbot__suggestion {
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff;
    color: #0f172a;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.nefsha-chatbot__suggestion:hover {
    border-color: var(--chatbot-primary);
    transform: translateY(-1px);
}

.nefsha-chatbot__followup {
    padding: 0 18px 14px;
    background: #f8fafc;
}

.nefsha-chatbot__followup-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 600;
}

.nefsha-chatbot__footer {
    padding: 14px 16px 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.nefsha-chatbot__form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nefsha-chatbot__input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    background: #f8fafc;
}

.nefsha-chatbot__input:focus {
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 3px rgba(174, 255, 110, 0.25);
    background: #fff;
}

.nefsha-chatbot__send {
    border: 0;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    color: #0f172a;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.nefsha-chatbot__send:disabled,
.nefsha-chatbot__input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 767px) {
    .nefsha-chatbot--frontend,
    .nefsha-chatbot--admin,
    .nefsha-chatbot--user,
    .nefsha-chatbot--vendor {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        align-items: stretch;
    }

    .nefsha-chatbot__toggle {
        position: fixed;
        bottom: 18px;
        z-index: 99999;
    }

    .nefsha-chatbot--frontend .nefsha-chatbot__toggle {
        left: 18px;
    }

    .nefsha-chatbot--admin .nefsha-chatbot__toggle,
    .nefsha-chatbot--user .nefsha-chatbot__toggle,
    .nefsha-chatbot--vendor .nefsha-chatbot__toggle {
        right: 18px;
        left: auto;
    }

    .nefsha-chatbot.is-open .nefsha-chatbot__toggle {
        display: none;
    }

    .nefsha-chatbot.is-open .nefsha-chatbot__panel {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        z-index: 999999;
    }
}
