:root {
    /* Component-specific colors (light theme) */
    --app-background: #FFFFFF;

    /* Text */
    --text-primary: #000000;
    --text-secondary: #748195;
    --text-strong: #1a365d;

    /* Borders & Shadows */
    --ui-border: #E2E8F0;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-heavy: rgba(0, 0, 0, 0.25);

    /* Header */
    --chat-header-bg: #004D8F;
    --chat-header-text: #FFFFFF;

    /* Avatars */
    --avatar-bg-user: #004D8F; /* no */
    --avatar-bg-bot: #13A538;
    --avatar-text: #FFFFFF; /* no */

    /* Messages */
    --msg-user-bg: #004D8F;
    --msg-user-text: #FFFFFF;
    --msg-bot-bg: #FFFFFF;
    --msg-bot-text: #000000;
    --msg-bot-border: #E2E8F0;

    /* Typing */
    --typing-bg: #FFFFFF;
    --typing-border: #004D8F;
    --typing-dot: #00B2E2;

    /* Inputs */
    --input-area-bg: #FFFFFF;
    --input-border: #E2E8F0;
    --input-text: #000000;
    --input-placeholder: #748195;
    --input-focus-border: #004D8F;

    /* Buttons */
    --send-btn-bg: #13A538;
    --send-btn-text: #FFFFFF;

    /* Suggestions */
    --suggestion-chip-bg: #FFFFFF;
    --suggestion-chip-border: #00B2E2;
    --suggestion-chip-text: #004D8F;
    --suggestion-chip-hover-bg: #004D8F;
    --suggestion-chip-hover-text: #FFFFFF;

    /* System */
    --system-assistant-ended-text: #7b8a99;
    --system-agent-started-text: #13A538;

    /* Modal */
    --modal-bg: #FFFFFF;
    --modal-confirm-bg: #004D8F;
    --modal-confirm-text: #FFFFFF;
    --modal-cancel-bg: #006EC826;
    --modal-cancel-text: #006BD6DB;
    --warning-orange: #FFC585;
    --warning-icon-color: #FFFFFF;

    /* Notifications */
    --notify-title: #333;
    --notify-body: #666;
    --notify-subtle: #888;
    --notify-bg: #004D8F;

    /* Typography */
    --font-family-sans-serif: "DM Sans";
}

[data-theme="dark"] {
    /* Component-specific colors (dark theme) */
    --app-background: #07121e;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #ffffffed;
    --text-strong: #ffffff;

    /* Borders & Shadows */
    --ui-border: #234363;
    --shadow-light: #07121eb3;
    --shadow-medium: #0b0f2b0d;
    --shadow-heavy: #07121e;

    /* Header */
    --chat-header-bg: #6bb8ff;
    --chat-header-text: #07121e;

    /* Avatars */
    --avatar-bg-user: #6bb8ff; /* no */
    --avatar-bg-bot: #30a46c;
    --avatar-text: #07121e; /* no */

    /* Messages */
    --msg-user-bg: #6bb8ff;
    --msg-user-text: #07121e;
    --msg-bot-bg: #07121e;
    --msg-bot-text: #ffffff;
    --msg-bot-border: #234363;

    /* Typing */
    --typing-bg: #07121e;
    --typing-border: #6bb8ff;
    --typing-dot: #0f8dffc2;

    /* Inputs */
    --input-area-bg: #07121e;
    --input-border: #234363;
    --input-text: #ffffff;
    --input-placeholder: #ffffffed;
    --input-focus-border: #6bb8ff;

    /* Buttons */
    --send-btn-bg: #30a46c;
    --send-btn-text: #07121e;

    /* Suggestions */
    --suggestion-chip-bg: #07121e;
    --suggestion-chip-border: #0f8dffc2;
    --suggestion-chip-text: #6bb8ff;
    --suggestion-chip-hover-bg: #6bb8ff;
    --suggestion-chip-hover-text: #07121e;

    /* System */
    --system-assistant-ended-text: #ffffff63;
    --system-agent-started-text: #30a46c;

    /* Modal */
    --modal-bg: #07121e;
    --modal-confirm-bg: #6bb8ff;
    --modal-confirm-text: #07121e;
    --modal-cancel-bg: #6aabfe40;
    --modal-cancel-text: #6bb8ff;
    --warning-orange: #f39200;
    --warning-icon-color: #FFFFFF;

    /* Notifications */
    --notify-title: #ffffffed;
    --notify-body: #ffffff73;
    --notify-subtle: #ffffff54;
    --notify-bg: #6bb8ff;
}

