/* Modern Chat Container - Fully Responsive */
:root {
    --chat-sidebar-width: 320px;
    --chat-sidebar-width-mobile: 280px;
    --chat-header-height: 70px;
    --chat-input-height: 80px;
}

.chat-container {
    display: flex;
    height: calc(100vh - 120px);
    background: #F4F7FB;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-family: 'Tajawal', 'Droid Arabic Kufi', 'Segoe UI', Tahoma, Arial, sans-serif;
    position: relative;
}

/* ======================================== */
/* SIDEBAR - Responsive */
/* ======================================== */

.chat-sidebar {
    width: var(--chat-sidebar-width);
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    z-index: 20;
    border-left: 1px solid #E4EAF2;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop: Sidebar is always visible as part of flex layout */
@media (min-width: 992px) {
    .chat-sidebar {
        position: relative;
        transform: translateX(0) !important;
        box-shadow: none;
    }

    .sidebar-close {
        display: none;
    }
}

/* Tablet and Mobile: Sidebar slides out from right */
@media (max-width: 991px) {
    .chat-sidebar {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        height: 100%;
        transform: translateX(100%);
    }

        .chat-sidebar.show {
            transform: translateX(0);
        }
}

/* ======================================== */
/* MAIN CHAT AREA - Responsive */
/* ======================================== */

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    min-width: 0;
    width: 100%;
}

/* Desktop: Main chat area takes remaining space */
@media (min-width: 992px) {
    .chat-main {
        width: calc(100% - var(--chat-sidebar-width));
    }
}

/* ======================================== */
/* CHAT HEADER - Responsive */
/* ======================================== */

/* Update chat header styles */
.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E4EAF2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFFFF;
    gap: 16px;
    min-height: 70px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    /*flex: 1;*/
    min-width: 0; /* Allows flex children to shrink */
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-shrink: 0;
}

@media (max-width: 991px) {
    .mobile-menu-btn {
        display: flex !important;
    }
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    /*flex: 1;*/
}

.chat-title {
    font-size: 18px;
    font-weight: 700;
    color: #14274A;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Make title smaller on small screens */
@media (max-width: 767px) {
    .chat-title {
        font-size: 16px;
    }
}

@media (max-width: 575px) {
    .chat-title {
        font-size: 14px;
    }
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Update the knowledge badge styles */
.knowledge-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #F0F7FF;
    border-radius: 20px;
    font-size: 12px;
    color: #48A0D8;
    white-space: nowrap;
    width: fit-content; /* This ensures badge takes only needed width */
    max-width: 100%;
    cursor: default;
    transition: all 0.2s ease;
}

    .knowledge-badge i {
        font-size: 12px;
        flex-shrink: 0;
    }

    .knowledge-badge span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .knowledge-badge.active {
        background: #E8F5E9;
        color: #2E7D32;
    }

        .knowledge-badge.active i {
            color: #2E7D32;
        }

/* Responsive knowledge badge */
@media (max-width: 991px) {
    .knowledge-badge {
        max-width: 200px;
        gap: 6px;
        padding: 4px 10px;
        font-size: 11px;
    }

        .knowledge-badge span {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
}

@media (max-width: 767px) {
    .knowledge-badge {
        max-width: 160px;
        padding: 4px 8px;
        font-size: 10px;
    }
}

@media (max-width: 575px) {
    .knowledge-badge {
        max-width: 130px;
        padding: 3px 6px;
        font-size: 9px;
        gap: 4px;
    }

        .knowledge-badge i {
            font-size: 10px;
        }
}

/* Optional: If you want to hide the text and show only icon on very small screens */
@media (max-width: 450px) {
    /*.knowledge-badge span {
        display: none;
    }*/

    .knowledge-badge {
        padding: 6px 8px;
        /*border-radius: 50%;*/
        max-width: auto;
    }

        .knowledge-badge i {
            margin: 0;
            font-size: 12px;
        }
}


.icon-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 10px;
    color: #6E7B8F;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .icon-btn:hover {
        background: #F4F7FB;
        color: #14274A;
    }

/* ======================================== */
/* MESSAGES AREA - Responsive */
/* ======================================== */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #FAFCFE;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

/* Message Bubbles */
.message-bubble {
    max-width: 85%;
    animation: fadeInUp 0.3s ease;
}

@media (min-width: 992px) {
    .message-bubble {
        max-width: 75%;
    }

    .message-assistant {
        max-width: 70%;
    }
}

@media (max-width: 767px) {
    .message-bubble {
        max-width: 90%;
    }
}

/* User Message */
.message-user {
    align-self: flex-end;
}

    .message-user .message-text {
        background: #F0F7FF;
        border: 1px solid #48A0D8;
        color: #14274A;
        padding: 10px 14px;
        border-radius: 18px 18px 4px 18px;
        font-size: 14px;
        line-height: 1.5;
    }

.chat-answer {
    display: grid;
    gap: 10px;
    line-height: 1.75;
}

.chat-answer > * {
    margin: 0;
}

.chat-answer h2,
.chat-answer h3,
.chat-answer h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #173B66;
    font-weight: 800;
    line-height: 1.45;
}

