/* Van-essa WordPress Chatbot Styles */

/* Reset and base styles */
.vanessa-widget * {
    box-sizing: border-box;
    font-family: 'Montserrat';
}

/* Widget positioning */
.vanessa-widget {
    position: fixed;
    z-index: 999;
    font-family: 'Montserrat';
}

.vanessa-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.vanessa-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.vanessa-position-top-right {
    top: 20px;
    right: 20px;
}

.vanessa-position-top-left {
    top: 20px;
    left: 20px;
}

/* Inline version */
.vanessa-widget.vanessa-inline {
    position: relative;
    width: 100%;
    height: 100%;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
}

.vanessa-inline .vanessa-bubble {
    display: none;
}

.vanessa-inline .vanessa-container {
    position: relative;
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
    bottom: auto;
    right: auto;
    width: 100%;
    height: 100%;
}

/* Chat Bubble */
.vanessa-bubble {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #4a90e2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    font-size: 24px;
    animation: vanessa-pulse 2s infinite;
    user-select: none;
}

.vanessa-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
}

.vanessa-bubble.vanessa-hidden {
    transform: scale(0);
    opacity: 0;
}

.vanessa-bubble-icon {
    display: block;
    line-height: 1;
}

@keyframes vanessa-pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    70% {
        box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 0 0 10px rgba(255, 107, 53, 0);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

/* Chat Container */
.vanessa-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

.vanessa-container.vanessa-active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Position adjustments for different corners */
.vanessa-position-bottom-left .vanessa-container {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.vanessa-position-top-right .vanessa-container {
    bottom: auto;
    top: 80px;
    transform-origin: top right;
}

.vanessa-position-top-left .vanessa-container {
    bottom: auto;
    top: 80px;
    right: auto;
    left: 0;
    transform-origin: top left;
}

/* Header */
.vanessa-header {
    background: white;
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.vanessa-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #4a90e2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
    font-size: 16px;
}

.vanessa-header-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 2px 0;
}

.vanessa-subtitle {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.vanessa-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.vanessa-close:hover {
    background: #f0f0f0;
    color: #666;
}

/* Messages area */
.vanessa-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.vanessa-welcome {
    margin-bottom: 20px;
}

.vanessa-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
}

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

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

.vanessa-bubble-msg {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.vanessa-message.vanessa-user .vanessa-bubble-msg {
    background: #007AFF;
    color: white;
    border-bottom-right-radius: 4px;
}

.vanessa-message.vanessa-bot .vanessa-bubble-msg {
    background: #E5E5EA;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
}

.vanessa-timestamp {
    font-size: 11px;
    color: #999;
    text-align: center;
    margin: 10px 0;
}

/* Typing indicator */
.vanessa-typing {
    padding: 0 20px 15px;
    background: #f8f9fa;
}

.vanessa-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.vanessa-typing-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: vanessa-typing 1.4s infinite ease-in-out;
}

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

.vanessa-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes vanessa-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Input area */
.vanessa-input-container {
    padding: 15px 20px 20px;
    background: white;
    border-top: 1px solid #e5e5e5;
}

.vanessa-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f0f0f0;
    border-radius: 25px;
    padding: 8px 15px;
}

#vanessa-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    outline: none;
    padding: 8px 0;
    color: #1a1a1a;
}

#vanessa-input::placeholder {
    color: #999;
}

#vanessa-send-btn {
    background: #007AFF;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    opacity: 0.6;
    transform: scale(0.9);
}

#vanessa-send-btn:not(:disabled) {
    opacity: 1;
    transform: scale(1);
}

#vanessa-send-btn:hover:not(:disabled) {
    background: #0056b3;
}

#vanessa-send-btn:disabled {
    cursor: not-allowed;
}

.vanessa-send-icon {
    display: block;
    line-height: 1;
}

/* Quick replies */
.vanessa-quick-replies {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.vanessa-quick-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.vanessa-quick-reply {
    display: inline-block;
    margin: 3px;
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vanessa-quick-reply:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

/* Scrollbar styling */
.vanessa-messages::-webkit-scrollbar {
    width: 4px;
}

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

.vanessa-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.vanessa-messages::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* Message formatting */
.vanessa-bubble-msg strong {
    font-weight: 600;
}

.vanessa-bubble-msg em {
    font-style: italic;
}

.vanessa-bubble-msg a {
    color: inherit;
    text-decoration: underline;
}

.vanessa-message.vanessa-user .vanessa-bubble-msg a {
    color: #cce7ff;
}

/* Responsive design */
@media (max-width: 480px) {
    .vanessa-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 10px;
        left: 10px;
        transform-origin: center bottom;
    }
    
    .vanessa-position-bottom-left .vanessa-container,
    .vanessa-position-top-right .vanessa-container,
    .vanessa-position-top-left .vanessa-container {
        right: 10px;
        left: 10px;
    }
    
    .vanessa-bubble {
        width: 55px;
        height: 55px;
        font-size: 20px;
    }
    
    .vanessa-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .vanessa-header {
        padding: 15px;
    }
    
    .vanessa-messages {
        padding: 15px;
    }
    
    .vanessa-input-container {
        padding: 12px 15px 15px;
    }
}

@media (max-width: 320px) {
    .vanessa-container {
        width: calc(100vw - 10px);
        right: 5px;
        left: 5px;
    }
    
    .vanessa-bubble-msg {
        max-width: 85%;
        font-size: 13px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .vanessa-container {
        background: #1e1e1e;
        color: white;
    }
    
    .vanessa-header {
        background: #1e1e1e;
        border-bottom-color: #333;
    }
    
    .vanessa-header-info h3 {
        color: white;
    }

    .vanessa-typing {
        background: #2a2a2a;
    }

    .vanessa-messages {
        background: #2a2a2a;
    }
    
    .vanessa-message.vanessa-bot .vanessa-bubble-msg {
        background: #3a3a3a;
        color: white;
    }
    
    .vanessa-input-container {
        background: #1e1e1e;
        border-top-color: #333;
    }
    
    .vanessa-input-wrapper {
        background: #3a3a3a;
    }
    
    #vanessa-input {
        color: white;
    }
    
    #vanessa-input::placeholder {
        color: #999;
    }
    
    .vanessa-close:hover {
        background: #3a3a3a;
        color: #ccc;
    }
    
    .vanessa-quick-replies {
        background: #2a2a2a;
    }
    
    .vanessa-quick-reply {
        background: #3a3a3a;
        border-color: #555;
        color: white;
    }
    
    .vanessa-quick-reply:hover {
        background: #4a4a4a;
        border-color: #666;
    }
}

/* Print styles */
@media print {
    .vanessa-widget {
        display: none !important;
    }
}

/* Accessibility improvements */
.vanessa-bubble:focus,
.vanessa-close:focus,
#vanessa-send-btn:focus,
#vanessa-input:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

/* Animation performance */
.vanessa-container,
.vanessa-bubble {
    will-change: transform, opacity;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .vanessa-bubble,
    .vanessa-avatar {
        border: 2px solid currentColor;
    }
    
    .vanessa-message.vanessa-user .vanessa-bubble-msg {
        border: 1px solid white;
    }
    
    .vanessa-message.vanessa-bot .vanessa-bubble-msg {
        border: 1px solid #333;
    }
}