/* Agent Hunt WordPress Plugin Styles */
.agent-hunt-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.agent-hunt-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.agent-hunt-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

.agent-hunt-container.top-right {
    top: 20px;
    right: 20px;
}

.agent-hunt-container.top-left {
    top: 20px;
    left: 20px;
}

/* Floating Chat Button */
.agent-hunt-button {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.agent-hunt-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.agent-hunt-button .icon {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
}

.agent-hunt-button .status-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #10B981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

/* Chat Window */
.agent-hunt-chat {
    width: 384px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

.agent-hunt-chat.open {
    display: flex;
}

/* Header */
.agent-hunt-header {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agent-hunt-header .info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-hunt-header .avatar {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.agent-hunt-header .details h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.agent-hunt-header .details p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.agent-hunt-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.agent-hunt-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.agent-hunt-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #F9FAFB, #F3F4F6);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agent-hunt-message {
    display: flex;
    flex-direction: column;
}

.agent-hunt-message.user {
    align-items: flex-end;
}

.agent-hunt-message.agent {
    align-items: flex-start;
}

.agent-hunt-message .sender-info {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 4px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.agent-hunt-message .sender-info .dot {
    width: 8px;
    height: 8px;
    background: #3B82F6;
    border-radius: 50%;
}

.agent-hunt-message .bubble {
    max-width: 280px;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.agent-hunt-message.user .bubble {
    background: #3B82F6;
    color: white;
}

.agent-hunt-message.agent .bubble {
    background: white;
    color: #374151;
    border: 1px solid #E5E7EB;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.agent-hunt-message .timestamp {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 4px;
    padding: 0 4px;
}

/* Loading Animation */
.agent-hunt-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
}

.agent-hunt-loading .dot {
    width: 8px;
    height: 8px;
    background: #3B82F6;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.agent-hunt-loading .dot:nth-child(1) { animation-delay: -0.32s; }
.agent-hunt-loading .dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Input Area */
.agent-hunt-input {
    padding: 16px;
    border-top: 1px solid #E5E7EB;
    background: white;
}

.agent-hunt-input form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.agent-hunt-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.agent-hunt-input input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.agent-hunt-input button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.agent-hunt-input button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563EB, #7C3AED);
}

.agent-hunt-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Service Selection */
.agent-hunt-services {
    padding: 16px;
    border-top: 1px solid #E5E7EB;
    background: white;
}

.agent-hunt-services .service-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.agent-hunt-services .service-option {
    padding: 12px 16px;
    background: linear-gradient(135deg, #EBF8FF, #F3E8FF);
    border: 1px solid #3B82F6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.agent-hunt-services .service-option .service-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.agent-hunt-services .service-option .service-name {
    flex: 1;
}

.agent-hunt-services .service-option:hover:not(:disabled) {
    background: linear-gradient(135deg, #DBEAFE, #EDE9FE);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.agent-hunt-services .service-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.agent-hunt-services .service-option.processing {
    background: linear-gradient(135deg, #F3F4F6, #E5E7EB);
    border-color: #9CA3AF;
    cursor: not-allowed;
}

.agent-hunt-services .service-option.processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Processing State */
.agent-hunt-processing {
    padding: 16px;
    border-top: 1px solid #E5E7EB;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    text-align: center;
}

.agent-hunt-processing .processing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.agent-hunt-processing .processing-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #E5E7EB;
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.agent-hunt-processing .processing-text {
    color: #6B7280;
    font-weight: 500;
    font-size: 14px;
}

.agent-hunt-processing .processing-subtext {
    color: #9CA3AF;
    font-size: 12px;
}

/* Completion State */
.agent-hunt-completion {
    padding: 16px;
    border-top: 1px solid #E5E7EB;
    background: linear-gradient(135deg, #ECFDF5, #EBF8FF);
    text-align: center;
}

.agent-hunt-completion .success-message {
    color: #059669;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.agent-hunt-completion .success-icon {
    font-size: 18px;
    animation: successPulse 0.6s ease-out;
}

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

/* Responsive Design */
@media (max-width: 480px) {
    .agent-hunt-chat {
        width: calc(100vw - 40px);
        height: calc(100vh - 40px);
        max-width: 384px;
        max-height: 500px;
    }
    
    .agent-hunt-container.bottom-right,
    .agent-hunt-container.bottom-left {
        bottom: 10px;
    }
    
    .agent-hunt-container.bottom-right {
        right: 10px;
    }
    
    .agent-hunt-container.bottom-left {
        left: 10px;
    }
    
    .agent-hunt-services .service-option {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .agent-hunt-services .service-option .service-icon {
        font-size: 18px;
    }
}

/* Accessibility */
.agent-hunt-button:focus,
.agent-hunt-close:focus,
.agent-hunt-input input:focus,
.agent-hunt-input button:focus,
.agent-hunt-services .service-option:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Hide scrollbar but keep functionality */
.agent-hunt-messages::-webkit-scrollbar {
    width: 4px;
}

.agent-hunt-messages::-webkit-scrollbar-track {
    background: transparent;
}

.agent-hunt-messages::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 2px;
}

.agent-hunt-messages::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}
