/* Стили отображения связок камней умений для фронтенда (Компактный Maxroll PoE 2 Style) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Внешняя обертка блока (группы наборов) */
.poe-gem-group-container-wrapper {
    background: #090a0d;
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #e2e8f0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.poe-gem-group-container-wrapper * {
    box-sizing: border-box;
}

/* Панель вкладок (выбор вариантов/сетов в стиле Maxroll) */
.poe-skills-tab-bar {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 2px;
    background: #111218;
    border-bottom: 2px solid #1a1b24;
    border-radius: 6px 6px 0 0;
    padding: 2px 2px 0 2px;
    margin-bottom: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
}

.poe-skills-tab-bar::-webkit-scrollbar {
    display: none;
}

.poe-skill-tab-btn {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    outline: none;
    margin-bottom: -2px;
    line-height: 1.2;
}

.poe-skill-tab-btn:hover {
    color: #cbd5e1;
}

.poe-skill-tab-btn.active {
    color: #ffb300;
    border-bottom-color: #ffb300;
    background: rgba(255, 179, 0, 0.02);
}

/* Вертикальный стек связок умений */
.poe-skill-group-row {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 15px;
}

.poe-skill-group-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Заметка/название группы (например, "Body Armour") */
.poe-skill-group-title {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    border-left: 3px solid #ffb300;
    padding-left: 6px;
    line-height: 1;
}

/* Контейнер связки камней (очень компактный) */
.poe-gem-group-container {
    background: linear-gradient(135deg, #0d0f14 0%, #111520 100%);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.poe-gem-group-container:last-child {
    margin-bottom: 0;
}

.poe-gem-group-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Группа активных умений (выравнивание нескольких Main Skills) */
.poe-main-skills-block-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Главный блок активного умения */
.poe-main-skill-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.poe-gem-socket-wrapper {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

/* Стили сокетов */
.poe-gem-socket {
    position: relative;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, #080a0e 45%, #141b29 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8), 0 1px 3px rgba(0,0,0,0.5);
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.poe-gem-socket:hover {
    transform: scale(1.05);
    cursor: pointer;
}

/* Главное умение: Крупный золотой светящийся сокет */
.poe-gem-main-socket {
    width: 48px;
    height: 48px;
}

.poe-gem-main-socket .poe-gem-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid #ffb300;
    background: transparent;
    z-index: 2;
    box-shadow: inset 0 0 6px rgba(255, 179, 0, 0.4);
}

.poe-gem-main-socket .poe-gem-glow {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 10px rgba(255, 179, 0, 0.3);
    z-index: 1;
    animation: poe-gold-pulse 3s infinite alternate;
}

/* Камни поддержки: Серебристые сокеты поменьше */
.poe-gem-support-socket {
    width: 38px;
    height: 38px;
}

.poe-gem-support-socket .poe-gem-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid #64748b;
    background: transparent;
    z-index: 2;
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.08);
}

/* Цветовая кодировка приоритета поддержки по границам сокетов */
.poe-support-gem-item.poe-priority-required .poe-gem-support-socket .poe-gem-border {
    border-color: #ef4444; /* Красный для обязательных */
    box-shadow: inset 0 0 4px rgba(239, 68, 68, 0.2), 0 0 4px rgba(239, 68, 68, 0.15);
}

.poe-support-gem-item.poe-priority-alternative .poe-gem-support-socket .poe-gem-border {
    border-color: #64748b; /* Серый для заменяемых */
}

