/**
 * Переиспользуемые стили для Tooltip компонента
 * Корпоративный цвет: #006699
 */

.custom-tooltip-container {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    /* КРИТИЧНО: Убеждаемся что контейнер видим */
    width: 100%;
    height: 100%;
    overflow: visible;
}

.custom-tooltip {
    position: absolute;
    background: #2c3e50;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: auto; /* Разрешаем клики и наведение на tooltip */
    max-width: 500px; /* Увеличено для длинных имен файлов */
    word-wrap: break-word;
    /* Позволяем tooltip расширяться по ширине для длинных имен */
    width: max-content;
    min-width: 200px;
    /* КРИТИЧНО: Убеждаемся что tooltip видим и поверх всего */
    z-index: 10001 !important;
    visibility: visible !important;
}

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

/* Стрелка tooltip */
.custom-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Стрелка сверху (tooltip снизу) */
.custom-tooltip[data-position="bottom"]::before,
.custom-tooltip.bottom::before {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent #2c3e50 transparent;
}

/* Стрелка снизу (tooltip сверху) */
.custom-tooltip[data-position="top"]::before,
.custom-tooltip.top::before {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-color: #2c3e50 transparent transparent transparent;
}

/* Стрелка слева (tooltip справа) */
.custom-tooltip[data-position="right"]::before,
.custom-tooltip.right::before {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-color: transparent #2c3e50 transparent transparent;
}

/* Стрелка справа (tooltip слева) */
.custom-tooltip[data-position="left"]::before,
.custom-tooltip.left::before {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent #2c3e50;
}

/* Стили для содержимого tooltip */
.custom-tooltip .tooltip-title {
    font-weight: bold;
    margin-bottom: 4px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 4px;
    white-space: nowrap; /* Имя файла не разрывается на несколько строк - пробелы неразрывные */
    /* НЕ обрезаем длинные имена - показываем полностью */
    word-break: break-all; /* Разрываем только если очень длинное слово без пробелов */
}

.custom-tooltip .tooltip-content {
    margin: 0;
}

.custom-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    gap: 12px;
    white-space: nowrap; /* Предотвращаем перенос строк */
    flex-wrap: nowrap; /* Не переносим на новую строку */
}

.custom-tooltip .tooltip-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: normal;
    white-space: nowrap; /* Не переносим метку */
    flex-shrink: 0; /* Не сжимаем метку */
}

.custom-tooltip .tooltip-value {
    color: #ffffff;
    font-weight: 500;
    text-align: right;
    white-space: nowrap; /* Не переносим значение */
    flex-shrink: 0; /* Не сжимаем значение */
    overflow: hidden;
    text-overflow: ellipsis; /* Обрезаем если слишком длинное */
    max-width: 200px; /* Максимальная ширина значения */
}

/* SSOT: Стили для иконок в tooltip - единообразный вид для всех иконок */
/* КРИТИЧНО: Font Awesome использует SVG вместо <i> тегов, поэтому стилизуем оба варианта */

/* Стили для обычных <i> тегов (fallback) */
.custom-tooltip .tooltip-label i {
    color: rgba(255, 255, 255, 0.8) !important; /* Тот же цвет что и у .tooltip-label */
    font-size: inherit !important; /* Наследуем размер шрифта */
    margin-right: 4px !important; /* Отступ справа от иконки */
    vertical-align: baseline !important; /* Выравнивание по базовой линии */
    display: inline-block !important; /* Для правильного выравнивания */
    width: 1em !important; /* Фиксированная ширина для выравнивания */
    text-align: center !important; /* Центрируем иконку */
    cursor: default !important; /* Не кликабельная */
    transform: none !important; /* Убираем transform от hover эффектов */
    text-shadow: none !important; /* Убираем text-shadow */
    transition: none !important; /* Убираем transition */
}

/* КРИТИЧНО: Стили для SVG иконок Font Awesome (основной вариант) */
/* Переопределяем ВСЕ возможные глобальные стили для SVG в tooltip */
.custom-tooltip .tooltip-label svg,
.custom-tooltip .tooltip-label svg.svg-inline--fa {
    color: rgba(255, 255, 255, 0.8) !important; /* Тот же цвет что и у .tooltip-label */
    fill: rgba(255, 255, 255, 0.8) !important; /* Для SVG fill вместо color */
    font-size: inherit !important; /* Наследуем размер шрифта */
    margin-right: 4px !important; /* Отступ справа от иконки */
    vertical-align: middle !important; /* Выравнивание по центру для правильного выравнивания */
    display: inline-block !important; /* Для правильного выравнивания */
    width: 1em !important; /* Фиксированная ширина для выравнивания */
    height: 1em !important; /* Фиксированная высота для выравнивания */
    text-align: center !important; /* Центрируем иконку */
    cursor: default !important; /* Не кликабельная */
    transform: none !important; /* Убираем transform от hover эффектов */
    transition: none !important; /* Убираем transition */
    line-height: 1 !important; /* Убираем line-height для правильного выравнивания */
}

