/* Contextual Help Bubbles with Micro-interactions */

/* Help Bubble Container */
.help-bubble {
    position: relative;
    display: inline-block;
    margin-left: 0.5rem;
}

/* Help Icon */
.help-icon {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(74, 144, 226, 0.2);
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

.help-icon:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #357abd 0%, #2968a3 100%);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
    border-color: rgba(74, 144, 226, 0.4);
}

.help-icon i {
    font-size: 10px;
    color: white;
    font-weight: bold;
}

/* Help Bubble Content */
.help-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 12px;
    padding: 1rem;
    min-width: 250px;
    max-width: 350px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-8px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme support */
[data-bs-theme="dark"] .help-content {
    background: rgba(33, 37, 41, 0.95);
    border-color: rgba(74, 144, 226, 0.3);
    color: #f8f9fa;
}

/* Show help content on hover */
.help-bubble:hover .help-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px) scale(1);
}

/* Help content arrow */
.help-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .help-content::after {
    border-top-color: rgba(33, 37, 41, 0.95);
}

/* Help content text */
.help-content h6 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a90e2;
}

[data-bs-theme="dark"] .help-content h6 {
    color: #74b9ff;
}

.help-content p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #6c757d;
}

[data-bs-theme="dark"] .help-content p {
    color: #adb5bd;
}

/* Help content with lists */
.help-content ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1rem;
    font-size: 0.8rem;
}

.help-content li {
    margin-bottom: 0.25rem;
    color: #6c757d;
}

[data-bs-theme="dark"] .help-content li {
    color: #adb5bd;
}

/* Alternative positioning for help bubbles */
.help-bubble.help-bottom .help-content {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(8px);
}

.help-bubble.help-bottom:hover .help-content {
    transform: translateX(-50%) translateY(8px) scale(1);
}

.help-bubble.help-bottom .help-content::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .help-bubble.help-bottom .help-content::after {
    border-bottom-color: rgba(33, 37, 41, 0.95);
}

/* Right-aligned help bubbles */
.help-bubble.help-right .help-content {
    left: auto;
    right: 0;
    transform: translateY(-8px);
}

.help-bubble.help-right:hover .help-content {
    transform: translateY(-8px) scale(1);
}

.help-bubble.help-right .help-content::after {
    left: auto;
    right: 20px;
}

/* Left-aligned help bubbles */
.help-bubble.help-left .help-content {
    left: 0;
    right: auto;
    transform: translateY(-8px);
}

.help-bubble.help-left:hover .help-content {
    transform: translateY(-8px) scale(1);
}

.help-bubble.help-left .help-content::after {
    left: 20px;
    right: auto;
}

/* Micro-interaction: Pulse animation for important help */
.help-bubble.help-important .help-icon {
    animation: helpPulse 2s infinite;
}

@keyframes helpPulse {
    0% {
        box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
    }
    50% {
        box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2), 0 0 0 8px rgba(74, 144, 226, 0.1);
    }
    100% {
        box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
    }
}

/* Help bubble for form fields */
.form-group .help-bubble {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.form-group {
    position: relative;
}

/* Help sections - larger help areas */
.help-section {
    background: rgba(74, 144, 226, 0.05);
    border: 1px solid rgba(74, 144, 226, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.help-section:hover {
    background: rgba(74, 144, 226, 0.08);
    border-color: rgba(74, 144, 226, 0.2);
}

[data-bs-theme="dark"] .help-section {
    background: rgba(74, 144, 226, 0.1);
    border-color: rgba(74, 144, 226, 0.2);
}

[data-bs-theme="dark"] .help-section:hover {
    background: rgba(74, 144, 226, 0.15);
    border-color: rgba(74, 144, 226, 0.3);
}

.help-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a90e2;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

[data-bs-theme="dark"] .help-section-title {
    color: #74b9ff;
}

.help-section-title i {
    margin-right: 0.5rem;
}

.help-section-content {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
}

[data-bs-theme="dark"] .help-section-content {
    color: #adb5bd;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .help-content {
        min-width: 200px;
        max-width: 280px;
        padding: 0.75rem;
    }
    
    .help-content h6 {
        font-size: 0.85rem;
    }
    
    .help-content p {
        font-size: 0.75rem;
    }
}

/* Help overlay for guided tours */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.help-overlay.active {
    opacity: 1;
    visibility: visible;
}

.help-spotlight {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.3), 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: all 0.3s ease;
}

/* Interactive help toggle */
.help-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.help-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(74, 144, 226, 0.4);
}

.help-toggle i {
    color: white;
    font-size: 20px;
}

.help-toggle.active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

/* Help badge for new features */
.help-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: helpBadgePulse 1.5s infinite;
}

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