/**
 * Tooltips Styles for Quotation Form Wizard
 * 
 * @package AnchorExpressInc\QuotationForm
 * @version 1.0.0
 */

/* ========================================
   Tooltip Container
   ======================================== */

.qf-description {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    max-width: min(320px, calc(100vw - 40px));
    background: #1f2937;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

/* Prevent tooltip from going off screen on the right */
.qf-chip:last-child .qf-description,
.qf-chip:nth-last-child(2) .qf-description {
    left: auto;
    right: 0;
}

.qf-chip.qf-tooltip-active .qf-description {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Responsive Positioning
   ======================================== */

@media screen and (max-width: 768px) {
    .qf-description {
        min-width: 240px;
        max-width: calc(100vw - 40px);
        font-size: 12px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    /* Override the right positioning on mobile to center all tooltips */
    .qf-chip:last-child .qf-description,
    .qf-chip:nth-last-child(2) .qf-description {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

@media screen and (max-width: 480px) {
    .qf-description {
        min-width: 200px;
        max-width: calc(100vw - 32px);
    }
}

/* ========================================
   Tooltip Active State
   ======================================== */

.qf-tooltip-active {
    position: relative;
    z-index: 100;
}

/* Ensure tooltip is above other elements */
.qf-chip-group {
    position: relative;
}

/* ========================================
   Accessibility
   ======================================== */

.qf-info-icon:focus {
    outline: 2px solid var(--qf-dynamic-primary);
    outline-offset: 2px;
    border-radius: 50%;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .qf-description {
        border: 2px solid #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .qf-description {
        transition: none;
    }
}
