/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.chatbot-toggle {
    position: relative;
    width: 70px;
    height: 70px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-medium);
    box-shadow: 
        0 8px 30px rgba(0, 245, 255, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.chatbot-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 12px 40px rgba(0, 245, 255, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.chatbot-toggle.active {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
}

.chatbot-icon,
.chatbot-close-icon {
    position: absolute;
    transition: all var(--transition-medium);
    color: white;
    font-size: 1.5rem;
}

.chatbot-close-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

.chatbot-toggle.active .chatbot-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
}

.chatbot-toggle.active .chatbot-close-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.chatbot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 245, 255, 0.3);
    animation: chatbotPulse 2s infinite;
    z-index: -1;
}

@keyframes chatbotPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.4;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

.chatbot-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 140px);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all var(--transition-medium);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 10px 30px rgba(0, 245, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.chatbot-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.1) 0%, rgba(131, 56, 236, 0.05) 100%);
    border-bottom: 1px solid rgba(0, 245, 255, 0.15);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chatbot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 245, 255, 0.3);
}

.chatbot-header-text h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-minimize {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: scale(1.05);
}

.chatbot-body {
    height: calc(100% - 89px);
    padding: 0;
    overflow: hidden;
    position: relative;
}

.chatbot-welcome {
    padding: 2rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 245, 255, 0.3);
    animation: welcomePulse 3s ease-in-out infinite;
}

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

.chatbot-welcome h4 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.chatbot-welcome p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 245, 255, 0.05);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.95rem;
    text-align: left;
}

.quick-action:hover {
    background: rgba(0, 245, 255, 0.1);
    border-color: rgba(0, 245, 255, 0.4);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 245, 255, 0.2);
}

.quick-action i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Legacy iframe styles - now handled by agent container */
.chatbot-iframe-old {
    width: 100%;
    height: calc(100% - 85px);
    border: none;
    background: var(--bg-primary);
    border-radius: 0 0 20px 20px;
}

/* Agent iframe loading states */
.chatbot-iframe.loading {
    background: var(--bg-primary);
    position: relative;
}

.chatbot-iframe.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 245, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: iframeLoading 1s linear infinite;
    z-index: 10;
}

@keyframes iframeLoading {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.chatbot-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    min-height: 600px;
}

/* Form Styles */
.url-input-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin: 1.5rem 0;
}

.agent-url-input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 245, 255, 0.05);
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.agent-url-input:focus {
    outline: none;
    border-color: rgba(0, 245, 255, 0.5);
    background: rgba(0, 245, 255, 0.08);
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.2);
}

.agent-url-input::placeholder {
    color: var(--text-muted);
}

.set-url-btn {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(0, 245, 255, 0.3);
}

.set-url-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 245, 255, 0.4);
}

.back-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Responsive Chatbot */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    .chatbot-toggle {
        width: 60px;
        height: 60px;
    }
    
    .chatbot-popup {
        width: calc(100vw - 2rem);
        height: 70vh;
        bottom: 70px;
        right: -1rem;
        max-width: 400px;
    }
    
    .chatbot-welcome {
        padding: 1.5rem;
    }
    
    .welcome-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .chatbot-welcome h4 {
        font-size: 1.25rem;
    }
}