body, .chat-container, .chat-content {
    background: var(--app-background) !important;
}

html, body {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    font-family: var(--font-family-sans-serif);
    font-size: 15px;
}

body {
    margin: 0;
    padding: 0;
    background-color: transparent;
    font-family: var(--font-family-sans-serif);
    font-size: 16px;
}

.chat-container {
    width: 100vw;
    height: 100vh;
    background: var(--app-background);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 40px var(--shadow-light);
}

.chat-container.open {
    transform: translateY(0);
    opacity: 1;
}

.chat-header {
    background: var(--chat-header-bg);
    padding: 0;
    border-bottom: 2px;
    box-shadow: 0 2px 20px var(--shadow-light);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px;
}

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

.avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chat-header-text);
    font-size: 18px;
    backdrop-filter: blur(10px);
}

.header-text h3 {
    margin: 0;
    color: var(--chat-header-text);
    font-weight: 500;
    font-size: 16px;
    line-height: 17.62px;
    letter-spacing: 0;
    font-family: var(--font-family-sans-serif);
}

.status {
    color: rgba(255, 255, 255, 0.8);
    font-family: "DM Sans";
    font-weight: 400;
    font-size: 13.02px;
    line-height: 100%;
    letter-spacing: 0;
    vertical-align: middle;
}

.header-actions {
    display: flex;
    gap: 0;
}

.icon-button {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 50%;
    color: var(--chat-header-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 18px;
    margin-left: 0;
}

.icon-button:hover {
    opacity: 0.8;
}

.icon-button img {
    width: 20px;
    height: 20px;
    display: block;
    /* filter: brightness(1.05) contrast(1.12);
    filter: brightness(1.05) contrast(1.12) drop-shadow(0 0 0.5px rgba(255,255,255,0.6)); */
}
.icon-button:hover img,
.icon-button:focus img {
    opacity: 0.8;
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--app-background);
    position: relative;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--app-background);
    scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--shadow-medium);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--shadow-heavy);
}

.message {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: messageSlideIn 0.3s ease-out;
}

.bot-message + .user-message {
    margin-top: 16px;
}

.user-message + .bot-message {
    margin-top: 16px;
}

.bot-message + .bot-message {
    margin-top: 4px;
}

.user-message + .user-message {
    margin-top: 4px;
}

.message.user-message {
    flex-direction: row-reverse;
}

.message.bot-message {
    flex-direction: row;
}

.message.bot-message.no-avatar {
    padding-left: 40px;
}

/* .message.user-message.no-avatar {
    padding-right: 40px;
} */

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--avatar-bg-user);
    color: var(--avatar-text);
}

.bot-message .message-avatar {
    background: var(--avatar-bg-bot);
    color: var(--avatar-text);
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    font-size: 14px;
    font-family: var(--font-family-sans-serif);
    font-weight: 400;
}

.user-message .message-content {
    background: var(--msg-user-bg);
    color: var(--msg-user-text);
    border-bottom-right-radius: 6px;
    line-height: 1.5;
    word-break: break-word;
}

.user-message .message-content br {
    line-height: 1.5;
}

