/**
 * Contact Widget Styles
 * Floating contact panel with AI chatbot
 */

.contact-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1050;
    font-family: var(--font-primary, 'Inter', sans-serif);
}

/* Widget Toggle Button */
.contact-widget-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0078d4 0%, #00bcf2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 120, 212, 0.3);
    transition: all 0.3s ease;
    position: relative;
    color: white;
    font-size: 1.5rem;
}

.contact-widget-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 120, 212, 0.4);
}

.contact-widget-toggle.active {
    background: linear-gradient(135deg, #d13438 0%, #ff6b6b 100%);
}

.widget-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Contact Panel */
.contact-widget-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.contact-widget-panel.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.widget-header {
    padding: 1.5rem 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.widget-header h4 {
    margin: 0;
    color: #323130;
    font-size: 1.2rem;
    font-weight: 600;
}

.widget-close {
    background: none;
    border: none;
    color: #8a8886;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #323130;
}

.widget-content {
    padding: 1rem 1.5rem 1.5rem;
}

/* Contact Options */
.contact-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: none;
    cursor: pointer;
    width: 100%;
}

.contact-option:hover {
    background: rgba(0, 120, 212, 0.04);
    border-color: rgba(0, 120, 212, 0.2);
    transform: translateY(-1px);
    color: inherit;
    text-decoration: none;
}

.contact-option.whatsapp:hover {
    background: rgba(37, 211, 102, 0.08);
    border-color: rgba(37, 211, 102, 0.3);
}

.contact-option.email:hover {
    background: rgba(234, 67, 53, 0.08);
    border-color: rgba(234, 67, 53, 0.3);
}

.contact-option.phone:hover {
    background: rgba(52, 168, 83, 0.08);
    border-color: rgba(52, 168, 83, 0.3);
}

.contact-option.ai-chat:hover {
    background: rgba(138, 43, 226, 0.08);
    border-color: rgba(138, 43, 226, 0.3);
}

.option-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.whatsapp .option-icon {
    background: rgba(37, 211, 102, 0.1);
    color: #25d366;
}

.email .option-icon {
    background: rgba(234, 67, 53, 0.1);
    color: #ea4335;
}

.phone .option-icon {
    background: rgba(52, 168, 83, 0.1);
    color: #34a853;
}

.ai-chat .option-icon {
    background: rgba(138, 43, 226, 0.1);
    color: #8a2be2;
}

.option-content h5 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #323130;
}

.option-content p {
    margin: 0;
    font-size: 0.8rem;
    color: #8a8886;
    line-height: 1.3;
}

/* AI Chat Panel */
.ai-chat-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-panel.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8a2be2 0%, #9932cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.chat-title h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #323130;
}

.chat-status {
    font-size: 0.75rem;
    color: #107c10;
    display: flex;
    align-items: center;
}

.chat-status.online::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #107c10;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

.chat-close {
    background: none;
    border: none;
    color: #8a8886;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.chat-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #323130;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fafafa;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 85%;
}

.user-message {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, #0078d4 0%, #00bcf2 100%);
    color: white;
}

.bot-message .message-content {
    background: white;
    color: #323130;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8a2be2 0%, #9932cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message-content p {
    margin: 0;
}

/* Typing Indicator */
.typing .message-content {
    padding: 1rem;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8a8886;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-10px); opacity: 1; }
}

/* Chat Input */
.chat-input-container {
    padding: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: white;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: #f8f9fa;
    border-radius: 24px;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-input-wrapper:focus-within {
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}

#chatInput {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.9rem;
    color: #323130;
    padding: 0.5rem 0;
}

#chatInput::placeholder {
    color: #8a8886;
}

#chatSend {
    background: #0078d4;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

#chatSend:hover:not(:disabled) {
    background: #005a9e;
    transform: scale(1.05);
}

#chatSend:disabled {
    background: #8a8886;
    cursor: not-allowed;
    transform: none;
}

/* Chat Suggestions */
.chat-suggestions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.suggestion-btn {
    background: rgba(0, 120, 212, 0.08);
    border: 1px solid rgba(0, 120, 212, 0.2);
    color: #0078d4;
    padding: 0.5rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: rgba(0, 120, 212, 0.15);
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .contact-widget {
        bottom: 1rem;
        right: 1rem;
    }
    
    .contact-widget-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .contact-widget-panel {
        width: 280px;
        bottom: 70px;
    }
    
    .ai-chat-panel {
        width: 320px;
        height: 450px;
        bottom: 70px;
    }
    
    .widget-header {
        padding: 1rem;
    }
    
    .widget-content {
        padding: 0.75rem 1rem 1rem;
    }
    
    .contact-option {
        padding: 0.75rem;
    }
    
    .option-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .option-content h5 {
        font-size: 0.9rem;
    }
    
    .option-content p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .contact-widget-panel {
        width: calc(100vw - 2rem);
        right: 1rem;
        left: 1rem;
    }
    
    .ai-chat-panel {
        width: calc(100vw - 2rem);
        height: 400px;
        right: 1rem;
        left: 1rem;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .contact-widget-panel,
[data-theme="dark"] .ai-chat-panel {
    background: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

[data-theme="dark"] .widget-header,
[data-theme="dark"] .chat-header {
    border-color: #404040;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
}

[data-theme="dark"] .widget-header h4,
[data-theme="dark"] .chat-title h4 {
    color: #ffffff;
}

[data-theme="dark"] .contact-option {
    border-color: #404040;
    color: #ffffff;
}

[data-theme="dark"] .option-content h5 {
    color: #ffffff;
}

[data-theme="dark"] .option-content p {
    color: #b3b3b3;
}

[data-theme="dark"] .chat-messages {
    background: #1e1e1e;
}

[data-theme="dark"] .bot-message .message-content {
    background: #2d2d2d;
    border-color: #404040;
    color: #ffffff;
}

[data-theme="dark"] .chat-input-wrapper {
    background: #1e1e1e;
    border-color: #404040;
}

[data-theme="dark"] #chatInput {
    color: #ffffff;
}

[data-theme="dark"] #chatInput::placeholder {
    color: #b3b3b3;
}

[data-theme="dark"] .chat-input-container {
    background: #2d2d2d;
    border-color: #404040;
}

