/**
 * SmartChat Widget Styles - Professional Modern Design
 * Inspired by Intercom, Drift, Crisp
 */

:root {
    --smartchat-primary: #0084ff;
    --smartchat-primary-dark: #0073e6;
    --smartchat-dark: #1a1a1a;
    --smartchat-light: #f7f7f7;
    --smartchat-border: #e4e4e7;
    --smartchat-text: #3f3f46;
    --smartchat-text-light: #71717a;
    --smartchat-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --smartchat-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
    --smartchat-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Widget container */
.smartchat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Chat bubble - Modern & Prominent */
.smartchat-bubble {
    width: 72px;
    height: 72px;
    border-radius: 36px;
    background: linear-gradient(135deg, var(--smartchat-primary) 0%, var(--smartchat-primary-dark) 100%);
    box-shadow: 0 4px 16px rgba(0, 132, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.smartchat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 132, 255, 0.5), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.smartchat-bubble:active {
    transform: scale(1.05);
}

.smartchat-bubble svg {
    width: 36px;
    height: 36px;
    fill: white;
}

/* Chat panel - Modern & Professional */
.smartchat-panel {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 420px;
    max-width: calc(100vw - 40px);
    height: 700px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 20px;
    box-shadow: var(--smartchat-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: inherit;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Panel header - Modern Gradient */
.smartchat-header {
    background: linear-gradient(135deg, var(--smartchat-primary) 0%, var(--smartchat-primary-dark) 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.smartchat-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
    flex: 1;
}

.smartchat-back-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.smartchat-back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.smartchat-back-btn svg {
    width: 20px;
    height: 20px;
    fill: white !important;
    display: block !important;
    visibility: visible !important;
}

.smartchat-back-btn svg path {
    fill: white !important;
}

.smartchat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.smartchat-handover-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.smartchat-handover-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.smartchat-handover-btn svg {
    width: 16px;
    height: 16px;
    fill: white !important;
    display: inline-block !important;
    visibility: visible !important;
}

.smartchat-handover-btn svg path {
    fill: white !important;
}

.smartchat-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    width: 36px;
    height: 36px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.smartchat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Home view - Clean & Inviting */
.smartchat-home {
    padding: 32px 24px;
    overflow-y: auto;
    flex: 1;
}

.smartchat-welcome {
    margin-bottom: 28px;
    color: var(--smartchat-dark);
}

.smartchat-welcome h4 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    letter-spacing: -0.4px;
}

.smartchat-welcome p {
    font-size: 15px;
    color: var(--smartchat-text-light);
    margin: 0;
    line-height: 1.5;
}

.smartchat-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.smartchat-option {
    padding: 20px;
    border: 2px solid var(--smartchat-border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    background: white;
}

.smartchat-option:hover {
    border-color: var(--smartchat-primary);
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: var(--smartchat-shadow);
}

.smartchat-option-icon {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    color: var(--smartchat-primary);
}

.smartchat-option-icon svg {
    width: 28px;
    height: 28px;
}

.smartchat-option-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--smartchat-dark);
}

.smartchat-option-subtitle {
    font-size: 14px;
    color: var(--smartchat-text-light);
    line-height: 1.4;
}

/* Secondary options (WhatsApp, Email) - more compact styling */
.smartchat-option-secondary {
    padding: 14px 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.smartchat-option-secondary .smartchat-option-icon {
    margin-bottom: 0;
    flex-shrink: 0;
}

.smartchat-option-secondary .smartchat-option-icon svg {
    width: 24px;
    height: 24px;
}

.smartchat-option-secondary .smartchat-option-title {
    font-size: 14px;
    margin-bottom: 2px;
}

.smartchat-option-secondary .smartchat-option-subtitle {
    font-size: 12px;
}

/* Pre-chat form - Modern Inputs */
.smartchat-form {
    padding: 32px 24px;
}

.smartchat-form-group {
    margin-bottom: 20px;
}

.smartchat-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--smartchat-dark);
}

.smartchat-form-group input,
.smartchat-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--smartchat-border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--smartchat-dark);
    transition: all 0.2s ease;
    background: white;
}