.bot-message .message-content {
    background: var(--msg-bot-bg);
    color: var(--msg-bot-text);
    border: 0.92px solid var(--msg-bot-border);
    border-top-left-radius: 16.52px;
    border-top-right-radius: 16.52px;
    border-bottom-right-radius: 16.52px;
    border-bottom-left-radius: 5.51px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.bot-message .message-content strong,
.bot-message .message-content b {
    font-weight: 600;
    color: var(--text-strong);
}

.bot-message .message-content em,
.bot-message .message-content i {
    font-style: italic;
    color: var(--text-secondary);
}

.bot-message .message-content ul,
.bot-message .message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.bot-message .message-content li {
    margin: 4px 0;
    line-height: 1.5;
}

.bot-message .message-content p {
    margin: 8px 0;
}

.bot-message .message-content p:first-child {
    margin-top: 0;
}

.bot-message .message-content p:last-child {
    margin-bottom: 0;
}

.bot-message .message-content code {
    background: var(--ui-border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-family-monospace);
    font-size: 13px;
    color: var(--text-primary);
}

.bot-message .message-content pre {
    background: var(--app-background);
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 8px 0;
}

.bot-message .message-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.widget-html, .widget-body {
    background: transparent !important;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: visible;
}

.header-logo {
    width: 40px;
    height: 40px;
    margin-right: 2px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--app-background);
    box-shadow: 0 1px 4px var(--shadow-medium);
    display: inline-block;
    vertical-align: middle;
}

.modal-overlay.hidden {
    display: none;
}

.message-content a {
    color: inherit;
    text-decoration: none;
}

.message-content img {
    max-width: 200px;
    border-radius: 8px;
    margin-top: 8px;
}

.message.typing-message .typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--typing-dot);
    animation: typingDot 1.4s infinite ease-in-out;
    opacity: 0.7;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typingDot {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

@keyframes typingSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.input-area {
    background: var(--input-area-bg);
    border-top: 1px solid var(--input-border);
    padding: 16px 20px 0 20px;
    box-shadow: 0 -2px 20px var(--shadow-medium);
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.end-chat-btn { display: none !important; }

.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    /* background: #f7fafc; */
    border: 1px solid var(--input-border);
    border-radius: 24px;
    padding: 2px 2px;
    transition: all 0.3s ease;
    min-height: 0;
}

.input-wrapper:focus-within {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(0, 85, 150, 0.08);
}

#userInput {
    flex: 1;
    display: block;
    border: none;
    background: transparent;
    padding: 6px 10px;
    font-size: 14px;
    outline: none;
    color: var(--input-text);
    font-family: var(--font-family-sans-serif);
    min-height: 20px;
    max-height: 120px;
    height: auto;
    resize: none;
    overflow-y: auto;
    line-height: 1.4;
    word-wrap: break-word;
    transition: height 0.1s ease-out;
}

#userInput.auto-resize {
    height: var(--dynamic-height, 1.4em);
}

#userInput::placeholder {
    color: var(--input-placeholder);
}

.send-btn {
    width: 44px;
    height: 44px;
    background: var(--send-btn-bg);
    border: none;
    border-radius: 50%;
    color: var(--send-btn-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-medium);
    flex-shrink: 0;
    align-self: flex-end;
    /* margin-bottom: 4px; */
}

.send-btn img {
    width: 24px;
    height: 24px;
    display: block;
}

.send-btn:hover {
    opacity: 0.8;
}

.suggested-questions {
    /* background: white;
    border-radius: 16px; */
    margin: 0px 0px 0px 30px;
    /* border: 1px solid #e2e8f0; */
    overflow: hidden;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); */
    animation: suggestionsSlideIn 0.3s ease-out;
}

.suggestions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px 0px 24px;
    /* border-bottom: 1px solid #f1f5f9; */
    /* background: #f8fafc; */
}

.suggestions-header span {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family-sans-serif);
}

