/* ADAPTIVE QUANTUM MICROINTERACTION TOOLTIPS */

/* Core Tooltip Container */
.quantum-tooltip {
    position: absolute;
    z-index: 20000;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8) translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.quantum-tooltip.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Tooltip Content */
.tooltip-content {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 280px;
    min-width: 120px;
    position: relative;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Quantum Border Animation */
.tooltip-content::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, #00ffff, #8b5cf6, #ec4899, #10b981, #00ffff);
    background-size: 300% 300%;
    border-radius: 12px;
    z-index: -1;
    animation: quantumBorderFlow 3s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes quantumBorderFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Tooltip Text */
.tooltip-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #00ffff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooltip-description {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    margin-bottom: 8px;
}

.tooltip-shortcut {
    font-size: 0.7rem;
    color: rgba(0, 255, 255, 0.8);
    background: rgba(0, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    display: inline-block;
    margin-top: 4px;
}

/* Tooltip Arrow */
.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.tooltip-arrow.top {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.95);
}

.tooltip-arrow.bottom {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(0, 0, 0, 0.95);
}

.tooltip-arrow.left {
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid rgba(0, 0, 0, 0.95);
}

.tooltip-arrow.right {
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(0, 0, 0, 0.95);
}

/* Adaptive Behavior Classes */
.tooltip-adaptive-beginner .tooltip-content {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(16, 185, 129, 0.3);
}

.tooltip-adaptive-intermediate .tooltip-content {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(139, 92, 246, 0.3);
}

.tooltip-adaptive-expert .tooltip-content {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(236, 72, 153, 0.3);
}

/* Quantum Particle Effects */
.tooltip-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #00ffff;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 2s ease-in-out infinite;
}

.tooltip-particle:nth-child(2) { 
    background: #8b5cf6; 
    animation-delay: 0.5s; 
    animation-duration: 2.5s; 
}

.tooltip-particle:nth-child(3) { 
    background: #ec4899; 
    animation-delay: 1s; 
    animation-duration: 1.8s; 
}

@keyframes particleFloat {
    0% { 
        opacity: 0; 
        transform: translate(0, 0) scale(0); 
    }
    20% { 
        opacity: 1; 
        transform: translate(10px, -15px) scale(1); 
    }
    80% { 
        opacity: 1; 
        transform: translate(20px, -30px) scale(0.8); 
    }
    100% { 
        opacity: 0; 
        transform: translate(30px, -50px) scale(0); 
    }
}

/* Hover Elements Enhancement */
[data-quantum-tooltip] {
    position: relative;
    cursor: help;
}

[data-quantum-tooltip]:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

/* Context-Specific Tooltips */
.tooltip-context-navigation .tooltip-title {
    color: #00ffff;
}

.tooltip-context-creation .tooltip-title {
    color: #10b981;
}

.tooltip-context-analysis .tooltip-title {
    color: #8b5cf6;
}

.tooltip-context-automation .tooltip-title {
    color: #ec4899;
}

.tooltip-context-help .tooltip-title {
    color: #f59e0b;
}

/* Microinteraction Ripple Effect */
.tooltip-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tooltip-content {
        max-width: 240px;
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .tooltip-title {
        font-size: 0.8rem;
    }
    
    .tooltip-description {
        font-size: 0.75rem;
    }
    
    .tooltip-shortcut {
        font-size: 0.65rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .tooltip-content {
        background: rgba(0, 0, 0, 1);
        border: 2px solid #00ffff;
    }
    
    .tooltip-description {
        color: white;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .quantum-tooltip {
        transition: opacity 0.2s ease;
    }
    
    .tooltip-content::before {
        animation: none;
        background: linear-gradient(45deg, #00ffff, #8b5cf6);
    }
    
    .tooltip-particle {
        display: none;
    }
}

/* Performance Optimizations */
.quantum-tooltip-container {
    contain: layout style paint;
    will-change: auto;
}

.tooltip-content {
    contain: layout style;
}