.smartchat-form-group input:focus,
.smartchat-form-group textarea:focus {
    outline: none;
    border-color: var(--smartchat-primary);
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

.smartchat-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--smartchat-primary) 0%, var(--smartchat-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.3);
}

.smartchat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 132, 255, 0.4);
}

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

/* Chat view - Clean Messages */
.smartchat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #fafafa;
}

.smartchat-message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

.smartchat-message.visitor,
.smartchat-message.user {
    align-items: flex-end;
}

.smartchat-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.smartchat-message.visitor .smartchat-message-bubble,
.smartchat-message.user .smartchat-message-bubble {
    background: linear-gradient(135deg, var(--smartchat-primary) 0%, var(--smartchat-primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.smartchat-message.agent .smartchat-message-bubble,
.smartchat-message.ai .smartchat-message-bubble {
    background: white;
    color: var(--smartchat-dark);
    border: 1px solid var(--smartchat-border);
    border-bottom-left-radius: 4px;
    box-shadow: var(--smartchat-shadow-sm);
}

.smartchat-message.system .smartchat-message-bubble {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 14px;
    text-align: center;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
}

.smartchat-message-time {
    font-size: 12px;
    color: var(--smartchat-text-light);
    margin-top: 6px;
    font-weight: 400;
}

.smartchat-message-sender {
    font-size: 11px;
    font-weight: 600;
    color: var(--smartchat-text-light);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smartchat-message.user .smartchat-message-sender {
    text-align: right;
    color: var(--smartchat-primary);
}

.smartchat-message.ai .smartchat-message-sender,
.smartchat-message.agent .smartchat-message-sender {
    color: #6b7280;
}

/* Markdown formatting inside messages */
.smartchat-message-bubble strong {
    font-weight: 600;
}

.smartchat-message-bubble em {
    font-style: italic;
}

.smartchat-message-bubble code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

.smartchat-message.user .smartchat-message-bubble code {
    background: rgba(255, 255, 255, 0.2);
}

.smartchat-message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.smartchat-message-bubble li {
    margin: 4px 0;
}

.smartchat-message-sources {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
}

.smartchat-message.visitor .smartchat-message-sources {
    border-top-color: #e4e4e7;
}

.smartchat-message-sources strong {
    display: block;
    margin-bottom: 6px;
    opacity: 0.9;
    font-weight: 500;
}

.smartchat-message-sources a {
    color: inherit;
    text-decoration: underline;
    margin-right: 10px;
    opacity: 0.9;
}

/* Escalation prompt when AI can't fully answer */
.smartchat-escalation-prompt {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 12px 0;
    text-align: center;
}

.smartchat-escalation-text {
    font-size: 13px;
    color: #92400e;
    margin-bottom: 10px;
    font-weight: 500;
}

.smartchat-escalation-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.smartchat-escalation-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Primary escalation button - Transfer to Human Chat */
.smartchat-escalation-primary {
    width: 100%;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--smartchat-primary) 0%, var(--smartchat-primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.3);
    justify-content: center;
}

.smartchat-escalation-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 132, 255, 0.4);
}

/* Secondary row for WhatsApp and Email */
.smartchat-escalation-secondary-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.smartchat-escalation-secondary-row:empty {
    display: none;
}

/* Secondary escalation buttons */
.smartchat-escalation-secondary {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
}

.smartchat-escalation-live {
    background: var(--smartchat-primary, #0084ff);
    color: #fff;
}

.smartchat-escalation-live:hover {
    background: #0073e6;
    transform: translateY(-1px);
}

.smartchat-escalation-whatsapp {
    background: #25d366;
    color: #fff;
}

.smartchat-escalation-whatsapp:hover {
    background: #20bd5a;
    transform: translateY(-1px);
}

.smartchat-escalation-email {
    background: #6b7280;
    color: #fff;
}

.smartchat-escalation-email:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.smartchat-escalation-btn svg {
    flex-shrink: 0;
}

.smartchat-message.visitor .smartchat-message-sources a {
    color: var(--smartchat-primary);
}

/* Typing indicator - Smooth Animation */
.smartchat-typing-dots {
    display: flex;
    gap: 6px;
    padding: 8px 0;
}

.smartchat-typing-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #a1a1aa;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.smartchat-typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.smartchat-typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input area - Modern & Prominent */
.smartchat-input {
    border-top: 1px solid var(--smartchat-border);
    padding: 20px 24px;
    background: white;
}

.smartchat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.smartchat-input-field {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--smartchat-border);
    border-radius: 26px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    max-height: 120px;
    background: white;
    color: var(--smartchat-dark);
    transition: all 0.2s ease;
}

.smartchat-input-field:focus {
    outline: none;
    border-color: var(--smartchat-primary);
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

.smartchat-input-field::placeholder {
    color: var(--smartchat-text-light);
}

.smartchat-send-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--smartchat-primary) 0%, var(--smartchat-primary-dark) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 20px;
    line-height: 1;
    text-align: center;
    padding: 0;
    margin: 0;
}

