/* Utils - утилиты, анимации, вспомогательные классы */

/* Анимации */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Анимация успешного изменения */
@keyframes successFlash {
    0% {
        background-color: #4caf50;
    }
    100% {
        background-color: transparent;
    }
}

.success-flash {
    animation: successFlash 2s ease-out;
}

/* Кнопка "Наверх" */
.back-to-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    display: none;
}

.back-to-top:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Tooltip система */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10000;
    margin-bottom: 8px;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10000;
    margin-bottom: 2px;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Двухколоночная сетка для блоков */
.two-column-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.full-width-grid {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    /* Переключаем блоки в один столбец на мобильных */
    .two-column-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Бургер-меню */
.burger-menu {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 1024px) {
    .burger-menu {
        display: block;
    }
}
