.support-chat-widget {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 9999;
    direction: rtl;
    font-family: inherit;
}

.support-chat-toggle {
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(43, 165, 171, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.25s ease;
}

.support-chat-toggle:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 16px 34px rgba(35, 141, 146, 0.35);
}

.support-chat-toggle-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--amber-500);
    color: var(--gray-900);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid var(--color-bg);
}

.support-chat-box {
    position: absolute;
    bottom: 82px;
    left: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 540px;
    background: var(--color-bg);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(26, 26, 24, 0.18);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.98);
    transition: all 0.25s ease;
    border: 1px solid var(--color-border);
}

.support-chat-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.support-chat-header {
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.support-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.support-chat-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--teal-50);
}

.support-chat-status {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}

.support-chat-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.support-chat-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.support-chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.support-chat-body {
    flex: 1;
    background: var(--gray-50);
    overflow-y: auto;
    padding: 18px;
}

.support-chat-welcome {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 18px;
    text-align: right;
    box-shadow: 0 6px 18px rgba(26, 26, 24, 0.04);
}

.support-chat-welcome-icon {
    font-size: 22px;
    margin-bottom: 8px;
}

.support-chat-welcome h6 {
    font-weight: 700;
    font-size: 14px;
    color: var(--color-text-primary);
}

.support-chat-welcome p {
    color: var(--color-text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.support-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.support-message {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 88%;
}

.support-message-received {
    align-self: flex-start;
}

.support-message-sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.support-message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--teal-100);
    color: var(--teal-800);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.support-message-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.support-message-bubble {
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.9;
    word-break: break-word;
}

.support-message-received .support-message-bubble {
    background: var(--color-bg);
    color: var(--color-text-primary);
    border-top-left-radius: 6px;
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 18px rgba(26, 26, 24, 0.05);
}

.support-message-sent .support-message-bubble {
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    color: #fff;
    border-top-right-radius: 6px;
    box-shadow: 0 10px 22px rgba(43, 165, 171, 0.20);
}

.support-message-time {
    font-size: 11px;
    color: var(--gray-400);
    padding: 0 4px;
}

.support-chat-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 14px;
}

.support-chat-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-50);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 8px 10px;
}

.support-chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--color-text-primary);
    padding: 6px 2px;
}

.support-chat-input::placeholder {
    color: var(--gray-400);
}

.support-chat-send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.support-chat-send-btn:hover {
    transform: scale(1.03);
    background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
}

.support-chat-footer-note {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 8px;
    text-align: right;
    padding-right: 4px;
}

.d-none {
    display: none !important;
}

@media (max-width: 576px) {
    .support-chat-widget {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .support-chat-toggle {
        width: 58px;
        height: 58px;
        margin-left: auto;
    }

    .support-chat-box {
        width: 100%;
        height: calc(100vh - 95px);
        max-width: 100%;
        left: 0;
        right: 0;
        bottom: 74px;
        border-radius: 20px;
    }
}

.support-chat-screen {
    height: 100%;
}

.support-inline-form {
    width: 100%;
}

.support-inline-form .support-chat-input {
    width: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--color-text-primary);
}

.support-inline-form .support-chat-input::placeholder {
    color: var(--gray-400);
}

.support-choice-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.support-choice-card {
    width: 100%;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: 16px;
    padding: 16px 14px;
    text-align: right;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(26, 26, 24, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--color-text-primary);
}

.support-choice-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(43, 165, 171, 0.10);
}

.support-choice-card strong {
    display: block;
    font-size: 14px;
    color: var(--color-text-primary);
    margin-bottom: 4px;
    font-weight: 700;
}

.support-choice-card .support-chat-footer-note {
    margin: 0;
    padding: 0;
    font-size: 12px;
    color: var(--color-text-secondary);
    text-align: right;
}

.support-choice-card::before {
    content: "←";
    font-size: 18px;
    color: var(--gray-400);
    flex-shrink: 0;
}

.support-choice-card[data-chat-type="support"] {
    border-right: 4px solid var(--teal-500);
}

.support-choice-card[data-chat-type="doctor"] {
    border-right: 4px solid var(--amber-500);
}

.support-choice-card[data-chat-type="support"]:hover {
    border-color: var(--teal-500);
}

.support-choice-card[data-chat-type="doctor"]:hover {
    border-color: var(--amber-500);
}

.support-choice-card[data-chat-type="doctor"]:hover::before {
    color: var(--amber-600);
}

.support-choice-card[data-chat-type="support"]:hover::before {
    color: var(--teal-600);
}

.support-text-btn {
    background: none;
    border: none;
    color: var(--teal-600);
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    font-size: 12px;
    transition: color 0.2s ease;
}

.support-text-btn:hover {
    color: var(--teal-800);
    text-decoration: underline;
}

.support-otp-timer {
    color: var(--color-text-secondary);
    font-size: 11px;
}

.support-btn-loading {
    pointer-events: none;
    opacity: 0.75;
}

.support-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    display: inline-block;
    animation: supportSpin 0.7s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes supportSpin {
    to {
        transform: rotate(360deg);
    }
}

.support-choice-card {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #dbe3f0;
    border-radius: 14px;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: right;
}

.support-choice-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.08);
}

.support-choice-card--disabled,
.support-choice-card:disabled {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.85;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.support-choice-card--disabled:hover,
.support-choice-card:disabled:hover {
    border-color: #e5e7eb;
    box-shadow: none;
    transform: none;
}

.support-choice-card--disabled strong,
.support-choice-card:disabled strong {
    color: #6b7280;
}

.support-choice-card--disabled .support-chat-footer-note,
.support-choice-card:disabled .support-chat-footer-note {
    color: #9ca3af;
}

.support-choice-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #e5e7eb;
    color: #6b7280;
    white-space: nowrap;
}

.support-choice-card--disabled .support-choice-badge {
    background: #d1d5db;
    color: #4b5563;
}
