/*!
 * Faction showcase.
 */


.factions-section {
    background: url(../../img/bg-char.png) center top / cover no-repeat;
    min-height: 620px;
    position: relative;
    margin-top: 40px;
    overflow: hidden;
    padding: 0;
}

.factions-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    z-index: 10;
    height: 100%;
}

/* Tabs Navigation */
.factions-tabs-nav {
    position: relative;
    border-bottom: 1px solid rgba(180, 160, 140, 0.4);
    padding-top: 20px;
}

.factions-tabs-list {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 15;
}

.faction-tab-item {
    position: relative;
    padding: 12px 22px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
    user-select: none;
    letter-spacing: 0.02em;
}

.faction-tab-item:hover {
    color: #c00000;
}

.faction-tab-item.active {
    color: #c00000;
}

/* Animated indicator bar (uses active.png) */
.factions-tab-indicator {
    position: absolute;
    bottom: -6px;
    /* Adjusted to overlap border precisely, considering image transparency padding */
    height: auto;
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
        width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
}

.factions-tab-indicator .indicator-img {
    display: block;
    width: 60px;
    /* Reference has a specific width for the icon, center it */
    height: auto;
    margin: 0 auto;
}

/* Content Area (Panels) */
.factions-content-area {
    position: relative;
    width: 100%;
    min-height: 600px;
}

/* Each panel is absolutely positioned, layered via opacity */
.faction-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0.45s ease;
    pointer-events: none;
}

.faction-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    position: relative;
}

/* Character Image (Left Side) */
.faction-char-wrapper {
    position: relative;
    width: 50%;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Align bottom to let it overflow down */
}

/* Larger than the section is tall, and hung so the figure reads from the head
   down while the section's overflow trims the legs — the framing the reference
   site uses. A less negative offset lifts the figure and shows more of the
   legs; much past this and the head runs into the tab row above. */
.faction-char-img {
    position: absolute;
    bottom: -450px;
    height: 1100px;
    max-height: none;
    width: auto;
    max-width: none;
    z-index: 5;
    object-fit: contain;
    filter: drop-shadow(4px 8px 16px rgba(0, 0, 0, 0.12));
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.faction-panel.active .faction-char-img {
    animation: charSlideIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes charSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.97);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Character Info (Right Side) */
.faction-info-wrapper {
    width: 50%;
    padding: 50px 20px 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.faction-info-top {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

/* Vertical Name Tag (using index-layer-85.png) */
.faction-name-tag {
    width: 48px;
    min-width: 48px;
    height: 160px;
    background: url(../../img/index-layer-85.png) center / 100% 100% no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 28px;
    flex-shrink: 0;
}

.faction-name-tag span {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    padding: 0 4px;
}

/* Specs & Description area */
.faction-info-details {
    flex: 1;
    padding-top: 4px;
    max-width: 400px;
}

.faction-spec-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.spec-badge {
    appearance: none;
    -webkit-appearance: none;
    padding: 7px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    letter-spacing: 0.02em;
    font-family: inherit;
    outline: none;
    box-shadow: none;
}

.spec-badge.primary,
.spec-badge.active {
    background-color: #c7565b;
    border-color: #c7565b;
    color: #fff;
}

.spec-badge.secondary {
    background-color: transparent;
    color: #8b6e6e;
    border-color: #b5a09a;
}

.spec-badge:hover,
.spec-badge:focus,
.spec-badge:active {
    outline: none;
    box-shadow: none;
}

.spec-badge.secondary:hover {
    background-color: rgba(199, 86, 91, 0.08);
    color: #8b6e6e;
    border-color: #b5a09a;
}

.spec-badge.primary:hover,
.spec-badge.active:hover {
    background-color: #c7565b;
    border-color: #c7565b;
    color: #fff;
}

.faction-desc-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #bbb 0%, transparent 100%);
    margin: 12px 0 16px 0;
}

.faction-desc {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.7;
    margin: 0;
}

/* Stats / Weapon / Skills */
.faction-stats {
    padding-left: 76px;
    margin-top: 8px;
}

.faction-stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.92rem;
    color: #444;
}

.stat-label {
    font-weight: 700;
    color: #333;
    margin-right: 8px;
    white-space: nowrap;
}

.stat-value {
    color: #555;
}

.faction-skill-icons-row {
    margin-top: 8px;
}

.faction-skill-icons {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Skill Circles */
.factions-section .skill-circle {
    display: inline-block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4c4b0 0%, #c9b89a 100%);
    /* border: 1px solid #b09070; */
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.factions-section .skill-circle-img {
    object-fit: cover;
    padding: 3px;
}

.factions-section .skill-circle:hover {
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(180, 130, 80, 0.3);
}

/* Responsive Factions Section */
@media (max-width: 991.98px) {
    .factions-section {
        min-height: auto;
    }

    .factions-tabs-list {
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .faction-tab-item {
        font-size: 0.92rem;
        padding: 10px 14px;
    }

    .faction-panel {
        flex-direction: column;
    }

    .faction-panel.active {
        position: relative;
    }

    .faction-char-wrapper {
        width: 100%;
        min-height: 380px;
    }

    .faction-char-img {
        max-height: 400px;
        bottom: 0;
    }

    .faction-info-wrapper {
        width: 100%;
        padding: 20px 15px 30px;
    }

    .faction-stats {
        padding-left: 0;
    }

    .factions-content-area {
        min-height: auto;
    }
}

@media (max-width: 767.98px) {
    .factions-tabs-nav {
        padding-top: 10px;
    }

    .faction-tab-item {
        font-size: 0.82rem;
        padding: 8px 10px;
    }

    .faction-char-wrapper {
        min-height: 300px;
    }

    .faction-char-img {
        max-height: 320px;
    }

    .faction-name-tag {
        width: 36px;
        min-width: 36px;
        height: 120px;
        margin-right: 16px;
    }

    .faction-name-tag span {
        font-size: 0.75rem;
    }

    .spec-badge {
        font-size: 0.82rem;
        padding: 5px 12px;
    }

    .faction-desc {
        font-size: 0.85rem;
    }

    .faction-info-details {
        max-width: 100%;
    }

    .factions-section .skill-circle {
        width: 40px;
        height: 40px;
    }
}

/* Scrollbar for tabs on mobile */
.factions-tabs-list::-webkit-scrollbar {
    height: 3px;
}

.factions-tabs-list::-webkit-scrollbar-thumb {
    background-color: rgba(192, 0, 0, 0.3);
    border-radius: 4px;
}
