/* 
 * WALL-E AI Assistant - Styles
 * Version: 3.1.0
 */

/* Modal Overlay */
.wall-e-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999 !important;
    animation: modal-fade-in 0.5s ease;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Welcome Modal */
.wall-e-welcome-modal {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border-radius: 25px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 3px solid #48bb78;
    animation: modal-slide-up 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

@keyframes modal-slide-up {
    from { transform: translateY(50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.wall-e-welcome-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #48bb78, #4299e1, #9f7aea);
    animation: border-glow 3s infinite;
}

@keyframes border-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* WALL-E GIF in Modal */
.wall-e-modal-gif {
    width: 200px;
    height: 200px;
    margin: 0 auto 25px;
    border-radius: 20px;
    overflow: hidden;
    border: 4px solid #48bb78;
    box-shadow: 0 10px 30px rgba(72, 187, 120, 0.3);
    animation: gif-float 4s ease-in-out infinite;
}

@keyframes gif-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

.wall-e-modal-gif img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Content */
.wall-e-modal-title {
    color: white;
    font-size: 28px;
    margin: 0 0 15px;
    font-weight: 800;
    background: linear-gradient(135deg, #48bb78, #4299e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wall-e-modal-subtitle {
    color: #a0aec0;
    font-size: 16px;
    margin: 0 0 30px;
    line-height: 1.6;
}

/* Mode Selection Buttons */
.wall-e-mode-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.wall-e-mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 25px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.wall-e-mode-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    border-color: #48bb78;
}

.wall-e-mode-btn.active {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.2), rgba(66, 153, 225, 0.2));
    border-color: #48bb78;
    box-shadow: 0 10px 25px rgba(72, 187, 120, 0.2);
}

.wall-e-mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #48bb78, #4299e1);
    opacity: 0;
    transition: opacity 0.3s;
}

.wall-e-mode-btn.active::before {
    opacity: 1;
}

.mode-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.mode-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.mode-desc {
    color: #a0aec0;
    font-size: 13px;
    margin: 5px 0 0;
    line-height: 1.4;
}

/* Action Buttons */
.wall-e-modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.wall-e-action-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wall-e-start-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.wall-e-start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(72, 187, 120, 0.3);
}

.wall-e-skip-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #a0aec0;
}

.wall-e-skip-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Toggle Button */
.wall-e-toggle-btn {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    background: linear-gradient(135deg, #48bb78 0%, #4299e1 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    font-size: 30px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100000 !important;
    transition: all 0.3s;
    animation: button-pulse 2s infinite;
}

@keyframes button-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.wall-e-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Chat Container */
.wall-e-chat-container {
    position: fixed !important;
    bottom: 110px !important;
    right: 30px !important;
    width: 400px;
    max-width: calc(100vw - 60px);
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 99999 !important;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 3px solid #48bb78;
    animation: chat-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chat-slide-up {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Chat Header */
.wall-e-chat-header {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.2), rgba(66, 153, 225, 0.2));
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wall-e-chat-avatar {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid #48bb78;
    flex-shrink: 0;
}

.wall-e-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wall-e-chat-title h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.wall-e-chat-title p {
    margin: 5px 0 0;
    color: #a0aec0;
    font-size: 13px;
}

.wall-e-chat-close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.wall-e-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Mode Switch in Chat */
.wall-e-mode-switch {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 5px;
    margin: 15px 20px;
}

.wall-e-mode-option {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    color: #a0aec0;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wall-e-mode-option.active {
    background: rgba(72, 187, 120, 0.2);
    color: white;
}

/* Messages Area */
.wall-e-messages {
    flex: 1;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Message Bubbles */
.wall-e-message {
    max-width: 80%;
    padding: 15px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
    animation: message-fade 0.3s ease;
    position: relative;
}

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

.wall-e-user-message {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.wall-e-bot-message {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.wall-e-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

/* Input Area */
.wall-e-input-area {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    align-items: center;
}

.wall-e-input-wrapper {
    flex: 1;
    position: relative;
}

.wall-e-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: white;
    font-size: 14px;
    transition: all 0.3s;
}

.wall-e-input:focus {
    outline: none;
    border-color: #48bb78;
    background: rgba(255, 255, 255, 0.1);
}

.wall-e-input::placeholder {
    color: #a0aec0;
}

.wall-e-input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
}

.wall-e-send-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.wall-e-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.wall-e-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Voice Interface */
.wall-e-voice-interface {
    padding: 25px;
    text-align: center;
    display: none;
}

.wall-e-voice-visualizer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    height: 60px;
}

.wall-e-voice-bar {
    width: 6px;
    background: linear-gradient(to top, #48bb78, #4299e1);
    border-radius: 3px;
    animation: voice-pulse 1s infinite;
}

@keyframes voice-pulse {
    0%, 100% { height: 10px; }
    50% { height: 40px; }
}

.wall-e-voice-bar:nth-child(2) { animation-delay: 0.1s; }
.wall-e-voice-bar:nth-child(3) { animation-delay: 0.2s; }
.wall-e-voice-bar:nth-child(4) { animation-delay: 0.3s; }
.wall-e-voice-bar:nth-child(5) { animation-delay: 0.4s; }

.wall-e-voice-status {
    color: #a0aec0;
    font-size: 14px;
    margin: 15px 0;
}

.wall-e-voice-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    margin-top: 10px;
}

.wall-e-voice-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(245, 101, 101, 0.3);
}

.wall-e-voice-btn.listening {
    animation: voice-btn-pulse 1.5s infinite;
}

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

/* Loading Animation */
.wall-e-loading {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #a0aec0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    width: fit-content;
    margin: 0 auto;
}

.wall-e-loading-dots {
    display: flex;
    gap: 5px;

}

.wall-e-loading-dots span {
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    animation: loading-bounce 1.4s infinite ease-in-out both;
}

.wall-e-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.wall-e-loading-dots span:nth-child(2) { animation-delay: -0.16s; }

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

/* Responsive */
@media (max-width: 768px) {
    .wall-e-toggle-btn {
        bottom: 20px !important;
        right: 20px !important;
        width: 60px;
        height: 60px;
        font-size: 26px;
    }
    
    .wall-e-chat-container {
        bottom: 90px !important;
        right: 20px !important;
        left: 20px !important;
        width: auto;
        max-height: 70vh;
    }
    
    .wall-e-mode-selection {
        grid-template-columns: 1fr;
    }
    
    .wall-e-welcome-modal {
        padding: 30px 20px;
    }
}

/* Fix for WordPress themes */
.wall-e-chat-container * {
    box-sizing: border-box !important;
}

/* Prevent theme interference */
html, body {
    overflow-x: visible !important;
    position: relative !important;
}

@media (max-width: 480px) {
    .wall-e-chat-container {
        bottom: 80px !important;
        right: 10px !important;
        left: 10px !important;
        width: calc(100vw - 20px) !important;
    }
    
    .wall-e-toggle-btn {
        right: 15px !important;
        bottom: 15px !important;
    }
}

/* Active state for chat */
.wall-e-chat-container.active {
    display: flex !important;
}