:root {
    --chat-primary-color: #2563eb;
    --chat-primary-hover: #1d4ed8;
    --chat-secondary-color: #3b82f6;
    --chat-accent-color: #c2410c;

    --chat-bg: #fafafa;
    --chat-bg-gradient: #f8f9ff;
    --chat-surface: #ffffff;
    --chat-surface-elevated: #f8fafc;

    --chat-text: #1e293b;
    --chat-text-secondary: #64748b;
    --chat-text-light: #94a3b8;
    --chat-text-muted: #cbd5e1;

    --chat-border: #e2e8f0;
    --chat-divider: #f1f5f9;

    --chat-user-bubble: #2563eb;
    --chat-user-bubble-text: #ffffff;
    --chat-support-bubble: #ffffff;
    --chat-support-border: #e2e8f0;
    --chat-support-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);

    --chat-error: #ef4444;
    --chat-error-light: #fef2f2;
    --chat-success: #10b981;
    --chat-success-light: #ecfdf5;
    --chat-warning: #f59e0b;
    --chat-warning-light: #fffbeb;
    --chat-info: #3b82f6;
    --chat-info-light: #eff6ff;

    --chat-shadow-sm: 0 1px 3px rgba(37, 99, 235, 0.1), 0 1px 2px rgba(37, 99, 235, 0.06);
    --chat-shadow-md: 0 4px 6px rgba(37, 99, 235, 0.1), 0 2px 4px rgba(37, 99, 235, 0.06);
    --chat-shadow-lg: 0 10px 15px rgba(37, 99, 235, 0.1), 0 4px 6px rgba(37, 99, 235, 0.05);
    --chat-shadow-xl: 0 20px 25px rgba(37, 99, 235, 0.1), 0 10px 10px rgba(37, 99, 235, 0.04);
    --chat-shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);

    --chat-radius-sm: 6px;
    --chat-radius-md: 10px;
    --chat-radius-lg: 14px;
    --chat-radius-xl: 18px;
    --chat-radius-2xl: 20px;
    --chat-radius-full: 9999px;

    --chat-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --chat-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --chat-transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --chat-primary-color: #3b82f6;
    --chat-primary-hover: #60a5fa;

    --chat-bg: #0f0f0f;
    --chat-bg-gradient: #0f0f0f;
    --chat-surface: #141414;
    --chat-surface-elevated: #1a1a1a;

    --chat-text: #e2e8f0;
    --chat-text-secondary: #94a3b8;
    --chat-text-light: #64748b;
    --chat-text-muted: #475569;

    --chat-border: #2a2a2a;
    --chat-divider: #1f1f1f;

    --chat-user-bubble: #2563eb;
    --chat-user-bubble-text: #ffffff;
    --chat-support-bubble: #1f1f1f;
    --chat-support-border: #2a2a2a;
    --chat-support-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);

    --chat-error: #f87171;
    --chat-error-light: rgba(239, 68, 68, 0.1);
    --chat-success: #34d399;
    --chat-success-light: rgba(16, 185, 129, 0.1);
    --chat-warning: #fbbf24;
    --chat-warning-light: rgba(245, 158, 11, 0.1);
    --chat-info: #60a5fa;
    --chat-info-light: rgba(59, 130, 246, 0.1);

    --chat-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --chat-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --chat-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
    --chat-shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.7);
    --chat-shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.live-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.live-chat-widget .chat-open-button {
    background: var(--chat-primary-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: var(--chat-radius-full);
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--chat-shadow-lg), var(--chat-shadow-glow);
    transition: var(--chat-transition);
    position: relative;
    overflow: visible;
}

.live-chat-widget .chat-open-button:hover {
    transform: scale(1.07);
    box-shadow: var(--chat-shadow-xl);
    background: var(--chat-primary-hover);
}

.live-chat-widget .chat-open-button:active {
    transform: scale(0.97);
}

.live-chat-widget .chat-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--chat-error);
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: var(--chat-shadow-sm);
    z-index: 2;
    animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] .live-chat-widget .chat-notification-badge {
    border-color: #141414;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.live-chat-widget .chat-welcome-popup {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: max-content;
    max-width: 340px;
    min-width: 260px;
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius-xl);
    box-shadow: var(--chat-shadow-lg);
    padding: 16px 36px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: opacity 0.35s ease-out, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 998;
    transform-origin: bottom right;
}