.poe-support-gem-item.poe-priority-link5 .poe-gem-support-socket .poe-gem-border {
    border-color: #3b82f6; /* Синий для 5-линка */
    box-shadow: inset 0 0 4px rgba(59, 130, 246, 0.2), 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Иконки камней */
.poe-gem-icon-inner {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    overflow: hidden;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poe-gem-icon-inner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

/* Бейджики уровня и качества */
.poe-gem-level-badge {
    position: absolute;
    bottom: -1px;
    right: -1px;
    background: #090a0f;
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
    font-size: 8px;
    font-weight: 700;
    padding: 0px 2px;
    border-radius: 2px;
    z-index: 4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
    line-height: 1.1;
}

.poe-gem-quality-badge {
    position: absolute;
    top: -1px;
    left: -1px;
    background: #143c3d;
    border: 1px solid #1e7072;
    color: #4fd1c5;
    font-size: 8px;
    font-weight: 700;
    padding: 0px 2px;
    border-radius: 2px;
    z-index: 4;
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
    line-height: 1.1;
}

/* Мета-информация главного камня */
.poe-gem-meta-info {
    display: flex;
    flex-direction: column;
}

.poe-gem-name-ru {
    font-size: 13px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    text-decoration: none;
    transition: color 0.15s;
    line-height: 1.2;
}

.poe-gem-name-ru:hover {
    color: #fff;
    cursor: pointer;
}

.poe-gem-name-en {
    font-size: 10px;
    color: #64748b;
    margin-top: 1px;
    line-height: 1.1;
}

.poe-gem-details-row {
    font-size: 9px;
    color: #475569;
    margin-top: 3px;
    font-weight: 500;
}

.poe-gem-meta-level {
    color: #94a3b8;
}

.poe-gem-meta-quality {
    color: #319795;
}

.poe-gem-meta-sep {
    margin: 0 3px;
}

/* Соединительная линия (Связь сокетов) */
.poe-gem-connector-line {
    flex-grow: 0;
    width: 25px;
    height: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 6px;
    flex-shrink: 0;
}

.poe-link-chain {
    width: 100%;
    height: 4px;
    background: linear-gradient(180deg, #ffb300 0%, #b8860b 50%, #4c3600 100%);
    box-shadow: 0 1px 2px rgba(0,0,0,0.5);
    border-radius: 1px;
    position: relative;
}

.poe-link-chain::after {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    top: 1px;
    bottom: 1px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 1px;
}

/* Блок камней поддержки */
.poe-support-gems-block {
    display: flex;
    align-items: center;
    gap: 6px; /* Супер-компактная сетка */
    flex-grow: 1;
    flex-wrap: wrap;
}

/* Ссылка-обертка для камня поддержки */
.poe-support-gem-item {
    display: inline-block;
    cursor: pointer;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.poe-support-gem-item:hover {
    transform: scale(1.05);
}

/* Пустые сообщения */
.poe-skills-empty-message {
    color: #475569;
    text-align: center;
    padding: 20px;
    font-size: 12px;
    font-style: italic;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    border: 1px dashed rgba(255, 255, 255, 0.02);
}

/* Анимация пульсации золотого свечения */
@keyframes poe-gold-pulse {
    0% {
        box-shadow: 0 0 6px rgba(255, 179, 0, 0.2);
    }
    100% {
        box-shadow: 0 0 12px rgba(255, 179, 0, 0.4);
    }
}

/* Плиточный лейаут (layout="tile") */
.poe-gem-group-container.poe-layout-tile {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.poe-gem-group-container.poe-layout-tile .poe-gem-connector-line {
    width: 8px;
    height: 20px;
    margin: 2px 0 2px 20px;
}

.poe-gem-group-container.poe-layout-tile .poe-link-chain {
    width: 4px;
    height: 100%;
    background: linear-gradient(90deg, #ffb300 0%, #b8860b 50%, #4c3600 100%);
}

.poe-gem-group-container.poe-layout-tile .poe-support-gems-block {
    width: 100%;
}

/* Адаптивный дизайн (Поскольку все стало очень компактным, на экранах > 400px все помещается в одну строку!) */
@media (max-width: 480px) {
    .poe-gem-group-container {
        padding: 8px 10px;
    }
    .poe-gem-connector-line {
        width: 15px;
        margin: 0 4px;
    }
}
