/**
 * AI Category Suggestion Styles
 * File: ai-category-suggestion.css
 * Place this in: /assets/css/ai-category-suggestion.css
 * Or add to your main stylesheet
 */

/* Status message animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes celebrateGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(76, 175, 80, 0.2);
    }
}

/* AI Status Element */
#ai-category-status {
    position: relative;
    overflow: hidden;
}

#ai-category-status::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s;
}

#ai-category-status.ai-processing::before {
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Spinner icon animation */
.ai-spinner {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

#ai-category-status.ai-processing .ai-spinner {
    animation: spin 2s linear infinite;
}

/* Category wrapper celebration effect */
.search-category.ai-category-selected {
    animation: celebrateGlow 2s ease-in-out;
}

.search-category.ai-category-selected .chosen-container,
.search-category.ai-category-selected .select2-container {
    transition: all 0.3s ease;
}

/* Loading state for input */
#post_title.ai-loading {
    background-image: linear-gradient(
        90deg,
        transparent,
        rgba(33, 150, 243, 0.1),
        transparent
    );
    background-size: 200% 100%;
    animation: inputShimmer 2s infinite;
}

@keyframes inputShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Success checkmark animation */
@keyframes checkmark {
    0% {
        transform: scale(0) rotate(45deg);
    }
    50% {
        transform: scale(1.2) rotate(45deg);
    }
    100% {
        transform: scale(1) rotate(45deg);
    }
}

#ai-category-status.success::after {
    content: '✓';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #4caf50;
    animation: checkmark 0.5s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #ai-category-status {
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* Optional: Add tooltip for AI feature */
.ai-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    cursor: help;
}

.ai-tooltip::before {
    content: '🤖';
    font-size: 16px;
}

.ai-tooltip::after {
    content: 'AI sugerirá una categoría automáticamente';
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.ai-tooltip:hover::after {
    opacity: 1;
}

/* Arrow for tooltip */
.ai-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s;
}

.ai-tooltip:hover::before {
    opacity: 1;
}