.chat-answer h2 { font-size: 17px; }
.chat-answer h3 { font-size: 15px; }
.chat-answer h4 { font-size: 14px; }

.chat-answer h2::before,
.chat-answer h3::before,
.chat-answer h4::before {
    content: "✦";
    display: inline-grid;
    place-items: center;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #E8F4FF;
    color: #1677B8;
    font-size: 12px;
}

.chat-answer ul,
.chat-answer ol {
    display: grid;
    gap: 7px;
    margin: 0;
    padding-inline-start: 24px;
}

.chat-answer li::marker {
    color: #1687C5;
    font-weight: 800;
}

.chat-answer strong { color: #132F55; }

.chat-answer code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #EFF4FA;
    color: #A33A62;
    font-family: Consolas, monospace;
    direction: ltr;
}

.chat-answer .message-link,
.chat-answer a {
    color: #086FAE;
    font-weight: 700;
    text-decoration: none;
}

.chat-answer .message-link:hover,
.chat-answer a:hover { text-decoration: underline; }

.chat-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #CFE5F7;
    border-inline-start: 4px solid #2A91CE;
    border-radius: 12px;
    background: linear-gradient(135deg, #F3FAFF, #F8FBFF);
    color: #244463;
}

.chat-callout-icon { flex: 0 0 auto; }

.chat-answer hr {
    width: 100%;
    border: 0;
    border-top: 1px solid #E1EAF3;
}

.chat-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #DCE7F2;
    border-radius: 12px;
}

.chat-table-wrap table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    background: #FFFFFF;
}

.chat-table-wrap th,
.chat-table-wrap td {
    padding: 9px 11px;
    border-bottom: 1px solid #E7EEF5;
    text-align: start;
    vertical-align: top;
}

.chat-table-wrap th {
    background: #EDF7FF;
    color: #173B66;
    font-weight: 800;
}

.chat-table-wrap tr:last-child td { border-bottom: 0; }

/* Assistant Message */
.message-assistant {
    align-self: flex-start;
}

    .message-assistant .message-text {
        background: #FFFFFF;
        border: 1px solid #E4EAF2;
        color: #223046;
        padding: 10px 14px;
        border-radius: 18px 18px 18px 4px;
        font-size: 14px;
        line-height: 1.5;
    }

/* Message Header */
.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6E7B8F;
}

.assistant-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #E4EAF2;
}

.message-time {
    font-size: 10px;
    color: #A0ABBF;
    margin-top: 6px;
    padding-inline: 4px;
}

/* ======================================== */
/* INPUT AREA - Responsive */
/* ======================================== */

.chat-input-container {
    padding: 16px 20px;
    border-top: 1px solid #E4EAF2;
    background: #FFFFFF;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: #F8FAFE;
    border: 1px solid #E4EAF2;
    border-radius: 24px;
    padding: 6px 12px;
    transition: all 0.2s;
}

    .input-wrapper:focus-within {
        border-color: #48A0D8;
        background: #FFFFFF;
        box-shadow: 0 0 0 3px rgba(72, 160, 216, 0.1);
    }

.chat-input {
    flex: 1;
    border: none;
    background: none;
    padding: 8px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    max-height: 100px;
    min-height: 40px;
}

    .chat-input:focus {
        outline: none;
    }

.send-btn {
    width: 40px;
    height: 40px;
    background: #48A0D8;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .send-btn i {
        font-size: 16px;
        color: #FFFFFF;
    }

    .send-btn:hover {
        background: #14274A;
        transform: scale(1.05);
    }

    .send-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.input-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 8px;
}

