/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Website Content (for demo) */
.website-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: white;
    text-align: center;
    padding: 2rem;
}

.website-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.website-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chat Bubble - Overlapping Avatar Layout */
.chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    height: 42px;
    padding: 0 10px 0 28px;
    border-radius: 21px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1000;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    background-color: #75ad3c;
    border: 2px solid #259dc7;
    position: relative;
    overflow: visible;
}

/* Sunita Image - Overlapping Container with Blue Border */
.profile-image {
    flex-shrink: 0;
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #259dc7;
    background-color: #ffffff;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    filter: none;
    opacity: 1;
    transform: none;
    transition: none;
}

.profile-image:hover img {
    transform: none;
}

/* Chat Text - Adjusted for Overlap */
.profile-chat-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    padding: 0;
    height: auto;
    line-height: 1;
    margin-left: 12px;
}

.chat-bubble:hover {
    transform: translateY(-2px);
    background-color: #6a9c36;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.chat-bubble:hover .profile-image {
    transform: translateY(-50%) scale(1.02);
}

@keyframes pulse {
    0% { 
        transform: scale(1);
    }
    50% { 
        transform: scale(1.02);
    }
    100% { 
        transform: scale(1);
    }
}

/* Chat Window */
.chat-window {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 380px;
    height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    z-index: 999;
}

.chat-window.open {
    display: flex;
}

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.online-status {
    font-size: 12px;
    opacity: 0.9;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

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

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

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

.message {
    margin-bottom: 12px;
    display: flex;
    animation: messageSlide 0.3s ease-out;
}

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

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.3;
    word-wrap: break-word;
}

.message-text {
    margin-bottom: 8px;
    white-space: pre-line;
    line-height: 1.4;
}

.message-text strong {
    font-weight: 600;
    color: #2c3e50;
}

.message-text em {
    font-style: italic;
    opacity: 0.8;
}

.message-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.message-button {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e1e5e9;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
    height: 34px;
    display: flex;
    align-items: center;
}

.message-button:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.message-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.message.bot .message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.user .message-text {
    margin-bottom: 0;
}

/* Typing Indicator */
.typing-indicator {
    padding: 12px 16px;
    display: flex;
    align-items: center;
}

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

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 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; }

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

/* Chat Input */
.chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e1e5e9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.text-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
}

#messageInput {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 25px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#messageInput:focus {
    border-color: #4CAF50;
}

#sendBtn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#sendBtn:hover {
    transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chat-bubble {
        bottom: 20px;
        right: 10px;
        height: 38px;
        padding: 0 8px 0 24px;
        border-radius: 19px;
        gap: 4px;
    }
    
    .profile-image {
        left: -13px;
        width: 52px;
        height: 52px;
        border: 3px solid #259dc7;
    }
    
    .profile-chat-btn {
        font-size: 13px;
        letter-spacing: 0.1px;
        margin-left: 10px;
    }
    
    .chat-window {
        position: fixed;
        top: 60px;
        right: 0;
        left: 0;
        width: 100%;
        height: calc(100vh - 100px);
        border-radius: 12px 12px 0 0;
        z-index: 999;
    }
    
    .chat-bubble-text {
        display: none;
    }
    
    .chat-bubble {
        padding: 12px 16px;
        border-radius: 50%;
    }
    
    .website-content h1 {
        font-size: 2rem;
    }
    
    .website-content p {
        font-size: 1rem;
    }
}

/* Smooth transitions */
.chat-window,
.chat-bubble,
.message-bubble,
.button-option,
#sendBtn {
    transition: all 0.2s ease;
}