.smartchat-send-btn:hover {
    transform: scale(1.08) translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 132, 255, 0.5);
}

.smartchat-send-btn:active {
    transform: scale(1.02);
}

.smartchat-send-btn svg {
    width: 22px;
    height: 22px;
    fill: white !important;
    display: block !important;
    visibility: visible !important;
}

.smartchat-send-btn svg path {
    fill: white !important;
}

/* Loading state */
.smartchat-loading {
    text-align: center;
    padding: 48px 20px;
    color: var(--smartchat-text-light);
}

/* Mobile responsive */
@media (max-width: 480px) {
    .smartchat-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        /* Use dvh (dynamic viewport height) to handle mobile keyboard properly */
        /* Fallback to vh for older browsers */
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .smartchat-bubble {
        width: 66px;
        height: 66px;
    }
}

/* Branding */
.smartchat-branding {
    text-align: center;
    padding: 14px;
    font-size: 12px;
    color: var(--smartchat-text-light);
    border-top: 1px solid var(--smartchat-border);
    background: #fafafa;
}

.smartchat-branding a {
    color: var(--smartchat-primary);
    text-decoration: none;
    font-weight: 500;
}

.smartchat-branding a:hover {
    text-decoration: underline;
}

/* Utility classes */
.smartchat-hidden {
    display: none !important;
}

.smartchat-fade-in {
    animation: smartchatFadeIn 0.3s ease;
}

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

/* Quick Reply Chips */
.smartchat-quick-replies {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--smartchat-border);
}

.smartchat-quick-replies-label {
    font-size: 13px;
    color: var(--smartchat-text-light);
    margin-bottom: 12px;
    font-weight: 500;
}

.smartchat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.smartchat-chip {
    background: var(--smartchat-light);
    border: 1px solid var(--smartchat-border);
    border-radius: 16px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--smartchat-text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.smartchat-chip:hover {
    background: white;
    border-color: var(--smartchat-primary);
    color: var(--smartchat-primary);
    transform: translateY(-1px);
}

/* Inline Form Validation */
.smartchat-form-group.error input,
.smartchat-form-group.error textarea {
    border-color: #ef4444;
}

.smartchat-form-group.error input:focus,
.smartchat-form-group.error textarea:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.smartchat-error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Session Expired State */
.smartchat-session-expired {
    padding: 48px 24px;
    text-align: center;
}

.smartchat-expired-icon {
    color: var(--smartchat-text-light);
    margin-bottom: 16px;
}

.smartchat-session-expired h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--smartchat-dark);
}

.smartchat-session-expired p {
    font-size: 14px;
    color: var(--smartchat-text-light);
    margin: 0 0 24px 0;
    line-height: 1.5;
}

/* Optional email indicator */
.smartchat-optional {
    color: var(--smartchat-text-light);
    font-weight: 400;
    font-size: 12px;
}

/* Closed chat footer */
.smartchat-closed-footer {
    padding: 16px 20px;
    background: var(--smartchat-light);
    border-top: 1px solid var(--smartchat-border);
    text-align: center;
}

.smartchat-closed-footer p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: var(--smartchat-text-light);
}

.smartchat-closed-footer .smartchat-btn {
    width: auto;
    padding: 10px 24px;
}

/* System message in chat */
.smartchat-system-message {
    text-align: center;
    padding: 20px;
    color: var(--smartchat-text-light);
    font-size: 14px;
}

/* Scrollbar styling */
.smartchat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.smartchat-messages::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 3px;
}

.smartchat-messages::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