.footer-note,
.footer-shortcut {
    font-size: 10px;
    color: #A0ABBF;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 575px) {
    .input-footer {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
}

/* ======================================== */
/* WELCOME SCREEN - Responsive */
/* ======================================== */

.welcome-screen {
    text-align: center;
    padding: 40px 20px;
    max-width: 100%;
    margin: auto;
}

.welcome-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
}

.welcome-icon-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid #FFFFFF;
}

.welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: #14274A;
    margin-bottom: 10px;
}

.welcome-subtitle {
    font-size: 14px;
    color: #6E7B8F;
    margin-bottom: 24px;
}

.quick-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 10px 20px;
    background: #FFFFFF;
    border: 1px solid #E4EAF2;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #14274A;
    cursor: pointer;
    transition: all 0.2s;
}

    .quick-action-btn:hover {
        border-color: #48A0D8;
        background: #F0F7FF;
        transform: translateY(-2px);
    }

@media (max-width: 575px) {
    .welcome-screen {
        padding: 30px 16px;
    }

    .welcome-icon {
        width: 60px;
        height: 60px;
    }

    .welcome-title {
        font-size: 18px;
    }

    .welcome-subtitle {
        font-size: 12px;
    }

    .quick-action-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .quick-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ======================================== */
/* SESSIONS LIST - Responsive */
/* ======================================== */

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E4EAF2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #14274A;
}