.live-chat-widget .chat-welcome-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.live-chat-widget .welcome-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--chat-text-light);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    transition: var(--chat-transition-fast);
    line-height: 1;
}

.live-chat-widget .welcome-popup-close:hover {
    color: var(--chat-error);
    transform: scale(1.1);
}

.live-chat-widget .welcome-popup-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.live-chat-widget .welcome-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--chat-primary-color);
    box-shadow: var(--chat-shadow-sm);
    flex-shrink: 0;
    background: white;
}

.live-chat-widget .welcome-popup-content p {
    font-size: 0.9rem;
    color: var(--chat-text);
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

.live-chat-widget .chat-popup {
    display: none;
    position: fixed;
    top: 80px;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: 90vw;
    min-width: 300px;
    background: var(--chat-surface);
    border-radius: var(--chat-radius-2xl);
    border: 1px solid var(--chat-border);
    box-shadow: var(--chat-shadow-xl);
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.92) translateY(12px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    resize: both;
    z-index: 999;
}

.live-chat-widget .chat-popup.active {
    display: flex;
    transform: scale(1) translateY(0);
    opacity: 1;
    animation: slideUpFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUpFade {
    from {
        transform: scale(0.92) translateY(16px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.live-chat-widget .chat-header {
    background: var(--chat-primary-color);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    cursor: grab;
}

.live-chat-widget .chat-header:active {
    cursor: grabbing;
}

.live-chat-widget .chat-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.live-chat-widget .chat-header .header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.live-chat-widget .header-title .agent-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-color: #fff;
    flex-shrink: 0;
}

.live-chat-widget .header-title .agent-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.live-chat-widget .header-title .agent-name {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.2px;
}

.live-chat-widget .header-title .agent-status {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 400;
}

.live-chat-widget .chat-header .header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.live-chat-widget .chat-header .header-actions button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--chat-transition-fast);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.live-chat-widget .chat-header .header-actions button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.live-chat-widget .chat-header .header-actions button:active {
    transform: scale(0.95);
}

.live-chat-widget .pre-chat-form,
.live-chat-widget .chat-view-error {
    padding: 28px 22px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    background: var(--chat-bg-gradient);
    overflow-y: auto;
}

.live-chat-widget .pre-chat-form > p {
    font-size: 1rem;
    margin-bottom: 22px;
    color: var(--chat-primary-color);
    font-weight: 500;
    line-height: 1.6;
}

.live-chat-widget .form-group {
    margin-bottom: 16px;
    text-align: left;
}

.live-chat-widget .form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: var(--chat-text);
    font-size: 0.85rem;
}

.live-chat-widget .form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--chat-border);
    border-radius: var(--chat-radius-lg);
    background-color: var(--chat-surface);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--chat-transition-fast);
    color: var(--chat-text);
    box-sizing: border-box;
}

.live-chat-widget .form-control:focus {
    outline: none;
    border-color: var(--chat-primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--chat-surface-elevated);
}

[data-theme="dark"] .live-chat-widget .form-control {
    background-color: #1a1a1a;
    color: #e2e8f0;
}

[data-theme="dark"] .live-chat-widget .form-control::placeholder {
    color: #64748b;
}

.live-chat-widget .btn-primary {
    background: var(--chat-primary-color);
    color: white;
    border: none;
    padding: 13px 18px;
    width: 100%;
    border-radius: var(--chat-radius-lg);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--chat-transition);
    box-shadow: var(--chat-shadow-md);
    position: relative;
    overflow: hidden;
}

.live-chat-widget .btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.live-chat-widget .btn-primary:hover {
    background: var(--chat-primary-hover);
    box-shadow: var(--chat-shadow-lg);
}

.live-chat-widget .btn-primary:hover::before {
    width: 350px;
    height: 350px;
}

.live-chat-widget .btn-primary:active {
    transform: translateY(1px);
}

.live-chat-widget .btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.live-chat-widget .chat-view-error {
    color: var(--chat-error);
    align-items: center;
    justify-content: center;
}

.live-chat-widget .chat-view-error i {
    font-size: 52px;
    margin-bottom: 18px;
    opacity: 0.85;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.live-chat-widget .chat-view-error h6 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--chat-error);
}

.live-chat-widget .chat-view-error .chat-error-message {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 18px;
    color: var(--chat-text-secondary);
}

.live-chat-widget .reset-chat-btn {
    margin-top: 20px;
}

