/* ========================================
   FETSAN CHAT - MODERN UI DESIGN
   ======================================== */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-dark: rgba(15, 23, 42, 0.05);
    
    --border-color: rgba(226, 232, 240, 0.8);
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --border-radius-full: 50px;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Base Reset */
.fetsan-chat-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Main Chat Container */
.fetsan-chat-container {
    position: fixed;
    z-index: 999999;
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    
    /* Default position - bottom right */
    bottom: 24px;
    right: 24px;
}

/* Position Variants */
.fetsan-chat-container.fetsan-chat-bottom-left {
    bottom: 24px;
    left: 24px;
    right: auto;
}

.fetsan-chat-container.fetsan-chat-top-right {
    top: 24px;
    bottom: auto;
    right: 24px;
}

.fetsan-chat-container.fetsan-chat-top-left {
    top: 24px;
    bottom: auto;
    left: 24px;
    right: auto;
}

/* WhatsApp Button */
.whatsapp-button {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 1000000;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-button svg {
    width: 32px;
    height: 32px;
    color: white;
}

/* WhatsApp Button Position Variants */
.whatsapp-button {
    bottom: 24px;
    left: 24px;
}

.fetsan-chat-bottom-left + .whatsapp-button {
    bottom: 24px;
    right: 24px;
    left: auto;
}

.fetsan-chat-top-right + .whatsapp-button {
    top: 24px;
    left: 24px;
    bottom: auto;
}

.fetsan-chat-top-left + .whatsapp-button {
    top: 24px;
    right: 24px;
    left: auto;
    bottom: auto;
}

/* Chat Toggle Button */
.chat-toggle {
    position: relative;
    width: 80px;
    height: 80px;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    box-shadow: none;
    backdrop-filter: none;
    overflow: visible;
}

.chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: none;
    background: transparent;
}

.chat-toggle:active {
    transform: scale(0.95);
}

.toggle-icon {
    position: relative;
    width: 70px;
    height: 70px;
    color: var(--text-white);
}

.toggle-icon svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: all var(--transition-normal);
}

.close-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.fetsan-chat-container:not(.minimized) .chat-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

.fetsan-chat-container:not(.minimized) .close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    background: var(--danger-color);
    color: var(--text-white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-normal);
    border: 2px solid var(--bg-primary);
}

.notification-badge.show {
    opacity: 1;
    transform: scale(1);
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: scale(1);
    }
    40%, 43% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1.05);
    }
    90% {
        transform: scale(1.02);
    }
}

/* Chat Panel */
.chat-panel {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    height: 600px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-2xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all var(--transition-normal);
    pointer-events: none;
    z-index: 999998;
}

.fetsan-chat-container:not(.minimized) .chat-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

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

.avatar {
    position: relative;
    flex-shrink: 0;
}

.avatar-inner {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.avatar-inner svg {
    width: 24px;
    height: 24px;
    color: var(--text-white);
}

.status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--text-white);
    background: var(--secondary-color);
    transition: all var(--transition-normal);
}

.status-indicator.online {
    background: var(--success-color);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.header-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
    letter-spacing: -0.025em;
}

.header-info p {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 24px 20px;
    overflow-y: auto;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(37, 99, 235, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
    position: relative;
}

/* Initial clouds animation (only on first load) */
.chat-messages.show-initial-clouds::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(ellipse 60px 20px at 20% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse 80px 25px at 70% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 50px 15px at 45% 60%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 90px 30px at 80% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    pointer-events: none;
    animation: cloudFloat 8s ease-in-out infinite, cloudFadeOut 3s ease-out 2s forwards;
    z-index: 1;
}

@keyframes cloudFloat {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(10px) translateY(-5px);
    }
    50% {
        transform: translateX(-5px) translateY(8px);
    }
    75% {
        transform: translateX(8px) translateY(-3px);
    }
}

@keyframes cloudFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* Message Styles */
.message {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
    gap: 12px;
    animation: messageIn 0.4s ease-out;
    position: relative;
    z-index: 2;
}

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

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

.message-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.bot-avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
}

