/* MyWeb Chatbot Frontend Styles */
.mwc-chatbot-wrapper {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    box-sizing: border-box;
}

/* Position Classes */
.mwc-position-right {
    right: 20px;
    bottom: 20px;
}

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

.mwc-position-hidden {
    display: none;
}

/* Chat Button */
.mwc-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mwc-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

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

.mwc-chat-button-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.mwc-chat-button.active .mwc-chat-button-icon {
    transform: rotate(180deg);
}

.mwc-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

/* Chat Window - FIXED POSITION */
.mwc-chat-window {
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    bottom: 90px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mwc-position-right .mwc-chat-window {
    right: 20px;
    transform-origin: bottom right;
}

.mwc-position-left .mwc-chat-window {
    left: 20px;
    transform-origin: bottom left;
}

.mwc-chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.mwc-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.mwc-chat-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mwc-chat-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mwc-chat-header-content {
    flex: 1;
}

.mwc-chat-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.mwc-chat-subtitle {
    margin: 5px 0 0;
    font-size: 12px;
    opacity: 0.9;
    font-weight: normal;
}

.mwc-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.mwc-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Body */
.mwc-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Messages */
.mwc-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    animation: messageIn 0.3s ease;
    word-wrap: break-word;
}

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

.mwc-message-user {
    align-self: flex-end;
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.mwc-message-bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 4px;
}

.mwc-message-system {
    align-self: center;
    background: #f0f4ff;
    color: #667eea;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    max-width: 90%;
}

.mwc-message-sender {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.8;
}

.mwc-message-user .mwc-message-sender {
    text-align: right;
}

.mwc-message-bot .mwc-message-sender {
    text-align: left;
}

.mwc-message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}

/* Typing Indicator */
.mwc-typing-indicator {
    align-self: flex-start;
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    border: 1px solid #e1e5e9;
    display: none;
}

.mwc-typing-indicator.active {
    display: block;
}

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

.mwc-typing-dots span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.mwc-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.mwc-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

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

/* Chat Footer */
.mwc-chat-footer {
    padding: 20px;
    border-top: 1px solid #e1e5e9;
    background: white;
}

.mwc-input-group {
    display: flex;
    gap: 10px;
}

.mwc-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.mwc-chat-input:focus {
    border-color: #667eea;
}

.mwc-chat-input:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.mwc-send-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mwc-send-button:hover:not(:disabled) {
    background: #5a67d8;
    transform: scale(1.05);
}

.mwc-send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.mwc-send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.mwc-send-button-icon {
    font-size: 20px;
}

/* Consent Banner */
.mwc-consent-banner {
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    padding: 15px 20px;
    text-align: center;
}

.mwc-consent-text {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.mwc-consent-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mwc-consent-button {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid;
    transition: all 0.3s ease;
}

.mwc-consent-accept {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.mwc-consent-accept:hover {
    background: #5a67d8;
    border-color: #5a67d8;
}

.mwc-consent-decline {
    background: transparent;
    color: #666;
    border-color: #ccc;
}

.mwc-consent-decline:hover {
    background: #f8f9fa;
    border-color: #999;
}

/* Contact Form Custom */
.mwc-contact-form-custom {
    background: #f0f4ff;
    border-radius: 12px;
    padding: 20px;
    margin: 10px 0;
    border-left: 4px solid #667eea;
    animation: slideIn 0.3s ease;
}

.mwc-contact-custom-content {
    margin-bottom: 20px;
}

.mwc-contact-custom-content h3,
.mwc-contact-custom-content h4 {
    margin-top: 0;
    color: #333;
}

.mwc-contact-custom-content p {
    color: #555;
    line-height: 1.5;
    margin-bottom: 10px;
}

.mwc-contact-custom-content ul {
    padding-left: 20px;
    margin: 10px 0;
}

.mwc-contact-custom-content li {
    margin-bottom: 5px;
    color: #555;
}

.mwc-contact-custom-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mwc-contact-custom-yes,
.mwc-contact-custom-no {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mwc-contact-custom-yes {
    background: #667eea;
    color: white;
}

.mwc-contact-custom-yes:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.mwc-contact-custom-no {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e1e5e9;
}

.mwc-contact-custom-no:hover {
    background: #e9ecef;
    border-color: #ccc;
}

/* Info Form */
.mwc-info-form {
    background: white;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 25px;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.mwc-info-form .mwc-form-title {
    color: #333;
    font-size: 18px;
    margin: 0 0 20px 0;
    text-align: center;
    font-weight: 600;
}

.mwc-info-form .mwc-form-group {
    margin-bottom: 20px;
}

.mwc-info-form .mwc-form-label {
    color: #444;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.mwc-info-form .mwc-form-input {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.3s ease;
}

.mwc-info-form .mwc-form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mwc-info-form .mwc-form-input.error {
    border-color: #dc3545;
}

.mwc-info-form .mwc-country-select {
    display: flex;
    gap: 10px;
}

.mwc-info-form .mwc-form-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mwc-info-form .mwc-form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Contact Info */
.mwc-contact-info {
    background: #f0f4ff;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #667eea;
}

.mwc-contact-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.mwc-contact-content {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

/* Powered By Footer */
.mwc-powered-by {
    text-align: center;
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    font-size: 11px;
    color: #666;
}

.mwc-powered-by a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.mwc-powered-by a:hover {
    text-decoration: underline;
}

/* Loading States */
.mwc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

.mwc-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error States */
.mwc-error-message {
    background: #fff5f5;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #fed7d7;
    margin: 10px 0;
    font-size: 13px;
    text-align: center;
}

/* Responsive */
@media (max-width: 480px) {
    .mwc-chat-window {
        width: calc(100vw - 40px) !important;
        height: 70vh !important;
        max-height: 600px;
        bottom: 80px;
        left: 20px !important;
        right: 20px !important;
        margin: 0 auto;
    }
    
    .mwc-position-right .mwc-chat-window,
    .mwc-position-left .mwc-chat-window {
        left: 20px;
        right: 20px;
    }
    
    .mwc-message {
        max-width: 90%;
    }
    
    .mwc-contact-custom-buttons {
        flex-direction: column;
    }
    
    .mwc-contact-custom-yes,
    .mwc-contact-custom-no {
        width: 100%;
    }
    
    .mwc-country-select {
        flex-direction: column;
    }
    
    .mwc-country-select select {
        width: 100% !important;
    }
}

/* For very small screens */
@media (max-height: 600px) {
    .mwc-chat-window {
        height: 60vh !important;
        max-height: 400px;
    }
}

/* Custom CSS Injection Area */
.mwc-custom-css {
    /* Custom CSS will be injected here */
}