.suggestions-questions {
    padding: 6px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.suggested-question {
    background: var(--suggestion-chip-bg);
    border: 1px solid var(--suggestion-chip-border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--suggestion-chip-text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-family: var(--font-family-sans-serif);
    line-height: 100%;
    letter-spacing: 0;
}

.suggested-question:hover {
    background: var(--suggestion-chip-hover-bg);
    color: var(--suggestion-chip-hover-text);
    box-shadow: 0 4px 12px rgba(0, 85, 150, 0.15);
}

@keyframes suggestionsSlideIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
    .chat-container {
        border-radius: 0;
        height: 100vh;
    }
    
    .chat-header {
        border-radius: 0;
    }
    
    .messages-container {
        padding: 16px;
    }
    
    .input-area {
        padding: 10px 10px 0 10px;
    }
    
    .message-content {
        max-width: 75%;
    }
    
    .typing-indicator {
        padding: 0 6px 6px 6px;
    }
    
    .typing-content {
        max-width: 38px;
        padding: 5px 7px;
    }
    .typing-dots span {
        width: 4px;
        height: 4px;
    }
    
    #userInput {
        max-height: 100px;
        font-size: 15px;
    }
    
    /* .input-wrapper {
        min-height: 48px;
    } */
    
    .powered-by {
        margin: 0 -16px;
    }
}