.bot-avatar svg {
    width: 16px;
    height: 16px;
}

.user-avatar {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), #94a3b8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-weight: 600;
    font-size: 14px;
}

.message-content {
    flex: 1;
    max-width: calc(100% - 44px);
}

.message-text {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
}

.message.user .message-text {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    border-color: var(--primary-color);
}

.welcome-message .message-text {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-color: rgba(37, 99, 235, 0.1);
    box-shadow: var(--shadow-md);
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
    padding: 0 20px 16px;
    animation: messageIn 0.4s ease-out;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(37, 99, 235, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
}

.typing-indicator.active {
    display: flex;
}

.typing-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.typing-dots {
    display: flex;
    gap: 3px;
}

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

.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 typingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Quick Questions */
.quick-questions-container {
    padding: 0 20px 20px;
    opacity: 1;
    transition: all var(--transition-normal);
    background: var(--bg-primary);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.quick-questions-container.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.quick-questions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.quick-questions::-webkit-scrollbar {
    display: none;
}

.quick-question {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    padding: 6px 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 4px);
}

.quick-question::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.05), transparent);
    transition: left var(--transition-slow);
}

.quick-question:hover::before {
    left: 100%;
}

.quick-question:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-question:active {
    transform: translateY(0);
}

.question-icon {
    font-size: 12px;
    flex-shrink: 0;
}

.quick-question span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Input Area */
.chat-input {
    padding: 20px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

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

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px 20px;
    transition: all var(--transition-normal);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.input-container:hover {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: var(--shadow-md);
}

.input-container:focus-within {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), var(--shadow-md);
    transform: translateY(-1px);
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    resize: none;
    min-height: 44px;
    max-height: 120px;
    line-height: 1.6;
    font-weight: 400;
}

.message-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 15px;
}

.send-button {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--text-muted);
    color: var(--text-white);
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.send-button:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    box-shadow: var(--shadow-md);
}

.send-button:not(:disabled):hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.send-button:not(:disabled):active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.send-button:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.send-button svg {
    width: 20px;
    height: 20px;
    transition: all var(--transition-normal);
}

.send-button:not(:disabled):hover svg {
    transform: translateX(1px);
}



/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px 40px;
    box-sizing: border-box;
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    z-index: 1000001;
    font-size: 0;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-image-container {
    max-width: calc(100vw - 80px);
    max-height: calc(100vh - 120px);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    background: var(--bg-primary);
}

