﻿/* ==========================================================================
   Status Info Popup (Tooltip) Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Core Structure & Functionality
   -------------------------------------------------------------------------- */

/* Main wrapper - establishes positioning context */
.status-info-popup-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    outline: none;
}

/* The element that triggers the popup (icon area) */
.status-info-popup__trigger {
    display: inline-flex;
    align-items: center;
}

/* Base styles for the status icon */
.status-info-popup__icon {
    display: block;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

/* Container specifically for when the icon has a badge */
.status-info-popup__icon-container--with-badge {
    position: relative;
    display: inline-block;
}

/* Badge for multiple changes */
.status-info-popup__badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background-color: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 0.5rem;
    min-width: 14px;
    text-align: center;
    box-shadow: 0 0 0 1px white;
    z-index: 1;
}

/* The actual popup content - hidden by default */
.status-info-popup__content {
    position: absolute;
    z-index: 100;
    visibility: hidden;
    opacity: 0;
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1.4;
    min-width: 150px;
    max-width: 300px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    white-space: normal;
}

/* Show the popup on hover or focus of the wrapper */
.status-info-popup-wrapper:hover .status-info-popup__content,
.status-info-popup-wrapper:focus .status-info-popup__content,
.status-info-popup-wrapper:focus-within .status-info-popup__content {
    visibility: visible;
    opacity: 1;
}

/* Title styling within the popup */
.status-info-popup__title {
    font-weight: bold;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #555;
}

/* Styling for lists inside the popup */
.status-info-popup__content ul {
    margin-top: 5px !important;
    padding-left: 16px !important;
    list-style-type: disc !important;
    margin-bottom: 0;
}

.status-info-popup__content li {
    margin-bottom: 3px;
}

/* --------------------------------------------------------------------------
   Positioning Modifiers
   -------------------------------------------------------------------------- */

/* Position: Top */
.status-info-popup--position-top .status-info-popup__content {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 6px;
}

    .status-info-popup--position-top .status-info-popup__content::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border-width: 5px;
        border-style: solid;
        border-color: #333 transparent transparent transparent;
    }

/* Position: Bottom */
.status-info-popup--position-bottom .status-info-popup__content {
    top: 100%;
    left: -20px;
    transform: none;
    margin-top: 6px;
    min-width: 200px;
}

    .status-info-popup--position-bottom .status-info-popup__content::after {
        content: '';
        position: absolute;
        bottom: 100%;
        left: 25px;
        transform: none;
        border-width: 5px;
        border-style: solid;
        border-color: transparent transparent #333 transparent;
    }

/* --------------------------------------------------------------------------
   Type Modifiers - Colors for different tooltip types
   -------------------------------------------------------------------------- */

/* Info (Default - Blue) */
.status-info-popup--type-info .status-info-popup__content {
    background-color: #4a90e2;
    border: 1px solid #3a7bc8;
}

.status-info-popup--type-info .status-info-popup__title {
    border-bottom-color: #6aa5e9;
}

.status-info-popup--position-top.status-info-popup--type-info .status-info-popup__content::after {
    border-top-color: #4a90e2;
}

.status-info-popup--position-bottom.status-info-popup--type-info .status-info-popup__content::after {
    border-bottom-color: #4a90e2;
}

/* Warning (Yellow/Orange) */
.status-info-popup--type-warning .status-info-popup__content {
    background-color: #f5a623;
    border: 1px solid #d08c1b;
    color: #333;
}

.status-info-popup--type-warning .status-info-popup__title {
    border-bottom-color: #f7b64f;
}

.status-info-popup--position-top.status-info-popup--type-warning .status-info-popup__content::after {
    border-top-color: #f5a623;
}

.status-info-popup--position-bottom.status-info-popup--type-warning .status-info-popup__content::after {
    border-bottom-color: #f5a623;
}

/* Price Change (Green) */
.status-info-popup--type-price .status-info-popup__content {
    background-color: #28a745;
    border: 1px solid #1e7e34;
}

.status-info-popup--type-price .status-info-popup__title {
    border-bottom-color: #4cc065;
}

.status-info-popup--position-top.status-info-popup--type-price .status-info-popup__content::after {
    border-top-color: #28a745;
}

.status-info-popup--position-bottom.status-info-popup--type-price .status-info-popup__content::after {
    border-bottom-color: #28a745;
}

/* Unit Change (Purple) */
.status-info-popup--type-unit .status-info-popup__content {
    background-color: #6f42c1;
    border: 1px solid #5a359a;
}

.status-info-popup--type-unit .status-info-popup__title {
    border-bottom-color: #8a63cf;
}

.status-info-popup--position-top.status-info-popup--type-unit .status-info-popup__content::after {
    border-top-color: #6f42c1;
}

.status-info-popup--position-bottom.status-info-popup--type-unit .status-info-popup__content::after {
    border-bottom-color: #6f42c1;
}

/* Description Change (Teal/Cyan) */
.status-info-popup--type-description .status-info-popup__content {
    background-color: #17a2b8;
    border: 1px solid #117a8b;
}

.status-info-popup--type-description .status-info-popup__title {
    border-bottom-color: #3dbcd1;
}

.status-info-popup--position-top.status-info-popup--type-description .status-info-popup__content::after {
    border-top-color: #17a2b8;
}

.status-info-popup--position-bottom.status-info-popup--type-description .status-info-popup__content::after {
    border-bottom-color: #17a2b8;
}
