/* ═══════════════════════════════════════════════════════════════════════════
   Talent Tree — Style dla biblioteki TalentTree.php
   Dark theme, inspirowany interfejsem klienta OTCv8
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Kontener główny ──────────────────────────────────────────────────────── */
.talent-panel {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.talent-panel > .talent-tree {
    flex: 0 0 auto;
    max-width: 100%;
}

/* ─── Drzewko talentów ────────────────────────────────────────────────────── */
.talent-tree {
    font-family: 'Roboto', 'Verdana', sans-serif;
    color: #dfdfdf;
}

/* ─── Warianty: Weapon / Soul ─────────────────────────────────────────────── */
.talent-tree--weapon {
    /* broń po lewej */
}

.talent-tree--soul {
    /* soul po prawej */
}

.talent-tree--weapon .talent-tree__title {
    color: #ff6b6b;
    border-bottom-color: rgba(255, 107, 107, 0.3);
}

.talent-tree--soul .talent-tree__title {
    color: #ffd700;
    border-bottom-color: rgba(255, 215, 0, 0.25);
}

.talent-tree__title {
    font-size: 15px;
    font-weight: 700;
    color: #ffd700;
    text-transform: uppercase;
    text-align: center;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.25);
    letter-spacing: 1px;
}

.talent-tree__grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ─── Dwie kolumny (Soul: 100-600 / 700-1200, Weapon: 1-4 / 5-8) ─────────── */
.talent-tree__columns {
    display: flex;
    gap: 12px;
}

.talent-tree__column {
    flex: 1;
    min-width: 0;
}

/* Trzy kolumny (Soul: 100-400 / 500-800 / 900-1200) */
.talent-tree__columns--three {
    gap: 8px;
}

.talent-tree__columns--three .talent-tree__column {
    flex: 1;
    min-width: 0;
}

.talent-tree__column-title {
    font-size: 10px;
    font-weight: 600;
    color: #ffa100;
    text-align: center;
    padding: 3px 0;
    margin-bottom: 3px;
    border-bottom: 1px solid rgba(255, 161, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Wiersz talentu ──────────────────────────────────────────────────────── */
.talent-row {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.talent-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.talent-row--locked {
    opacity: 0.45;
}

.talent-row--locked:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: transparent;
}

/* ─── Ikona poziomu (lewa) ────────────────────────────────────────────────── */
.talent-row__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    margin-right: 10px;
}

.talent-row__icon img {
    width: 34px;
    height: 34px;
    image-rendering: pixelated;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
}

/* ─── Etykieta ─────────────────────────────────────────────────────────────── */
.talent-row__label {
    flex-shrink: 0;
    width: 60px;
    font-size: 12px;
    font-weight: 600;
    color: #ffa100;
    white-space: nowrap;
}

.talent-row--locked .talent-row__label {
    color: #666;
}

/* ─── Wybory (prawo) ──────────────────────────────────────────────────────── */
.talent-row__choices {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* ─── Pojedynczy wybór talentu ────────────────────────────────────────────── */
.talent-choice {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 4px;
    cursor: default;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.talent-choice img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

/* Fallback gdy obrazka nie ma — pusta, klikalna ramka */
.talent-choice--noimg {
    min-width: 34px;
    min-height: 34px;
}

.talent-choice--noimg::before {
    content: '?';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.2);
}

.talent-row__icon--empty {
    min-width: 34px;
    min-height: 34px;
}

.talent-row__icon--empty::before {
    content: '';
    display: block;
    width: 34px;
    height: 34px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.2);
}

/* Dostępny (odblokowany, niewybrany) */
.talent-choice--available {
    border-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.talent-choice--available:hover {
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
    transform: scale(1.08);
}

/* Wybrany */
.talent-choice--selected {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.1);
}

/* Przyciemniony (inny wybrany w tym samym wierszu) */
.talent-choice--dimmed {
    opacity: 0.3;
    filter: grayscale(0.5);
    cursor: default;
    border-color: rgba(255, 255, 255, 0.08);
}

/* ─── Statystyki (pasek % pod ikoną) ──────────────────────────────────────── */
.talent-row--stats .talent-choice {
    height: auto;
    flex-direction: column;
    padding: 3px 2px 2px 2px;
    gap: 2px;
}

.talent-row--stats .talent-choice img {
    width: 30px;
    height: 30px;
}

.talent-choice__stat {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.talent-choice__stat-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.talent-choice--available .talent-choice__stat-bar,
.talent-choice--selected .talent-choice__stat-bar {
    background: #3c8dbc;
}

.talent-choice--disabled .talent-choice__stat-bar {
    background: rgba(255, 255, 255, 0.06);
}

/* Procent na ikonce (prawy dolny róg) */
.talent-choice__pct {
    position: absolute;
    bottom: 8px;
    right: 1px;
    font-size: 8px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    padding: 0 3px;
    border-radius: 2px;
    line-height: 1.4;
    pointer-events: none;
    text-shadow: 0 1px 1px rgba(0,0,0,0.8);
}

.talent-choice--selected .talent-choice__pct,
.talent-choice--disabled .talent-choice__pct {
    display: none;
}

.talent-choice__check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 10px;
    color: #ffd700;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ffd700;
}

/* Zablokowany */
.talent-choice--disabled {
    opacity: 0.35;
    filter: grayscale(0.8);
}

/* ─── Pasek progresu broni ────────────────────────────────────────────────── */
.talent-weapon-bar {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.talent-weapon-bar__stage {
    font-size: 13px;
    font-weight: 700;
    color: #ffd700;
    text-align: center;
    margin-bottom: 8px;
}

.talent-weapon-bar__track {
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.talent-weapon-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #4444ff, #8888ff);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.talent-weapon-bar__icons {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.talent-weapon-stage {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease;
}

.talent-weapon-stage img {
    width: 30px;
    height: 30px;
    image-rendering: pixelated;
}

.talent-weapon-stage--active {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.05);
}

.talent-weapon-stage--locked {
    opacity: 0.3;
    filter: grayscale(0.9);
}

/* ─── Podsumowanie talentów (mini) ────────────────────────────────────────── */
.talent-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.talent-summary__section {
    flex: 1;
    min-width: 250px;
}

.talent-summary__section h4 {
    font-size: 13px;
    font-weight: 700;
    color: #ffa100;
    margin: 0 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 161, 0, 0.2);
}