/* Recent Chats Section */
.smartchat-recent-chats {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--smartchat-border);
}

.smartchat-recent-chats-header {
    font-size: 13px;
    color: var(--smartchat-text-light);
    margin-bottom: 12px;
    font-weight: 500;
}

.smartchat-recent-chat-item {
    background: var(--smartchat-light);
    border: 1px solid var(--smartchat-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.smartchat-recent-chat-item:last-child {
    margin-bottom: 0;
}

.smartchat-recent-chat-item:hover {
    background: white;
    border-color: var(--smartchat-primary);
    transform: translateY(-1px);
    box-shadow: var(--smartchat-shadow-sm);
}

.smartchat-recent-chat-preview {
    font-size: 14px;
    color: var(--smartchat-text);
    margin-bottom: 6px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smartchat-recent-chat-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.smartchat-recent-chat-date {
    color: var(--smartchat-text-light);
}

.smartchat-recent-chat-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 11px;
}

.smartchat-recent-chat-status.open {
    background: #dcfce7;
    color: #16a34a;
}

.smartchat-recent-chat-status.closed {
    background: #f4f4f5;
    color: var(--smartchat-text-light);
}

/* Continue Session Banner */
.smartchat-continue-session {
    background: linear-gradient(135deg, var(--smartchat-primary) 0%, var(--smartchat-primary-dark) 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.smartchat-continue-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.smartchat-continue-info svg {
    fill: white;
    opacity: 0.9;
}

.smartchat-continue-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.smartchat-continue-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Continue Session Header */
.smartchat-continue-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.smartchat-continue-header svg {
    fill: white;
    opacity: 0.9;
    flex-shrink: 0;
}

.smartchat-continue-title {
    font-size: 14px;
    font-weight: 600;
}

.smartchat-continue-subtitle {
    font-size: 12px;
    opacity: 0.85;
}

/* Skip Button for Onboarding */
.smartchat-skip-option {
    text-align: center;
    margin: 12px 0;
}

.smartchat-skip-btn {
    background: transparent;
    border: 1px solid var(--smartchat-border);
    color: var(--smartchat-text-light);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.smartchat-skip-btn:hover {
    background: var(--smartchat-light);
    color: var(--smartchat-text);
    border-color: var(--smartchat-text-light);
}

/* Header Actions (End Chat, Handover buttons) */
.smartchat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.smartchat-end-btn,
.smartchat-handover-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.smartchat-end-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.smartchat-handover-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.smartchat-end-btn svg,
.smartchat-handover-btn svg {
    fill: white;
    width: 14px;
    height: 14px;
}

/* Back Button */
.smartchat-back-btn {
    background: transparent;
    border: none;
    color: white;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.smartchat-back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.smartchat-back-btn svg {
    fill: white;
    width: 20px;
    height: 20px;
}

/* Rating Modal */
.smartchat-rating-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.smartchat-rating-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    max-width: 280px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.smartchat-rating-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--smartchat-text);
}

.smartchat-rating-content p {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: var(--smartchat-text-light);
}

.smartchat-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.smartchat-star {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.smartchat-star:hover {
    transform: scale(1.2);
}

.smartchat-star.active {
    color: #ffc107;
}

.smartchat-rating-label {
    height: 20px;
    font-size: 14px;
    color: var(--smartchat-primary);
    font-weight: 500;
    margin-bottom: 20px;
}

.smartchat-rating-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.smartchat-rating-skip,
.smartchat-rating-submit {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.smartchat-rating-skip {
    background: transparent;
    border: 1px solid var(--smartchat-border);
    color: var(--smartchat-text-light);
}

.smartchat-rating-skip:hover {
    background: var(--smartchat-light);
    color: var(--smartchat-text);
}

.smartchat-rating-submit {
    background: var(--smartchat-light);
    border: 1px solid var(--smartchat-border);
    color: var(--smartchat-text-light);
}

.smartchat-rating-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.smartchat-rating-submit.active {
    background: linear-gradient(135deg, var(--smartchat-primary) 0%, var(--smartchat-primary-dark) 100%);
    border-color: var(--smartchat-primary);
    color: white;
}

.smartchat-rating-submit.active:hover {
    opacity: 0.9;
}
