/* ===============================================
   ELDER SPORES ONLINE - CHAMPION POINTS STYLES
   Version: 1.0
   Created: November 11, 2025
   
   Styles for Champion Points modal with
   three-tree constellation system
   =============================================== */

/* ===== MODAL STRUCTURE ===== */
.champion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.champion-window {
    position: absolute;
    left: 16.4%; /*16.4*/
    top: 16.6%;
    width: 52%; /*16.4*/
    min-width: 750px;
    max-width: 1000px;
    height: 80.5%;
    max-height: 800px;
    background-color: #1a1a1a;
    border: 2px solid var(--color-secondary);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 8px 5px rgba(0, 0, 0, 0.95),
                0 0 12px 7px rgba(139, 69, 19, 0.4);
}

/* ===== HEADER ===== */
.champion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(to right, var(--color-secondary), #2a2a2a);
    border-bottom: 1px solid var(--color-secondary);
    border-radius: 8px 8px 0 0;
}

.champion-header h2 {
    margin: 0;
    color: #FFD700;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.champion-close {
    padding: 5px 10px;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 24px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.champion-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===== TAB BUTTONS ===== */
.champion-tabs-container {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 7px;
    /* background: rgba(0, 0, 0, 0.6);*/
    /* border: 1px solid var(--color-secondary); */
    border-radius: 6px;
    z-index: 10;
}

.champion-tab-btn {
    width: 45px;
    height: 45px;
    background: rgba(10, 10, 10);
    border: 2px solid #666;
    border-radius: 4px;
    padding: 3px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.champion-tab-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.champion-tab-btn:hover {
    border-color: var(--color-primary);
    background: rgba(20, 20, 20);
    transform: scale(1.05);
}

.champion-tab-btn.active {
    border-color: #FFD700;
    /* background: rgba(139, 69, 19); */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

/* Warfare tab (blue) */
.champion-tab-btn[data-tree="warfare"].active {
    border-color: #0066ff;
    transform: scale(1.25);
    box-shadow: 0 0 15px rgba(0, 128, 255, 0.6);
}

/* Fitness tab (red) */
.champion-tab-btn[data-tree="fitness"].active {
    border-color: #FF4500;
    transform: scale(1.25);
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.6);
}

/* Craft tab (green) */
.champion-tab-btn[data-tree="craft"].active {
    border-color: #41ea41;
    transform: scale(1.25);
    box-shadow: 0 0 15px rgba(113, 255, 113, 0.6);
}

/* Back button styling */
.champion-back-btn {
    width: 45px;
    height: 45px;
    background: rgba(60, 60, 60);
    border: 2px solid #999;
    display: none; /* Hidden by default */
}

.champion-back-btn:hover {
    border-color: #FFD700;
    background: rgba(80, 80, 80);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.champion-back-btn span {
    color: #FFD700;
}

/* ===== AVAILABLE POINTS DISPLAY ===== */
.champion-available-points {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    /* background: rgba(0, 0, 0, 0.6); */
    /* border: 1px solid var(--color-secondary); */
    border-radius: 8px;
    z-index: 10;
    font-size: 16px;
    font-weight: bold;
}

.available-label {
    color: #D2B48C; /* Tan color */
    font-size: 18px;
}

.available-amount {
    color: white;
    font-size: 20px;
    min-width: 40px;
    text-align: center;
}

/* ===== CONSTELLATION DISPLAY ===== */
.champion-constellation-container {
    flex: 1;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid #FFD700;
    margin: 0;
    /* overflow: hidden; */
}

.constellation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.constellation-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ===== CONSTELLATION STARS (IMAGE-BASED) ===== */
.constellation-star {
    position: absolute;
    width: 36px;
    height: 36px;
    cursor: pointer;
    pointer-events: auto;
    transition: var(--transition-fast);
    user-select: none;
    transform: translate(-50%, -50%);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: .35;
}

/* Root nodes - higher visibility when inactive */
.constellation-star[data-rootnode="true"]:not(.active) {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(1.25);
}

/* Default star image (inactive passive/slottable) */
.constellation-star {
    background-image: url('/graphics/Champion/star_default.png');
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

/* === HOVER PREVIEWS (inactive stars only) === */

/* Passive stars - hover preview (not active) */
.constellation-star[data-type="passive"]:not(.active):hover {
    background-image: url('/graphics/Champion/star_passive.png');
}

/* Slottable stars - hover preview (not active) */
.constellation-star[data-type="slottable"].warfare:not(.active):hover {
    background-image: url('/graphics/Champion/star_warfare.png');
}

.constellation-star[data-type="slottable"].fitness:not(.active):hover {
    background-image: url('/graphics/Champion/star_fitness.png');
}

.constellation-star[data-type="slottable"].craft:not(.active):hover {
    background-image: url('/graphics/Champion/star_craft.png');
}

/* === ACTIVE STATES (permanent) === */

/* Passive stars - active (yellow) */
.constellation-star[data-type="passive"].active {
    background-image: url('/graphics/Champion/star_passive.png');
    transform: translate(-50%, -50%) scale(1.5);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
    opacity: 1;
}

/* Slottable stars - active (tree-dependent colors) */
.constellation-star[data-type="slottable"].active.warfare {
    background-image: url('/graphics/Champion/slottable_warfare.png');
    transform: translate(-50%, -50%) scale(1.35);
    filter: drop-shadow(0 0 8px rgba(0, 128, 255, 0.8));
    opacity: 1;
}

.constellation-star[data-type="slottable"].active.fitness {
    background-image: url('/graphics/Champion/slottable_fitness.png');
    transform: translate(-50%, -50%) scale(1.35);
    filter: drop-shadow(0 0 8px rgba(255, 69, 0, 0.8));
    opacity: 1;
}

.constellation-star[data-type="slottable"].active.craft {
    background-image: url('/graphics/Champion/slottable_craft.png');
    transform: translate(-50%, -50%) scale(1.35);
    filter: drop-shadow(0 0 8px rgba(144, 238, 144, 0.8));
    opacity: 1;
}

/* Sub-constellation stars - always purple with glow */
.constellation-star[data-type="sub"] {
    background-image: url('/graphics/Champion/star_sub.png');
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 10px rgba(160, 32, 240, 0.9))
            drop-shadow(0 0 20px rgba(160, 32, 240, 0.5));
}

/* Sub-constellations with active skills inside */
.constellation-star[data-has-active="true"]:not(.active) {
    opacity: .75;
    transform: translate(-50%, -50%) scale(1.25);
}

/* Hover effects - default (passive stars) */
.constellation-star[data-type="passive"]:hover {
    transform: translate(-50%, -50%) scale(1.75);
    filter: drop-shadow(0 0 24px rgba(255, 215, 0, 1))
            drop-shadow(0 0 48px rgba(255, 215, 0, 1));
}

/* Hover effects - slottable stars (tree-specific colors) */
.constellation-star[data-type="slottable"].warfare:hover {
    transform: translate(-50%, -50%) scale(1.75);
    filter: drop-shadow(0 0 24px rgba(0, 128, 255, 1))
            drop-shadow(0 0 48px rgba(0, 128, 255, 1));
}

.constellation-star[data-type="slottable"].fitness:hover {
    transform: translate(-50%, -50%) scale(1.75);
    filter: drop-shadow(0 0 24px rgba(255, 69, 0, 1))
            drop-shadow(0 0 48px rgba(255, 69, 0, 1));
}

.constellation-star[data-type="slottable"].craft:hover {
    transform: translate(-50%, -50%) scale(1.75);
    filter: drop-shadow(0 0 24px rgba(144, 238, 144, 1))
            drop-shadow(0 0 48px rgba(144, 238, 144, 1));
}

/* Hover effects - sub stars */
.constellation-star[data-type="sub"]:hover {
    transform: translate(-50%, -50%) scale(2);
    filter: drop-shadow(0 0 30px rgba(160, 32, 240, 1))
            drop-shadow(0 0 60px rgba(160, 32, 240, 1));
}

/* Constellation connecting lines */
.constellation-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    cursor: default;
    z-index: 5;
}

.constellation-connection {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1;
    transition: var(--transition-fast);
    pointer-events: none;
}

.constellation-hover-target {
    pointer-events: stroke;
}

/* STAR hovered → Everything lights up instantly */
.champion-constellation-container:has(.constellation-star:hover) .constellation-connection {
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 2;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
}

.champion-constellation-container:has(.constellation-star:hover) .constellation-star {
    opacity: 1;
}

/* LINE hovered → Delayed effect (prevents strobe when crossing lines quickly) */
.champion-constellation-container:has(.constellation-hover-target:hover) .constellation-connection {
    stroke: rgba(255, 255, 255, 0.5);
    stroke-width: 2;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
    transition-delay: 0.1s;
}

.champion-constellation-container:has(.constellation-hover-target:hover) .constellation-star {
    opacity: 1;
    transition-delay: 0.1s;
}

/* ===== CP SKILL SLOTS ===== */
.champion-slots-container {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    /* background: rgb(0, 0, 0); */
    /* border: 1px solid var(--color-secondary); */
    border-radius: 8px;
    z-index: 10;
}

.champion-skill-slot {
    width: 52px;
    height: 52px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.slot-circle {
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10/*, 0.8*/);
    border: 3px solid #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--color-text);
    transition: var(--transition-fast);
}

.champion-skill-slot:hover .slot-circle {
    border-color: var(--color-primary);
    background: rgba(20, 20, 20/*, 0.9*/);
    transform: scale(1.05);
}

.slot-circle.occupied {
    border-color: var(--color-success);
    background: rgba(10, 10, 10/*, 0.9*/);
}

/* ===== FOOTER BUTTONS ===== */
.champion-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(to right, #2a2a2a, var(--color-secondary));
    border-top: 1px solid var(--color-secondary);
    border-radius: 0 0 8px 8px;
}

.champion-clear-btn,
.champion-save-btn {
    padding: 10px 30px;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
}

.champion-clear-btn {
    background: rgba(139, 0, 0, 0.3);
    border-color: #8B0000;
    color: #FF6B6B;
}

.champion-clear-btn:hover {
    background: rgba(139, 0, 0, 0.6);
    border-color: #FF0000;
    color: #FFF;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.champion-save-btn {
    background: rgba(0, 100, 0, 0.3);
    border-color: #006400;
    color: #90EE90;
}

.champion-save-btn:hover {
    background: rgba(0, 128, 0, 0.6);
    border-color: #00FF00;
    color: #FFF;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 1200px) {
    .champion-window {
        width: 45%;
        height: 70%;
    }
}

@media (max-width: 768px) {
    .champion-window {
        width: 90%;
        height: 85%;
        left: 5%;
        top: 7.5%;
    }
    
    .champion-slots-container {
        gap: 10px;
    }
    
    .champion-skill-slot {
        width: 60px;
        height: 60px;
    }
}

/* ===== CHAMPION TOOLTIP BASE ===== */
#champion-tooltip {
    position: fixed;
    display: none;
    background: rgba(26, 26, 26, 0.98);
    border: 2px solid var(--color-secondary);
    border-radius: 8px;
    padding: 12px 15px;
    max-width: 300px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    font-family: 'Futura', sans-serif;
    color: #fff;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ===== TOOLTIP CONSTELLATION STYLING ===== */
#champion-tooltip.tooltip-warfare-active {
    border: 3px solid rgba(0, 128, 255, 1);
    box-shadow: 0 0 15px rgba(0, 128, 255, 0.6), 0 0 30px rgba(0, 128, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.8);
}

#champion-tooltip.tooltip-fitness-active {
    border: 3px solid rgba(255, 69, 0, 1);
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.6), 0 0 30px rgba(255, 69, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.8);
}

#champion-tooltip.tooltip-craft-active {
    border: 3px solid rgba(144, 238, 144, 1);
    box-shadow: 0 0 15px rgba(113, 255, 113, 0.6), 0 0 30px rgba(113, 255, 113, 0.4), 0 4px 12px rgba(0, 0, 0, 0.8);
}