/* Универсальные стили для всплывающих подсказок */

.tooltip-trigger {
    display: inline-block;
    position: relative;
    cursor: help;
    margin-left: 5px;
}

.tooltip-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.tooltip-icon:hover {
    background: #495057;
    transform: scale(1.1);
}

.tooltip-icon:focus {
    outline: none;
    border-color: #228B22;
    box-shadow: 0 0 0 2px rgba(34, 139, 34, 0.2);
}

.tooltip-balloon {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    max-width: 400px;
    min-width: 200px;
    width: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.tooltip-fixed {
    position: fixed;
    max-width: 400px;
    width: auto !important;
    box-sizing: border-box;
    z-index: 999;
    transform: translateX(-50%);
    margin-left: 0;
    margin-right: 0;
}

/* Remove default arrow - arrows will be added by specific position classes */
.tooltip-balloon::before {
    display: none;
}

/* Desktop: horizontal stretched balloon */
@media (min-width: 768px) {
    .tooltip-balloon {
        min-width: 300px;
        max-width: 500px;
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Balloon positioned below trigger */
.tooltip-balloon.tooltip-below {
    bottom: auto;
    top: 100%;
    margin-bottom: 0;
    margin-top: 8px;
}

/* Balloon positioned above trigger */
.tooltip-balloon.tooltip-above {
    bottom: 100%;
    top: auto;
    margin-bottom: 8px;
    margin-top: 0;
}

/* Arrow for balloon positioned above trigger */
.tooltip-balloon.tooltip-above::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

/* Arrow for balloon positioned below trigger */
.tooltip-balloon.tooltip-below::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #333;
}


/* Плавное появление подсказок без анимации движения */
.tooltip-trigger:hover .tooltip-balloon,
.tooltip-trigger:focus .tooltip-balloon,
.tooltip-trigger.active .tooltip-balloon {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .tooltip-balloon {
        max-width: 250px;
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .tooltip-icon {
        width: 16px;
        height: 16px;
        font-size: 11px;
    }
}

/* Стили для различных типов подсказок */
.tooltip-info .tooltip-icon {
    background: #fff;
    color: #6d6d6d;
    font-weight: 400;
    border: 1px solid #6d6d6d;
}

.tooltip-warning .tooltip-icon {
    background: #ffc107;
    color: #212529;
}

.tooltip-success .tooltip-icon {
    background: #28a745;
}

.tooltip-danger .tooltip-icon {
    background: #dc3545;
}

.tooltip-info .tooltip-balloon {
    background: #fff;
    color: #383a3f;
    font-weight: 400;
}

.tooltip-warning .tooltip-balloon {
    background: #ffc107;
    color: #212529;
}

.tooltip-success .tooltip-balloon {
    background: #28a745;
}

.tooltip-danger .tooltip-balloon {
    background: #dc3545;
}

/* Color arrows based on position and type */
.tooltip-info .tooltip-balloon.tooltip-above::after {
    border-top-color: #383a3f;
}

.tooltip-info .tooltip-balloon.tooltip-below::after {
    border-bottom-color: #383a3f;
}

.tooltip-warning .tooltip-balloon.tooltip-above::after {
    border-top-color: #ffc107;
}

.tooltip-warning .tooltip-balloon.tooltip-below::after {
    border-bottom-color: #ffc107;
}

.tooltip-success .tooltip-balloon.tooltip-above::after {
    border-top-color: #28a745;
}

.tooltip-success .tooltip-balloon.tooltip-below::after {
    border-bottom-color: #28a745;
}

.tooltip-danger .tooltip-balloon.tooltip-above::after {
    border-top-color: #dc3545;
}

.tooltip-danger .tooltip-balloon.tooltip-below::after {
    border-bottom-color: #dc3545;
}