.live-chat-widget .chat-view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: var(--chat-bg-gradient);
    position: relative;
}

.live-chat-widget .chat-messages {
    flex: 1;
    padding: 18px 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.live-chat-widget .chat-messages::-webkit-scrollbar,
.live-chat-widget .pre-chat-form::-webkit-scrollbar,
.live-chat-widget .rating-view::-webkit-scrollbar {
    width: 4px;
}

.live-chat-widget .chat-messages::-webkit-scrollbar-track,
.live-chat-widget .pre-chat-form::-webkit-scrollbar-track,
.live-chat-widget .rating-view::-webkit-scrollbar-track {
    background: transparent;
}

.live-chat-widget .chat-messages::-webkit-scrollbar-thumb,
.live-chat-widget .pre-chat-form::-webkit-scrollbar-thumb,
.live-chat-widget .rating-view::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 10px;
}

[data-theme="dark"] .live-chat-widget .chat-messages::-webkit-scrollbar-thumb,
[data-theme="dark"] .live-chat-widget .pre-chat-form::-webkit-scrollbar-thumb,
[data-theme="dark"] .live-chat-widget .rating-view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.live-chat-widget .message {
    display: flex;
    flex-direction: column;
    max-width: 84%;
    padding: 10px 14px;
    border-radius: var(--chat-radius-md);
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: messageSlideIn 0.25s ease-out;
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.live-chat-widget .message.user {
    background: var(--chat-user-bubble);
    color: var(--chat-user-bubble-text);
    align-self: flex-end;
    border-bottom-right-radius: var(--chat-radius-sm);
    border-top-left-radius: var(--chat-radius-lg);
    border-top-right-radius: var(--chat-radius-lg);
    border-bottom-left-radius: var(--chat-radius-lg);
    box-shadow: var(--chat-shadow-md);
    margin-left: auto;
}

.live-chat-widget .message.support {
    background: var(--chat-support-bubble);
    align-self: flex-start;
    border-bottom-left-radius: var(--chat-radius-sm);
    border-top-left-radius: var(--chat-radius-lg);
    border-top-right-radius: var(--chat-radius-lg);
    border-bottom-right-radius: var(--chat-radius-lg);
    box-shadow: var(--chat-support-shadow);
    border: 1px solid var(--chat-support-border);
}

.live-chat-widget .message .sender {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 5px;
    color: var(--chat-primary-color);
}

.live-chat-widget .message .text-content {
    font-size: 0.9rem;
    color: var(--chat-text);
    line-height: 1.55;
}

.live-chat-widget .message.user .text-content {
    color: var(--chat-user-bubble-text);
}

.live-chat-widget .message-time {
    font-size: 0.68rem;
    color: var(--chat-text-light);
    align-self: flex-end;
    margin-top: 4px;
    opacity: 0.7;
}

.live-chat-widget .message.user .message-time {
    color: rgba(255, 255, 255, 0.75);
}

.live-chat-widget .message.system-message {
    align-self: center;
    text-align: center;
    font-size: 0.85rem;
    color: var(--chat-text-secondary);
    background: transparent;
    box-shadow: none;
    max-width: 95%;
    padding: 6px 10px;
}

.live-chat-widget .message.system-message.error {
    background: var(--chat-error-light);
    color: var(--chat-error);
    border-radius: var(--chat-radius-sm);
    padding: 10px 14px;
    font-weight: 500;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.live-chat-widget .message.system-message.welcome-message {
    background: var(--chat-support-bubble);
    color: var(--chat-text);
    text-align: left;
    border-left: 3px solid var(--chat-primary-color);
    padding: 12px 16px;
    border-radius: var(--chat-radius-sm);
    align-self: stretch;
    max-width: 100%;
    box-shadow: var(--chat-shadow-sm);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.live-chat-widget .attachment-wrapper {
    margin-top: 8px;
}

.live-chat-widget .attachment-wrapper img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--chat-radius-sm);
    display: block;
    object-fit: cover;
    cursor: pointer;
    transition: var(--chat-transition-fast);
    box-shadow: var(--chat-shadow-sm);
}

.live-chat-widget .attachment-wrapper img:hover {
    transform: scale(1.02);
    box-shadow: var(--chat-shadow-md);
}

.live-chat-widget .typing-indicator {
    padding: 8px 16px;
    font-style: italic;
    color: var(--chat-text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.live-chat-widget .typing-indicator::before {
    content: '●';
    animation: typingDot 1.4s infinite;
}

.live-chat-widget .typing-indicator::after {
    content: '●●';
    animation: typingDot 1.4s infinite 0.2s;
}

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.25; }
    30% { opacity: 1; }
}

.live-chat-widget .chat-footer {
    padding: 14px;
    background: var(--chat-surface-elevated);
    border-top: 1px solid var(--chat-divider);
    flex-shrink: 0;
}

.live-chat-widget .chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.live-chat-widget .chat-form .input-group {
    display: flex;
    align-items: center;
    flex: 1;
    background: var(--chat-surface);
    border-radius: var(--chat-radius-xl);
    padding: 4px 6px;
    border: 1.5px solid var(--chat-border);
    transition: var(--chat-transition-fast);
    min-height: 46px;
}

.live-chat-widget .chat-form .input-group:focus-within {
    border-color: var(--chat-primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.live-chat-widget .chat-input {
    border: none;
    flex: 1;
    padding: 8px 6px;
    background: transparent;
    resize: none;
    overflow-y: hidden;
    min-height: 22px;
    max-height: 110px;
    line-height: 1.5;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--chat-text);
}

.live-chat-widget .chat-input:focus {
    outline: none;
}

.live-chat-widget .chat-input::placeholder {
    color: var(--chat-text-light);
}

[data-theme="dark"] .live-chat-widget .chat-input {
    color: #e2e8f0;
}

[data-theme="dark"] .live-chat-widget .chat-input::placeholder {
    color: #64748b;
}

.live-chat-widget .menu-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--chat-text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--chat-radius-full);
    transition: var(--chat-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.live-chat-widget .menu-btn:hover {
    color: var(--chat-primary-color);
    background: rgba(37, 99, 235, 0.08);
    transform: scale(1.1);
}

.live-chat-widget .send-btn {
    background: var(--chat-primary-color);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: var(--chat-radius-full);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: var(--chat-transition);
    box-shadow: var(--chat-shadow-md);
}

.live-chat-widget .send-btn:hover {
    background: var(--chat-primary-hover);
    transform: scale(1.07) rotate(4deg);
    box-shadow: var(--chat-shadow-lg);
}

.live-chat-widget .send-btn:active {
    transform: scale(0.95);
}

.live-chat-widget .send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.live-chat-widget .char-counter {
    display: none;
    font-size: 0.72rem;
    text-align: right;
    padding: 3px 14px 0;
    color: var(--chat-text-secondary);
}

.live-chat-widget .char-counter.visible {
    display: block;
}

.live-chat-widget .char-counter.error {
    color: var(--chat-error);
    font-weight: 700;
}

.live-chat-widget .image-preview {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px;
    background: var(--chat-divider);
    border-radius: var(--chat-radius-md);
    margin-bottom: 10px;
    gap: 10px;
    cursor: grab;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    border: 1px solid var(--chat-border);
}

.live-chat-widget .image-preview.active {
    cursor: grabbing;
    user-select: none;
}

.live-chat-widget .preview-container {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    border-radius: var(--chat-radius-sm);
    overflow: hidden;
    box-shadow: var(--chat-shadow-sm);
    transition: var(--chat-transition-fast);
}

.live-chat-widget .preview-container:hover {
    transform: scale(1.04);
    box-shadow: var(--chat-shadow-md);
}

.live-chat-widget .preview-img {
    width: 80px;
    height: 80px;
    border-radius: var(--chat-radius-sm);
    object-fit: cover;
    display: block;
}

.live-chat-widget .remove-image-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--chat-error);
    color: white;
    border: 2px solid white;
    border-radius: var(--chat-radius-full);
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chat-transition-fast);
    box-shadow: var(--chat-shadow-sm);
}

