/* AI Course Recommendation Widget Styles */

.ai-recommendation-widget {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9998;
    font-family: 'Inter', sans-serif;
}

/* Trigger Button */
.ai-rec-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.ai-rec-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4);
}

.ai-rec-trigger i {
    font-size: 16px;
    animation: sparkle 2s ease-in-out infinite;
}

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

/* Panel */
.ai-rec-panel {
    position: absolute;
    bottom: 60px;
    left: 0;
    width: 380px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    overflow: hidden;
}

.ai-rec-panel.show {
    display: block;
    animation: slideUpPanel 0.3s ease-out;
}

@keyframes slideUpPanel {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.ai-rec-header {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-rec-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-rec-icon {
    font-size: 24px;
    animation: pulse 2s infinite;
}

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

.ai-rec-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-rec-header p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.ai-rec-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-rec-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Body */
.ai-rec-body {
    padding: 20px;
    max-height: 450px;
    overflow-y: auto;
}

/* Steps */
.ai-rec-step {
    display: none;
}

.ai-rec-step.active {
    display: block;
}

.ai-rec-step h5 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 15px;
    font-weight: 600;
}

/* Interest Chips */
.interest-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.interest-chip {
    padding: 8px 14px;
    background: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.interest-chip:hover {
    background: #e5e7eb;
}

.interest-chip.selected {
    background: #ede9fe;
    border-color: #8b5cf6;
    color: #7c3aed;
}

/* Custom Interest Input */
.custom-interest {
    margin-bottom: 15px;
}

.custom-interest input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.custom-interest input:focus {
    border-color: #8b5cf6;
}

/* Buttons */
.ai-rec-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.ai-rec-btn.primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
}

.ai-rec-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.ai-rec-btn.secondary {
    background: #f3f4f6;
    color: #374151;
    margin-top: 15px;
}

.ai-rec-btn.secondary:hover {
    background: #e5e7eb;
}

/* Loading Animation */
.ai-loading {
    text-align: center;
    padding: 30px 0;
}

.ai-loading-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.ai-brain {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: #8b5cf6;
    z-index: 2;
    animation: brainPulse 1s ease-in-out infinite;
}

@keyframes brainPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.ai-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: pulseRing 1.5s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ai-loading p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* Results */
.ai-results h5 {
    margin-bottom: 15px;
}

/* Course Cards */
.rec-course-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.rec-course-card:hover {
    background: #f1f5f9;
    transform: translateX(5px);
}

.rec-course-image {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.rec-course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rec-course-rating {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #fbbf24;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.rec-course-info {
    flex: 1;
    min-width: 0;
}

.rec-course-info h6 {
    margin: 0 0 5px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rec-course-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #6b7280;
    margin: 0 0 5px 0;
}

.rec-course-meta i {
    margin-right: 3px;
}

.rec-course-reason {
    font-size: 11px;
    color: #8b5cf6;
    margin: 0 0 8px 0;
    font-style: italic;
}

.rec-course-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: #8b5cf6;
    color: white;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.rec-course-btn:hover {
    background: #7c3aed;
    color: white;
}

/* Error & No Results */
.error-message, .no-results {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.error-message i, .no-results i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.error-message i {
    color: #ef4444;
}

.no-results i {
    color: #9ca3af;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ai-recommendation-widget {
        left: 10px;
        bottom: 90px;
    }
    
    .ai-rec-trigger span {
        display: none;
    }
    
    .ai-rec-trigger {
        width: 50px;
        height: 50px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
    
    .ai-rec-panel {
        width: calc(100vw - 20px);
        left: 0;
        right: 0;
        bottom: 70px;
    }
}
