/**
 * Tooltip Component Styles
 *
 * Simple, clean styling for the reusable tooltip component with:
 * - Base tooltip container and content styles
 * - Arrow positioning for all directions (left, right, top, bottom)
 * - Smooth animations
 * - Mobile-responsive adjustments
 * - Accessibility considerations
 *
 * NOTE: This component uses the centralized color management system from src/color-system/colors.css
 * All colors are referenced using CSS custom properties (variables) for consistency.
 *
 * @author Austin Steil
 * @version 1.0.0
 * @license MIT <https://raw.githubusercontent.com/AustinSteil/generate-files-model/refs/heads/main/LICENSE>
 * @copyright 2025 Austin Steil
 * @created October 18, 2025
 * @updated October 18, 2025
 */

/* Base Tooltip Styles */
.tooltip-container {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    opacity: 1; /* Changed from 0 - animation will override this */
    animation: tooltipFadeIn var(--transition-base) ease-out forwards;
}

.tooltip-content {
    background: var(--color-gray-800);
    color: var(--color-text-white);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.5;
    max-width: 280px;
    word-wrap: break-word;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
}

/* Arrow Positioning - Left Position */
.tooltip-left .tooltip-arrow {
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    border-left: 8px solid var(--color-gray-800);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: none;
}

/* Arrow Positioning - Right Position */
.tooltip-right .tooltip-arrow {
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
    border-right: 8px solid var(--color-gray-800);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: none;
}

/* Arrow Positioning - Top Position */
.tooltip-top .tooltip-arrow {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-top: 8px solid var(--color-gray-800);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: none;
}

/* Arrow Positioning - Bottom Position */
.tooltip-bottom .tooltip-arrow {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom: 8px solid var(--color-gray-800);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: none;
}

/* Base Animation */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Position-specific Animations */
.tooltip-right {
    animation: tooltipFadeInRight var(--transition-base) ease-out forwards;
}

.tooltip-top {
    animation: tooltipFadeInTop var(--transition-base) ease-out forwards;
}

.tooltip-bottom {
    animation: tooltipFadeInBottom var(--transition-base) ease-out forwards;
}

.tooltip-left {
    animation: tooltipFadeInLeft var(--transition-base) ease-out forwards;
}

@keyframes tooltipFadeInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes tooltipFadeInLeft {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes tooltipFadeInBottom {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Element with tooltip cursor */
.has-tooltip {
    cursor: help;
}

/* Accessibility - Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .tooltip-container {
        animation: none;
        opacity: 1;
    }
    
    .tooltip-right,
    .tooltip-left,
    .tooltip-top,
    .tooltip-bottom {
        animation: none;
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .tooltip-content {
        max-width: 220px;
        font-size: 13px;
        padding: 10px 12px;
    }

    /* Smaller arrows on mobile */
    .tooltip-left .tooltip-arrow {
        right: -6px;
        border-left-width: 6px;
        border-top-width: 6px;
        border-bottom-width: 6px;
    }

    .tooltip-right .tooltip-arrow {
        left: -6px;
        border-right-width: 6px;
        border-top-width: 6px;
        border-bottom-width: 6px;
    }

    .tooltip-top .tooltip-arrow {
        bottom: -6px;
        border-top-width: 6px;
        border-left-width: 6px;
        border-right-width: 6px;
    }

    .tooltip-bottom .tooltip-arrow {
        top: -6px;
        border-bottom-width: 6px;
        border-left-width: 6px;
        border-right-width: 6px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tooltip-theme-default .tooltip-content,
    .tooltip-theme-dark .tooltip-content {
        border: 2px solid white;
    }
    
    .tooltip-theme-light .tooltip-content {
        border: 2px solid black;
    }
}

/* Print styles - hide tooltips when printing */
@media print {
    .tooltip-container {
        display: none !important;
    }
}