[data-theme="dark"] .live-chat-widget .remove-image-btn {
    border-color: #1a1a1a;
}

.live-chat-widget .remove-image-btn:hover {
    transform: scale(1.15) rotate(90deg);
}

.live-chat-widget .rating-view {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    overflow-y: auto;
    padding: 28px 22px;
    text-align: center;
    background: var(--chat-bg-gradient);
}

.live-chat-widget .rating-view h6 {
    font-size: 1.1rem;
    margin-bottom: 18px;
    font-weight: 700;
    color: var(--chat-text);
}

.live-chat-widget .stars {
    font-size: 34px;
    color: #d1d5db;
    margin-bottom: 22px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    gap: 8px;
}

[data-theme="dark"] .live-chat-widget .stars {
    color: #374151;
}

.live-chat-widget .stars .fas.fa-star {
    transition: var(--chat-transition-fast);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

.live-chat-widget .stars .fa-star.selected {
    color: var(--chat-warning);
    transform: scale(1.1);
    filter: drop-shadow(0 3px 6px rgba(245, 158, 11, 0.4));
}

.live-chat-widget .stars:hover .fa-star {
    color: var(--chat-warning);
    opacity: 0.55;
}

.live-chat-widget .stars .fa-star:hover {
    opacity: 1;
    transform: scale(1.15);
}

.live-chat-widget .stars .fa-star:hover ~ .fa-star {
    color: #d1d5db;
    opacity: 1;
}

[data-theme="dark"] .live-chat-widget .stars .fa-star:hover ~ .fa-star {
    color: #374151;
}

.live-chat-widget .rating-form {
    width: 100%;
    margin-top: 4px;
}

.live-chat-widget .rating-form textarea {
    width: 100%;
    height: 90px;
    margin-bottom: 14px;
    resize: vertical;
    border-radius: var(--chat-radius-md);
    border: 1.5px solid var(--chat-border);
    padding: 10px 12px;
    transition: var(--chat-transition-fast);
    background: var(--chat-surface);
    color: var(--chat-text);
    font-family: inherit;
    font-size: 0.875rem;
    box-sizing: border-box;
}

.live-chat-widget .rating-form textarea:focus {
    outline: none;
    border-color: var(--chat-primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .live-chat-widget .rating-form textarea {
    background: #1a1a1a;
    color: #e2e8f0;
}

[data-theme="dark"] .live-chat-widget .rating-form textarea::placeholder {
    color: #64748b;
}

.live-chat-widget .rating-error {
    color: var(--chat-error);
    font-size: 0.85rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.live-chat-widget .rating-thanks {
    color: var(--chat-success);
    font-weight: 700;
    padding: 20px;
    font-size: 1rem;
    animation: fadeInScale 0.4s ease-out;
    background: var(--chat-success-light);
    border-radius: var(--chat-radius-lg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    width: 100%;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.live-chat-widget .chat-watermark {
    text-align: center;
    padding: 9px 20px;
    font-size: 0.75rem;
    color: var(--chat-text-light);
    border-top: 1px solid var(--chat-divider);
    background: var(--chat-surface);
    flex-shrink: 0;
}

.live-chat-widget .chat-watermark a {
    color: var(--chat-primary-color);
    text-decoration: none;
    font-weight: 600;
}

.live-chat-widget .chat-watermark a:hover {
    text-decoration: underline;
}

.spam-cooldown-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--chat-error);
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: slideUp 0.3s ease-out;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.jetsunucum-image-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.25s;
}

.jetsunucum-image-modal img {
    max-width: 88%;
    max-height: 88%;
    border-radius: var(--chat-radius-md);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.jetsunucum-image-modal .close-modal {
    position: absolute;
    top: 18px;
    right: 32px;
    color: #f1f1f1;
    font-size: 44px;
    font-weight: bold;
    transition: var(--chat-transition-fast);
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    line-height: 1;
}

.jetsunucum-image-modal .close-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(90deg);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.82); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .live-chat-widget {
        bottom: 16px;
        right: 16px;
    }

    .live-chat-widget .chat-popup {
        width: calc(100vw - 32px);
        top: 70px;
        bottom: 16px;
        right: 16px;
    }

    .live-chat-widget .chat-open-button {
        width: 54px;
        height: 54px;
        font-size: 22px;
    }

    .live-chat-widget .chat-header {
        padding: 13px 16px;
    }

    .live-chat-widget .chat-messages {
        padding: 14px 10px;
    }

    .live-chat-widget .message {
        max-width: 90%;
        padding: 9px 12px;
    }
}

@media (max-width: 480px) {
    .live-chat-widget .chat-popup {
        width: 100vw;
        top: 0;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .live-chat-widget .chat-header {
        border-radius: 0;
    }

    .live-chat-widget .chat-open-button {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
}

.live-chat-widget *:focus-visible {
    outline: 2px solid var(--chat-primary-color);
    outline-offset: 2px;
}

@media print {
    .live-chat-widget { display: none; }
}