.sidebar-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.sidebar-close {
    background: none;
    border: none;
    color: #6E7B8F;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

    .sidebar-close:hover {
        background: #F4F7FB;
        color: #14274A;
    }

.sidebar-actions {
    padding: 16px 20px;
}

.btn-new-chat {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #48A0D8, #0D6EFD);
    border: none;
    border-radius: 12px;
    color: #FFFFFF;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

    .btn-new-chat:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(72, 160, 216, 0.3);
    }

.sidebar-section {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6E7B8F;
    margin-bottom: 12px;
}

.session-item {
    padding: 10px;
    background: #F8FAFE;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

    .session-item:hover {
        background: #F0F7FF;
        border-color: #48A0D8;
        transform: translateX(-4px);
    }

.session-icon {
    width: 32px;
    height: 32px;
    background: #E8F0FE;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .session-icon i {
        font-size: 16px;
        color: #48A0D8;
    }

.session-content {
    flex: 1;
    min-width: 0;
}

.session-title {
    font-size: 13px;
    font-weight: 600;
    color: #14274A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-date {
    font-size: 10px;
    color: #6E7B8F;
    margin-top: 2px;
}

.session-delete {
    width: 28px;
    height: 28px;
    background: rgba(220, 53, 69, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

    .session-delete:hover {
        background: rgba(220, 53, 69, 0.2);
        transform: scale(1.05);
    }

    .session-delete i {
        font-size: 12px;
        color: #DC3545;
    }

.empty-sessions {
    text-align: center;
    padding: 24px 16px;
    color: #6E7B8F;
}

    .empty-sessions i {
        font-size: 40px;
        margin-bottom: 10px;
        color: #48A0D8;
    }

    .empty-sessions p {
        font-size: 12px;
    }

/* ======================================== */
/* CARDS & PANELS - Responsive */
/* ======================================== */

.card-panel {
    background: #FFFFFF !important;
    border: 1px solid #E4EAF2 !important;
    align-self: flex-start !important;
    max-width: 90% !important;
    border-radius: 20px !important;
    padding: 3px !important;
}

@media (min-width: 768px) {
    .card-panel {
        max-width: 70% !important;
    }
}

@media (min-width: 992px) {
    .card-panel {
        max-width: 60% !important;
    }
}

.knowledge-card,
.service-card {
    padding: 12px;
    margin: 6px 0;
    background: #F8FAFE;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

    .knowledge-card:hover,
    .service-card:hover {
        background: #F0F7FF;
        transform: translateX(-4px);
    }

.knowledge-card-icon,
.service-card-icon {
    width: 40px;
    height: 40px;
    background: #FFFFFF;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .knowledge-card-icon i,
    .service-card-icon i {
        font-size: 18px;
        color: #48A0D8;
    }

.knowledge-card-content,
.service-card-content {
    flex: 1;
    min-width: 0;
}

    .knowledge-card-content h4,
    .service-card-content h4 {
        font-size: 13px;
        font-weight: 700;
        color: #14274A;
        margin: 0 0 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .knowledge-card-content p,
    .service-card-content p {
        font-size: 11px;
        color: #6E7B8F;
        margin: 0;
    }

.citations {
    margin-top: 10px;
    padding: 10px;
    background: #F8FAFE;
    border-radius: 12px;
}

.citations-header {
    font-size: 11px;
    margin-bottom: 8px;
}

.citation-item {
    padding: 6px 0;
}

.citation-source {
    font-size: 11px;
}

.citation-link {
    font-size: 10px;
}

/* ======================================== */
/* RTL SPECIFIC ADJUSTMENTS */
/* ======================================== */

[dir="rtl"] .chat-sidebar {
    border-left: none;
    border-right: 1px solid #E4EAF2;
}

[dir="rtl"] .chat-sidebar {
    right: auto;
    left: 0;
}

@media (max-width: 991px) {
    [dir="rtl"] .chat-sidebar {
        right: auto;
        left: 0;
        transform: translateX(-100%);
    }

        [dir="rtl"] .chat-sidebar.show {
            transform: translateX(0);
        }
}

[dir="rtl"] .session-item:hover {
    transform: translateX(4px);
}

[dir="rtl"] .knowledge-card:hover,
[dir="rtl"] .service-card:hover {
    transform: translateX(4px);
}

[dir="rtl"] .knowledge-arrow,
[dir="rtl"] .service-arrow {
    transform: rotate(180deg);
}

[dir="rtl"] .message-user {
    align-self: flex-start;
}

[dir="rtl"] .message-assistant {
    align-self: flex-end;
}

[dir="rtl"] .message-user .message-text {
    border-radius: 18px 18px 18px 4px;
}

[dir="rtl"] .message-assistant .message-text {
    border-radius: 18px 18px 4px 18px;
}

[dir="rtl"] .message-user .message-time {
    text-align: right;
}

[dir="rtl"] .message-assistant .message-time {
    text-align: left;
}

[dir="rtl"] .card-panel {
    align-self: flex-end !important;
}

[dir="rtl"] .typing-indicator {
    border-radius: 18px 18px 4px 18px;
}

[dir="rtl"] .message-header {
    justify-content: flex-end;
}

/* ======================================== */
/* SCROLLBAR STYLING */
/* ======================================== */

.chat-messages::-webkit-scrollbar,
.sidebar-section::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-track,
.sidebar-section::-webkit-scrollbar-track {
    background: #F4F7FB;
}

.chat-messages::-webkit-scrollbar-thumb,
.sidebar-section::-webkit-scrollbar-thumb {
    background: #C5D0DE;
    border-radius: 3px;
}

    .chat-messages::-webkit-scrollbar-thumb:hover,
    .sidebar-section::-webkit-scrollbar-thumb:hover {
        background: #A0ABBF;
    }

/* ======================================== */
/* ANIMATIONS */
/* ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble {
    animation: fadeInUp 0.3s ease;
}

/* ======================================== */
/* TYPING INDICATOR */
/* ======================================== */

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 14px;
    background: #FFFFFF;
    border: 1px solid #E4EAF2;
    border-radius: 18px 18px 18px 4px;
    width: fit-content;
}

    .typing-indicator span {
        width: 6px;
        height: 6px;
        background: #A0ABBF;
        border-radius: 50%;
        animation: typing 1.4s infinite ease-in-out;
    }

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}


/* ======================================== */
/* WIDGET RENDERER - Restored and Enhanced */
/* ======================================== */

.widget-renderer {
    width: 100%;
}

/* Button list styles (default) */
.widget-renderer-button-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.widget-node {
    width: 100%;
    text-align: right;
    padding: 12px 16px;
    background: #F8FAFE;
    border: 1px solid #E4EAF2;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

    .widget-node:hover {
        background: #F0F7FF;
        border-color: #48A0D8;
        transform: translateX(-4px);
    }

.widget-node-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.widget-node-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border-radius: 8px;
    flex-shrink: 0;
}

    .widget-node-icon i {
        font-size: 16px;
        color: #48A0D8;
    }

.widget-node-title {
    font-size: 14px;
    font-weight: 600;
    color: #14274A;
}

.widget-node-desc {
    font-size: 12px;
    color: #6E7B8F;
    margin-bottom: 8px;
    line-height: 1.4;
    padding-right: 42px;
}

.widget-node-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #48A0D8;
    padding-right: 42px;
}

    .widget-node-meta i {
        font-size: 12px;
        transition: transform 0.2s ease;
    }

.widget-node:hover .widget-node-meta i {
    transform: translateX(-4px);
}

/* Card list styles */
.widget-renderer-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.widget-node-card {
    padding: 16px;
    background: #FFFFFF;
    border: 1px solid #E4EAF2;
    border-radius: 16px;
    text-align: right;
}

    .widget-node-card .widget-node-header {
        margin-bottom: 10px;
    }

    .widget-node-card .widget-node-icon {
        width: 44px;
        height: 44px;
        background: #F0F7FF;
        border-radius: 12px;
    }

        .widget-node-card .widget-node-icon i {
            font-size: 22px;
        }

    .widget-node-card .widget-node-title {
        font-size: 15px;
    }

    .widget-node-card .widget-node-desc {
        padding-right: 0;
        margin-bottom: 12px;
    }

    .widget-node-card .widget-node-meta {
        padding-right: 0;
        border-top: 1px solid #E4EAF2;
        padding-top: 10px;
        margin-top: 4px;
    }

/* Quick replies styles */
.widget-renderer-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.widget-node-chip {
    padding: 8px 16px;
    background: #FFFFFF;
    border: 1px solid #48A0D8;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    color: #48A0D8;
    width: auto;
}

    .widget-node-chip:hover {
        background: #48A0D8;
        color: white;
        transform: translateY(-2px);
    }

    .widget-node-chip .widget-node-header {
        margin-bottom: 0;
    }

    .widget-node-chip .widget-node-icon {
        display: none;
    }

    .widget-node-chip .widget-node-title {
        font-size: 13px;
        color: inherit;
    }

/* Link list styles */
.widget-renderer-link-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.widget-node-link {
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #E4EAF2;
    border-radius: 0;
}

    .widget-node-link:hover {
        background: #F8FAFE;
        transform: none;
    }

    .widget-node-link .widget-node-header {
        margin-bottom: 0;
    }

    .widget-node-link .widget-node-icon {
        width: 24px;
        height: 24px;
    }

        .widget-node-link .widget-node-icon i {
            font-size: 14px;
        }

    .widget-node-link .widget-node-title {
        font-size: 13px;
    }

    .widget-node-link .widget-node-meta {
        display: none;
    }

/* Accordion styles */
.widget-renderer-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.widget-accordion-item {
    background: #F8FAFE;
    border: 1px solid #E4EAF2;
    border-radius: 12px;
    overflow: hidden;
}

    .widget-accordion-item summary {
        padding: 14px 16px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 600;
        color: #14274A;
        list-style: none;
    }

        .widget-accordion-item summary::-webkit-details-marker {
            display: none;
        }

        .widget-accordion-item summary::before {
            content: "▶";
            margin-left: 10px;
            font-size: 12px;
            transition: transform 0.2s;
        }

    .widget-accordion-item[open] summary::before {
        transform: rotate(90deg);
    }

    .widget-accordion-item .widget-node-icon {
        width: 28px;
        height: 28px;
    }

    .widget-accordion-item .widget-node-desc {
        padding: 0 16px 12px 16px;
        margin: 0;
    }

    .widget-accordion-item .btn {
        margin: 0 16px 16px 16px;
    }

/* ======================================== */
/* WIDGET ACTION RESULT */
/* ======================================== */

.widget-action-card {
    background: #F8FAFE;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.widget-action-kicker {
    font-size: 11px;
    text-transform: uppercase;
    color: #48A0D8;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.widget-action-title {
    font-size: 18px;
    font-weight: 700;
    color: #14274A;
    margin-bottom: 16px;
}

.widget-action-section {
    margin-bottom: 12px;
}

.widget-action-section-label {
    font-size: 11px;
    font-weight: 600;
    color: #6E7B8F;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.widget-action-section-text {
    font-size: 14px;
    color: #223046;
    line-height: 1.5;
}

.widget-action-text {
    font-size: 14px;
    color: #223046;
    line-height: 1.6;
}

/* External link button */
.external-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #48A0D8;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

    .external-link:hover {
        background: #14274A;
        color: white;
        transform: translateY(-2px);
    }

/* Back action button */
.back-action {
    padding: 10px 16px;
    background: none;
    border: 1px solid #E4EAF2;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #6E7B8F;
    transition: all 0.2s;
    margin-top: 12px;
}

    .back-action:hover {
        background: #F8FAFE;
        border-color: #48A0D8;
        color: #48A0D8;
    }

/* Placeholder box */
.placeholder-box {
    border: 1px dashed #E4EAF2;
    border-radius: 12px;
    padding: 24px;
    background: #F8FAFE;
    color: #6E7B8F;
    text-align: center;
    font-size: 13px;
}

/* ======================================== */
/* RTL Adjustments for Widgets */
/* ======================================== */

[dir="rtl"] .widget-node:hover {
    transform: translateX(4px);
}

[dir="rtl"] .widget-node-meta i {
    transform: rotate(180deg);
}

[dir="rtl"] .widget-node:hover .widget-node-meta i {
    transform: translateX(4px) rotate(180deg);
}

[dir="rtl"] .widget-accordion-item summary::before {
    content: "◀";
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .widget-accordion-item[open] summary::before {
    transform: rotate(-90deg);
}

[dir="rtl"] .knowledge-card:hover,
[dir="rtl"] .service-card:hover {
    transform: translateX(4px);
}

[dir="rtl"] .knowledge-arrow,
[dir="rtl"] .service-arrow {
    transform: rotate(180deg);
}

/* ======================================== */
/* Responsive Widgets */
/* ======================================== */

@media (max-width: 767px) {
    .widget-renderer-card-list {
        grid-template-columns: 1fr;
    }

    .widget-node-card .widget-node-icon {
        width: 36px;
        height: 36px;
    }

        .widget-node-card .widget-node-icon i {
            font-size: 18px;
        }

    .widget-node-title {
        font-size: 13px;
    }

    .widget-node-desc {
        font-size: 11px;
    }

    .widget-action-title {
        font-size: 16px;
    }

    .widget-action-section-text {
        font-size: 13px;
    }
}

@media (max-width: 575px) {
    .widget-node {
        padding: 10px 12px;
    }

    .widget-node-icon {
        width: 28px;
        height: 28px;
    }

        .widget-node-icon i {
            font-size: 14px;
        }

    .widget-node-title {
        font-size: 12px;
    }

    .widget-node-desc {
        font-size: 10px;
        padding-right: 36px;
    }

    .widget-node-meta {
        font-size: 10px;
        padding-right: 36px;
    }

    .widget-node-chip {
        padding: 6px 12px;
        font-size: 11px;
    }

    .widget-action-card {
        padding: 12px;
    }

    .back-action {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ======================================== */
/* CITATIONS STYLES */
/* ======================================== */

.citations {
    margin-top: 12px;
    padding: 12px;
    background: #F8FAFE;
    border-radius: 12px;
    border-right: 3px solid #48A0D8;
}

.citations-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #14274A;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #E4EAF2;
}

    .citations-header i {
        font-size: 14px;
        color: #FFCD35;
    }

.citation-item {
    padding: 8px 0;
    border-bottom: 1px solid #E4EAF2;
}

    .citation-item:last-child {
        border-bottom: none;
    }

.citation-source {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #48A0D8;
    margin-bottom: 4px;
}

    .citation-source i {
        font-size: 12px;
    }

.citation-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6E7B8F;
    text-decoration: none;
    padding: 4px 8px;
    background: #FFFFFF;
    border-radius: 6px;
    transition: all 0.2s;
}

    .citation-link:hover {
        color: #48A0D8;
        background: #F0F7FF;
    }

.citation-ref {
    font-size: 11px;
    color: #6E7B8F;
    display: block;
    margin-top: 4px;
}

.citation-preview {
    margin-top: 6px;
}

    .citation-preview summary {
        font-size: 11px;
        color: #A0ABBF;
        cursor: pointer;
        display: inline-block;
        padding: 2px 0;
    }

        .citation-preview summary:hover {
            color: #48A0D8;
        }

.preview-content {
    margin-top: 8px;
    padding: 8px;
    background: #FFFFFF;
    border-radius: 8px;
    font-size: 11px;
    color: #6E7B8F;
    line-height: 1.5;
}

/* RTL for citations */
[dir="rtl"] .citations {
    border-right: none;
    border-left: 3px solid #48A0D8;
}

.card-panel-header {
    padding: 12px 14px;
    font-size: 14px;
}

    .card-panel-header i {
        font-size: 18px;
    }