.talent-summary__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
    color: #ccc;
}

.talent-summary__item img {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* ─── Build Summary (interaktywny) ────────────────────────────────────────── */
.talent-build {
    margin-top: 20px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.talent-build__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.talent-build__title {
    font-size: 15px;
    font-weight: 700;
    color: #ffd700;
    margin: 0;
}

.talent-build__actions {
    display: flex;
    gap: 10px;
}

.talent-build__btn {
    font-size: 12px;
    padding: 5px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.talent-build__btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.talent-build__btn--reset:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.talent-build__btn--copy:hover {
    border-color: #8888ff;
    color: #8888ff;
}

#talent-build-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.talent-build__group {
    flex: 1;
    min-width: 220px;
}

.talent-build__group h5 {
    font-size: 12px;
    font-weight: 700;
    color: #ffa100;
    margin: 0 0 6px 0;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(255, 161, 0, 0.2);
}

.talent-build__group h5 span {
    font-weight: 400;
    color: #888;
}

.talent-build__item {
    font-size: 11px;
    color: #bbb;
    padding: 2px 0;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.talent-build__icon {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.talent-build__stage {
    color: #ffa100;
    font-weight: 600;
    min-width: 70px;
    flex-shrink: 0;
}

.talent-build__desc {
    color: #bbb;
}

.talent-build__empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 10px 0;
    margin: 0;
}

/* ─── Tooltip ──────────────────────────────────────────────────────────────── */
.talent-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: 280px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.92);
    border: 1px solid #ffd700;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.5;
    color: #dfdfdf;
    pointer-events: none;
    white-space: pre-line;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

/* ─── Responsywność ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .talent-panel {
        flex-direction: column;
        padding: 10px;
        gap: 15px;
    }

    .talent-panel > .talent-tree {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }

    .talent-tree__columns,
    .talent-tree__columns--three {
        flex-direction: column;
        gap: 8px;
    }

    .talent-row__label {
        width: 70px;
        font-size: 10px;
    }

    .talent-choice,
    .talent-row__icon {
        width: 28px;
        height: 28px;
    }

    .talent-choice img,
    .talent-row__icon img {
        width: 26px;
        height: 26px;
    }
}