/* КРИТИЧНО: Стили для path внутри SVG - цвет заливки */
.custom-tooltip .tooltip-label svg path,
.custom-tooltip .tooltip-label svg.svg-inline--fa path {
    fill: rgba(255, 255, 255, 0.8) !important; /* Тот же цвет что и у иконки */
    color: rgba(255, 255, 255, 0.8) !important; /* На случай если используется currentColor */
}

/* Специально для SVG иконки лайка в tooltip - переопределяем все возможные стили */
.custom-tooltip .tooltip-label svg.fa-heart,
.custom-tooltip .tooltip-label svg.svg-inline--fa.fa-heart {
    color: rgba(255, 255, 255, 0.8) !important; /* Тот же цвет что и у других иконок */
    fill: rgba(255, 255, 255, 0.8) !important; /* Для SVG fill вместо color */
    font-size: inherit !important;
    margin-right: 4px !important;
    vertical-align: middle !important; /* Выравнивание по центру */
    display: inline-block !important;
    width: 1em !important;
    height: 1em !important;
    text-align: center !important;
    cursor: default !important;
    transform: none !important;
    transition: none !important;
    line-height: 1 !important;
}

/* КРИТИЧНО: Стили для path внутри SVG иконки лайка */
.custom-tooltip .tooltip-label svg.fa-heart path,
.custom-tooltip .tooltip-label svg.svg-inline--fa.fa-heart path {
    fill: rgba(255, 255, 255, 0.8) !important; /* Тот же цвет что и у других иконок */
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Убеждаемся что все иконки в tooltip имеют одинаковый стиль */
.custom-tooltip .tooltip-label i.fas,
.custom-tooltip .tooltip-label i.far,
.custom-tooltip .tooltip-label i.fab {
    color: rgba(255, 255, 255, 0.8) !important; /* Принудительно устанавливаем цвет */
    font-size: inherit !important;
    margin-right: 4px !important;
    vertical-align: baseline !important;
    display: inline-block !important;
    width: 1em !important;
    text-align: center !important;
    cursor: default !important;
    transform: none !important;
    text-shadow: none !important;
    transition: none !important;
}

/* Специально для иконки лайка в tooltip (fallback для <i>) - переопределяем все возможные стили */
.custom-tooltip .tooltip-label i.fa-heart {
    color: rgba(255, 255, 255, 0.8) !important; /* Тот же цвет что и у других иконок */
    font-size: inherit !important;
    margin-right: 4px !important;
    vertical-align: baseline !important;
    display: inline-block !important;
    width: 1em !important;
    text-align: center !important;
    cursor: default !important;
    transform: none !important;
    text-shadow: none !important;
    transition: none !important;
}

/* Убираем hover эффекты для иконок в tooltip */
.custom-tooltip .tooltip-label i:hover,
.custom-tooltip .tooltip-label i.fa-heart:hover,
.custom-tooltip .tooltip-label svg:hover,
.custom-tooltip .tooltip-label svg.fa-heart:hover,
.custom-tooltip .tooltip-label svg path:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    fill: rgba(255, 255, 255, 0.8) !important;
    transform: none !important;
    text-shadow: none !important;
}

/* КРИТИЧНО: Переопределяем глобальные стили для .clickable-icon и .fa-heart внутри tooltip */
.custom-tooltip .tooltip-label .clickable-icon,
.custom-tooltip .tooltip-label svg.clickable-icon,
.custom-tooltip .tooltip-label .fa-heart.clickable-icon,
.custom-tooltip .tooltip-label svg.fa-heart.clickable-icon {
    color: rgba(255, 255, 255, 0.8) !important;
    fill: rgba(255, 255, 255, 0.8) !important;
    font-size: inherit !important;
    margin-right: 4px !important;
    vertical-align: middle !important;
    transform: none !important;
    text-shadow: none !important;
    transition: none !important;
    cursor: default !important;
}