.message-content a {
    color: inherit;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

/* .icon-button:focus,
.attach-btn:focus,
.send-btn:focus,
.end-chat-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
} */

* {
    transition: all 0.2s ease;
}

.typing-avatar { display: none !important; }

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.32);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-content {
  background: var(--modal-bg);
  /* Responsive padding: slightly more on left/right */
  padding-block: clamp(16px, 4vw, 40px);
  padding-inline: clamp(20px, 5vw, 32px);
  width: 90%;
  height: 100%;
  min-width: 90%;
  min-height: 100%;
  max-width: 100%;
  max-height: 100%;
  text-align: left;
  position: relative;
  animation: modalFadeIn 0.25s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  justify-content: center;   
  align-items: center;        
  border-radius: 0;
  box-shadow: none;
  overflow: auto;
}
.warning {
  position: relative;
  margin: 0 0 clamp(12px, 2.2vh, 20px) 0;
  color: var(--send-btn-text);
  width: clamp(56px, 8vmin, 80px);
  height: clamp(56px, 8vmin, 80px);
  border-radius: 50%;
  background: var(--warning-orange);
  box-shadow: 0 2px 8px rgba(0, 85, 150, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
}

.warning img {
  width: clamp(28px, 5vmin, 40px);
  height: clamp(28px, 5vmin, 40px);
  opacity: 0;
  position: relative;
  z-index: 1;
}

.warning::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(28px, 5vmin, 40px);
  height: clamp(28px, 5vmin, 40px);
  background-color: var(--warning-icon-color);
  -webkit-mask-image: url('../img/question.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url('../img/question.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  z-index: 2;
}
.modal-content p {
  color: var(--text-primary);
  font-size: clamp(18px, 2.2vmin, 22px);
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: 600;
  margin: clamp(14px, 2vh, 18px) 0 clamp(18px, 2.5vh, 24px) 0;
  font-family: var(--font-family-sans-serif);
  text-align: left;
  align-self: flex-start;                    
  max-width: min(90vw, 520px);           
}

.customer-feedback-notification {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.customer-feedback-content {
  background: var(--app-background);
  border-radius: 16px;
  padding: clamp(24px, 4vw, 32px);
  max-width: min(90vw, 480px);
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

.customer-feedback-content h3 {
  color: var(--text-primary);
  font-size: clamp(20px, 2.5vmin, 24px);
  font-weight: 600;
  margin: 0 0 clamp(12px, 2vh, 16px) 0;
  font-family: var(--font-family-sans-serif);
}

.customer-feedback-content p {
  color: var(--text-secondary);
  font-size: clamp(14px, 1.8vmin, 16px);
  margin: 0 0 clamp(16px, 2vh, 20px) 0;
  font-family: var(--font-family-sans-serif);
}

.customer-feedback-content .feedback-prompt {
  color: var(--text-primary);
  font-weight: 500;
  font-size: clamp(16px, 2vmin, 18px);
  margin: clamp(20px, 3vh, 28px) 0 clamp(16px, 2vh, 20px) 0;
}

.thumbs-feedback {
  display: flex;
  gap: clamp(20px, 4vw, 32px);
  justify-content: center;
  align-items: center;
  margin: clamp(20px, 3vh, 28px) 0;
}

.thumbs-btn {
  width: clamp(64px, 12vw, 80px);
  height: clamp(64px, 12vw, 80px);
  border-radius: 50%;
  border: 1px solid var(--input-border);
  background: var(--app-background);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: clamp(28px, 5vmin, 36px);
  color: var(--text-secondary);
}

.thumbs-btn:hover {
  opacity: 0.8;
}

.thumbs-btn.active {
  border-color: var(--send-btn-bg);
  background: var(--send-btn-bg);
  color: white;
  box-shadow: 0 4px 16px rgba(19, 165, 56, 0.3);
}

.thumbs-btn.thumbs-down.active {
  border-color: #ef4444;
  background: #ef4444;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.feedback-comment-section {
  margin-top: clamp(20px, 3vh, 28px);
  text-align: left;
}

.feedback-comment-section.hidden {
  display: none;
}

.feedback-comment-input {
  width: 100%;
  padding: clamp(10px, 2vmin, 12px) clamp(12px, 2.5vmin, 16px);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  font-size: clamp(14px, 1.8vmin, 16px);
  font-family: var(--font-family-sans-serif);
  color: var(--input-text);
  background: var(--app-background);
  resize: vertical;
  min-height: 80px;
  max-height: 150px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: clamp(6px, 1vh, 8px);
  box-sizing: border-box;
}

.feedback-comment-input:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(0, 85, 150, 0.08);
}

.feedback-comment-input::placeholder {
  color: var(--input-placeholder);
}

.feedback-char-count {
  text-align: right;
  font-size: clamp(12px, 1.5vmin, 14px);
  color: var(--text-secondary);
  font-family: var(--font-family-sans-serif);
  margin-bottom: clamp(12px, 2vh, 16px);
}

.submit-feedback-btn {
  width: 100%;
  padding: clamp(12px, 2.2vmin, 16px) clamp(16px, 3vmin, 20px);
  background: var(--modal-confirm-bg);
  color: var(--modal-confirm-text);
  border: none;
  border-radius: 12px;
  font-size: clamp(14px, 1.8vmin, 16px);
  font-weight: 600;
  font-family: var(--font-family-sans-serif);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: clamp(12px, 2vh, 16px);
}

.submit-feedback-btn:hover {
  opacity: 0.8;
}

.skip-feedback-btn {
  width: 100%;
  padding: clamp(10px, 2vmin, 14px) clamp(16px, 3vmin, 20px);
  background: var(--modal-cancel-bg);
  color: var(--modal-cancel-text);
  border: none;
  border-radius: 12px;
  font-size: clamp(14px, 1.8vmin, 16px);
  font-weight: 500;
  font-family: var(--font-family-sans-serif);
  cursor: pointer;
  transition: all 0.3s ease;
}

.skip-feedback-btn:hover {
  opacity: 0.8;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.modal-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: clamp(10px, 2vw, 14px);
  width: 100%;
  max-width: min(90vw, 480px);
  margin: 0;                 
  margin-top: clamp(60px, 2.2vh, 24px);
}
.modal-confirm,
.modal-cancel {
  width: 100%;
  min-width: 0;
  padding: clamp(12px, 2.2vmin, 16px) clamp(16px, 3vmin, 20px);
  font-size: clamp(14px, 1.8vmin, 16px);
  border-radius: 28px;
  font-weight: 600;
}

.modal-confirm {
  background: var(--modal-confirm-bg);
  color: var(--modal-confirm-text);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow-medium);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  font-weight: 500;
  opacity: 1;
}
/* .modal-confirm::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
} */

.modal-confirm:hover {
  opacity: 0.8;
}
.modal-cancel {
  background: var(--modal-cancel-bg);
  color: var(--modal-cancel-text);
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  font-weight: 600;
  opacity: 1;
}
/* .modal-cancel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 110, 200, 0.1), rgba(0, 107, 214, 0.15));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 20px;
} */

.modal-cancel:hover {
  opacity: 0.8;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 500px) {
  .modal-actions {
    max-width: min(100vw, 420px);
  }
}

@media (max-width: 400px) {
  
  .modal-content p {
    font-size: 16px;
    margin: 12px 0 20px 0;
  }
  
  .warning {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
  }
  
  .warning img {
    width: 30px;
    height: 30px;
  }
  
  .warning::after {
    width: 30px;
    height: 30px;
  }
  
  .modal-actions {
    max-width: min(100vw, 360px);
  }
}

@media (max-width: 300px) {
  .modal-content p {
    font-size: 14px;
    margin: 10px 0 15px 0;
  }
  
  .warning {
    width: 50px;
    height: 50px;
  }
  
  .warning img {
    width: 25px;
    height: 25px;
  }
  
  .warning::after {
    width: 25px;
    height: 25px;
  }
  
  .modal-actions {
    max-width: min(100vw, 320px);
  }
}

.system-message {
    width: auto;
    max-width: 70%;
    min-width: 120px;
    text-align: center;
    font-size: 13px;
    margin: 12px auto 12px auto;
    padding: 7px 18px;
    border-radius: 10px;
    line-height: 1.5;
    letter-spacing: 0.01em;
    animation: messageSlideIn 0.3s ease-out;
    user-select: none;
    word-break: break-word;
    white-space: normal;
    background: none !important;
    box-shadow: none;
    display: block;
    font-family: var(--font-family-sans-serif);
}
.system-message.assistant-ended {
    color: var(--system-assistant-ended-text);
    font-style: italic;
    font-weight: 400;
    border: none;
}
.system-message.agent-started {
    color: var(--system-agent-started-text);
    font-weight: 600;
    border: none;
}

.powered-by {
    text-align: center;
    font-size: 10px;
    color: var(--text-secondary);
    padding: 8px 0 12px 0;
    font-family: var(--font-family-sans-serif);
    /* background: #f8fafc; */
    margin: 0 -20px;
    /* border-top: 1px solid #e2e8f0; */
  }

.agent-end-notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--shadow-heavy);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.agent-end-notification {
    background: var(--modal-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 25px 80px var(--shadow-heavy);
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: slideIn 0.4s ease-out;
}

.notification-icon {
    width: 80px;
    height: 80px;
    background: var(--notify-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--modal-confirm-text);
    font-size: 32px;
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.agent-end-notification h3 {
    margin: 0 0 15px 0;
    color: var(--notify-title);
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-family-sans-serif);
}

.agent-end-notification p {
    margin: 0 0 12px 0;
    color: var(--notify-body);
    line-height: 1.6;
    font-size: 16px;
    font-family: var(--font-family-sans-serif);
}

.agent-end-notification p:last-of-type {
    margin-bottom: 25px;
    color: var(--notify-subtle);
    font-size: 14px;
}

.notification-btn {
    background: var(--notify-bg);
    color: var(--modal-confirm-text);
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px var(--shadow-medium);
}

.notification-btn:hover {
    opacity: 0.8;
}

.notification-btn:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 500px) {
    .agent-end-notification {
        padding: 30px 20px;
        max-width: 95%;
        margin: 0 10px;
    }
    
    .notification-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .agent-end-notification h3 {
        font-size: 20px;
    }
    
    .agent-end-notification p {
        font-size: 14px;
    }
    
    .notification-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

.avatar-image {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--app-background);
    object-fit: contain;
    box-shadow: 0 1px 4px var(--shadow-medium);
}