.modal-image-container img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Responsive Design */
@media (max-width: 480px) {
    .fetsan-chat-container {
        bottom: 20px;
        right: 20px;
        z-index: 1000000;
    }
    
    .chat-toggle {
        width: 90px;
        height: 90px;
        z-index: 1000001;
    }
    
    /* Hide chat toggle when chat is open on mobile */
    .fetsan-chat-container:not(.minimized) .chat-toggle {
        display: none !important;
    }
    
    .toggle-icon {
        width: 80px;
        height: 80px;
    }
    
    .whatsapp-button {
        bottom: 40px;
        left: 20px;
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-button svg {
        width: 26px;
        height: 26px;
    }
    
    /* WhatsApp Button Mobile Position Variants */
    .fetsan-chat-bottom-left + .whatsapp-button {
        bottom: 20px;
        right: 20px;
        left: auto;
    }
    
    .fetsan-chat-top-right + .whatsapp-button {
        top: 20px;
        left: 20px;
        bottom: auto;
    }
    
    .fetsan-chat-top-left + .whatsapp-button {
        top: 20px;
        right: 20px;
        left: auto;
        bottom: auto;
    }
    
    .fetsan-chat-container.fetsan-chat-bottom-left {
        bottom: 20px;
        left: 20px;
        right: auto;
    }
    
    .fetsan-chat-container.fetsan-chat-top-right {
        top: 20px;
        right: 20px;
        bottom: auto;
    }
    
    .fetsan-chat-container.fetsan-chat-top-left {
        top: 20px;
        left: 20px;
        right: auto;
        bottom: auto;
    }
    
    .chat-panel {
        position: fixed !important;
        width: 100vw !important;
        height: calc(100vh - env(safe-area-inset-bottom, 0px)) !important;
        height: calc(100dvh - env(safe-area-inset-bottom, 0px)) !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        z-index: 999999 !important;
        opacity: 1 !important;
        pointer-events: all !important;
        transform: translateY(100%) !important;
        transition: transform var(--transition-normal) !important;
    }
    
    .fetsan-chat-container:not(.minimized) .chat-panel {
        transform: translateY(0) !important;
    }
    
    .chat-messages {
        padding: 16px;
        padding-top: 0;
        margin-top: 0;
    }
    
    .chat-header {
        position: relative;
        padding: 20px 60px 16px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    /* Mobile swipe indicator */
    .chat-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }
    
    .chat-input {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        position: relative;
        z-index: 200;
    }
    
    .input-container {
        position: relative !important;
        z-index: 250 !important;
    }
    
    .send-button {
        position: relative !important;
        z-index: 300 !important;
    }
    
    .quick-questions-container {
        padding: 0 16px 12px;
    }
    
    /* Mobile close button in header - repositioned */
    .chat-header::after {
        content: '✕';
        position: absolute;
        top: 24px;
        right: 16px;
        width: 32px;
        height: 32px;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(10px);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: bold;
        color: var(--text-white);
        cursor: pointer;
        transition: all var(--transition-normal);
        z-index: 50;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .chat-header::after:hover {
        background: rgba(239, 68, 68, 0.7);
        border-color: rgba(255, 255, 255, 0.4);
        transform: scale(1.1);
    }
    
    /* Modal responsive */
    .modal-content {
        padding: 80px 20px 20px;
    }
    
    .modal-close {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
    
    .modal-close svg {
        width: 20px;
        height: 20px;
    }
    
    .modal-image-container {
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 120px);
    }
    
    /* Mobile image thumbnails in messages */
    .message-text .image-container {
        max-width: 120px !important;
        margin-right: 8px;
        display: inline-block;
        vertical-align: top;
    }
    
    /* For multiple images, display side by side */
    .message-text .image-container + .image-container {
        margin-left: 8px;
        margin-right: 0;
    }
    
    .message-text .image-container img {
        width: 100% !important;
        height: auto !important;
        max-height: 120px;
        object-fit: cover;
        border-radius: 6px;
    }
}

@media (max-width: 360px) {
    .chat-toggle {
        width: 80px;
        height: 80px;
    }
    
    .toggle-icon {
        width: 70px;
        height: 70px;
    }
    
    .whatsapp-button {
        bottom: 50px;
        left: 20px;
        width: 45px;
        height: 45px;
    }
    
    .whatsapp-button svg {
        width: 24px;
        height: 24px;
    }
    
    /* WhatsApp Button Mobile Position Variants for smaller screens */
    .fetsan-chat-bottom-left + .whatsapp-button {
        bottom: 20px;
        right: 20px;
        left: auto;
    }
    
    .fetsan-chat-top-right + .whatsapp-button {
        top: 20px;
        left: 20px;
        bottom: auto;
    }
    
    .fetsan-chat-top-left + .whatsapp-button {
        top: 20px;
        right: 20px;
        left: auto;
        bottom: auto;
    }
    
    .chat-panel {
        position: fixed !important;
        width: 100vw !important;
        height: calc(100vh - env(safe-area-inset-bottom, 0px)) !important;
        height: calc(100dvh - env(safe-area-inset-bottom, 0px)) !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        z-index: 999999 !important;
        opacity: 1 !important;
        pointer-events: all !important;
    }
    
    .header-content {
        gap: 12px;
        align-items: center;
    }
    
    .avatar-inner {
        width: 40px;
        height: 40px;
    }
    
    .avatar-inner svg {
        width: 20px;
        height: 20px;
    }
    
    .header-info h3 {
        font-size: 17px;
        font-weight: 600;
    }
    
    .header-info p {
        font-size: 13px;
        opacity: 0.9;
    }
    
    .status-indicator {
        width: 10px;
        height: 10px;
        border: 2px solid var(--bg-primary);
    }
}
