/**
 * Animated Microinteraction Tooltips Styles
 * Beautiful, smooth tooltips with animations for BarkThread
 */

/* Tooltip Container */
.tooltip-container {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
}

/* Main Tooltip */
.animated-tooltip {
    position: absolute;
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    max-width: 300px;
    min-width: 120px;
    backdrop-filter: blur(8px);
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8) translateY(10px);
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme support */
[data-theme="dark"] .animated-tooltip {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border-medium, #475569);
    color: var(--text-primary, #f8fafc);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* Tooltip Title */
.tooltip-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary, #1e293b);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .tooltip-title {
    color: var(--text-primary, #f8fafc);
}

/* Tooltip Content */
.tooltip-content {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    line-height: 1.5;
    letter-spacing: -0.005em;
}

[data-theme="dark"] .tooltip-content {
    color: var(--text-secondary, #cbd5e1);
}

/* Tooltip Arrow */
.tooltip-arrow {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--border-light, #e2e8f0);
    transform: rotate(45deg);
    z-index: -1;
}

[data-theme="dark"] .tooltip-arrow {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border-medium, #475569);
}

/* Arrow positioning for different tooltip positions */
.tooltip-top .tooltip-arrow {
    bottom: -5px;
    left: 50%;
    margin-left: -4px;
    border-top: none;
    border-left: none;
}

.tooltip-bottom .tooltip-arrow {
    top: -5px;
    left: 50%;
    margin-left: -4px;
    border-bottom: none;
    border-right: none;
}

.tooltip-left .tooltip-arrow {
    right: -5px;
    top: 50%;
    margin-top: -4px;
    border-left: none;
    border-bottom: none;
}

.tooltip-right .tooltip-arrow {
    left: -5px;
    top: 50%;
    margin-top: -4px;
    border-right: none;
    border-top: none;
}

/* Animation states */
.animated-tooltip.tooltip-show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.animated-tooltip.tooltip-hide {
    opacity: 0;
    transform: scale(0.8) translateY(-10px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .animated-tooltip {
        font-size: 13px;
        padding: 10px 12px;
        max-width: 250px;
    }
    
    .tooltip-title {
        font-size: 12px;
    }
    
    .tooltip-content {
        font-size: 11px;
    }
}

/* Special tooltip variants */
.tooltip-success {
    border-color: var(--success-color, #10b981);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.02));
}

.tooltip-warning {
    border-color: var(--warning-color, #f59e0b);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.02));
}

.tooltip-error {
    border-color: var(--danger-color, #ef4444);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.02));
}

.tooltip-info {
    border-color: var(--primary-color, #6366f1);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(99, 102, 241, 0.02));
}

/* Microinteraction enhancements */
.animated-tooltip {
    animation: tooltipGlow 2s ease-in-out infinite alternate;
}

@keyframes tooltipGlow {
    from {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.1);
    }
    to {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18), 0 6px 12px rgba(0, 0, 0, 0.12);
    }
}

[data-theme="dark"] .animated-tooltip {
    animation: tooltipGlowDark 2s ease-in-out infinite alternate;
}

@keyframes tooltipGlowDark {
    from {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 5px 10px rgba(0, 0, 0, 0.2);
    }
    to {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 6px 12px rgba(0, 0, 0, 0.3);
    }
}

/* Pulse animation for important tooltips */
.tooltip-pulse {
    animation: tooltipPulse 1.5s ease-in-out infinite;
}

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

/* Tooltip positioning helpers */
.tooltip-fixed-width {
    width: 200px;
}

.tooltip-wide {
    max-width: 400px;
}

.tooltip-narrow {
    max-width: 180px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .animated-tooltip {
        border-width: 2px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    
    .tooltip-arrow {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .animated-tooltip {
        transition: opacity 100ms ease-in-out;
        animation: none;
    }
    
    .tooltip-pulse {
        animation: none;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .animated-tooltip {
        padding: 14px 18px;
        font-size: 15px;
        min-width: 140px;
    }
    
    .tooltip-title {
        font-size: 14px;
    }
    
    .tooltip-content {
        font-size: 13px;
    }
}