.auto-resize {
    height: auto !important;
    min-height: 20px !important;
    max-height: 120px !important;
    transition: height 0.1s ease-out;
}

.dynamic-height-auto {
    height: auto !important;
}

.dynamic-height-20 { height: 20px !important; }
.dynamic-height-25 { height: 25px !important; }
.dynamic-height-30 { height: 30px !important; }
.dynamic-height-35 { height: 35px !important; }
.dynamic-height-40 { height: 40px !important; }
.dynamic-height-45 { height: 45px !important; }
.dynamic-height-50 { height: 50px !important; }
.dynamic-height-55 { height: 55px !important; }
.dynamic-height-60 { height: 60px !important; }
.dynamic-height-65 { height: 65px !important; }
.dynamic-height-70 { height: 70px !important; }
.dynamic-height-75 { height: 75px !important; }
.dynamic-height-80 { height: 80px !important; }
.dynamic-height-85 { height: 85px !important; }
.dynamic-height-90 { height: 90px !important; }
.dynamic-height-95 { height: 95px !important; }
.dynamic-height-100 { height: 100px !important; }
.dynamic-height-105 { height: 105px !important; }
.dynamic-height-110 { height: 110px !important; }
.dynamic-height-115 { height: 115px !important; }
.dynamic-height-120 { height: 120px !important; }

