/* AI Widget Styles */
.ai-widget-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.5);
    z-index: 9998;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.ai-widget-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(34, 211, 238, 0.7);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(34, 211, 238, 0.5);
    }

    50% {
        box-shadow: 0 8px 32px rgba(34, 211, 238, 0.8);
    }
}

.ai-widget-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    max-height: 600px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ai-widget-container.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

.ai-widget-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 1.25rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.ai-widget-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.1rem;
}

.ai-widget-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: background 0.2s;
}

.ai-widget-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-widget-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    gap: 0.5rem;
}

.ai-widget-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.ai-widget-tab.active {
    background: rgba(34, 211, 238, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.ai-widget-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 300px;
    max-height: 400px;
}

.ai-message {
    padding: 1rem;
    border-radius: 16px;
    max-width: 85%;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message.bot {
    background: rgba(34, 211, 238, 0.15);
    border: 1px solid rgba(34, 211, 238, 0.3);
    align-self: flex-start;
}

.ai-message.user {
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.3);
    align-self: flex-end;
}

.ai-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.ai-quick-reply {
    padding: 0.5rem 1rem;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid var(--primary);
    border-radius: 20px;
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.ai-quick-reply:hover {
    background: var(--primary);
    color: #000;
}

.ai-widget-input {
    display: flex;
    padding: 1rem;
    gap: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.ai-widget-input input {
    flex: 1;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
}

.ai-widget-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.ai-widget-send {
    padding: 0.875rem 1.25rem;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: #000;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-widget-send:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* Questionnaire Styles */
.questionnaire-step {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.questionnaire-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.questionnaire-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.questionnaire-option {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.questionnaire-option:hover {
    border-color: var(--primary);
    background: rgba(34, 211, 238, 0.1);
    transform: translateX(4px);
}

.questionnaire-progress {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.progress-dot {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    transition: background 0.3s;
}

.progress-dot.active {
    background: var(--primary);
}

.progress-dot.completed {
    background: var(--secondary);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.4rem;
    padding: 1rem !important;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-widget-container {
        width: calc(100% - 32px);
        right: 16px;
        bottom: 90px;
        max-height: 500px;
    }

    .ai-widget-bubble {
        width: 56px;
        height: 56px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }

    .ai-widget-content {
        max-height: 300px;
    }
}