.agent-ended-notification {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--shadow-heavy);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.agent-ended-content {
    background: var(--modal-bg);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
}

.agent-ended-content h3 {
    color: var(--notify-title);
    margin-bottom: 15px;
}

.agent-ended-content p {
    color: var(--notify-body);
    margin-bottom: 10px;
}

.agent-ended-content .warning-text {
    color: var(--notify-subtle);
    margin-bottom: 20px;
}

.start-new-chat-btn {
    background: var(--modal-confirm-bg);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.start-new-chat-btn:hover {
    opacity: 0.8;
}

.rtl {
    direction: rtl;
}

.rtl .header-text h3 {
    font-size: 15px;
}

.rtl .message {
    flex-direction: row-reverse;
}

.rtl .message.user-message {
    flex-direction: row-reverse !important;  
    align-self: flex-start;  
    margin-right: auto;
    margin-left: 0;
}

.rtl .message.bot-message {
    flex-direction: row;  
    align-self: flex-end; 
    margin-left: auto;
    margin-right: 0;
}

.rtl .message.bot-message.no-avatar {
    padding-right: 40px;
    /* padding-left: 40px; */
}

.rtl .message.user-message.no-avatar {
    padding-left: 0px;
    padding-right: 40px;
}

.rtl .message-content {
    text-align: right;
}

.rtl .message-content ul,
.rtl .message-content ol {
    padding-right: 20px;
    padding-left: 0;
}

.rtl .user-message .message-content {
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 6px;  
}

.rtl .bot-message .message-content {
    border-top-left-radius: 16.52px;
    border-top-right-radius: 16.52px;
    border-bottom-left-radius: 16.52px;  
    border-bottom-right-radius: 5.51px;  
}

.rtl .suggested-questions {
    margin: 0px 30px 0px 0px;
}

.rtl .send-btn {
    order: 1;
    rotate: 180deg;
}

.rtl .typing-indicator {
    flex-direction: row-reverse;
    justify-content: flex-end;  
    align-self: flex-end;  
    margin-left: auto;
    margin-right: 0;
}

.rtl .typing-content {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 5px;  
}

.rtl #userInput {
    text-align: right;
}

.rtl #userInput::placeholder {
    text-align: right;
}

.rtl .modal-content p {
    margin: 18px 0px 115px 70px;
}

.rtl .modal-content,
.rtl .modal-content p,
.rtl .agent-ended-content,
.rtl .agent-ended-content h3,
.rtl .agent-ended-content p {
    text-align: right;
}

.rtl .suggestions-header {
    text-align: right;
}

.rtl .customer-feedback-content {
    direction: rtl;
    text-align: right;
    font-family: "Noto Sans Arabic", var(--font-family-sans-serif);
}

.rtl .customer-feedback-content h3,
.rtl .customer-feedback-content p,
.rtl .customer-feedback-content .feedback-prompt {
    text-align: right;
}

.rtl .thumbs-feedback {
    flex-direction: row-reverse;
}

.rtl .feedback-comment-section {
    text-align: right;
}

.rtl .feedback-comment-input {
    direction: rtl;
    text-align: right;
    font-family: "Noto Sans Arabic", var(--font-family-sans-serif);
}

.rtl .feedback-comment-input::placeholder {
    text-align: right;
}

.rtl .feedback-char-count {
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: left;
}