/* --- Base Layout --- */
html, body {
    height: 100%; /* Uses absolute container height to fix the zoom/viewport bug */
    margin: 0;
    padding: 0;
    overflow: hidden; /* Locks the page from scrolling */
    background-color: #121212;
}

body { 
    font-family: Arial, sans-serif; 
    color: #e0e0e0; 
    padding: 15px; 
    box-sizing: border-box;
    display: flex; 
    flex-direction: column; 
    zoom: 0.75; 
}

h2, h3 { margin: 10px 0; color: #4DA8DA; }

/* 2-Column Layout (Top 75% region) */
.main-container { 
    flex: 1; 
    display: flex; 
    gap: 30px; 
    min-height: 0; 
    margin-bottom: 15px;
} 

.left-col { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    min-height: 0; 
}

/* Powerset Horizontal Tabs Fix */
.powerset-nav { 
    display: flex; 
    margin-bottom: 10px; 
    border-bottom: 2px solid #333; 
    padding-bottom: 10px; 
    flex-shrink: 0; 
}

#powerset-tabs {
    display: flex;
    flex-wrap: wrap; 
    gap: 10px;
}

.powerset-tab { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    cursor: pointer; 
    padding: 5px 15px; 
    border-radius: 4px; 
    transition: 0.2s; 
    background: transparent; 
    color: #aaa; 
    border: 1px solid transparent; 
}
.powerset-tab:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.powerset-tab.active { background: rgba(77, 168, 218, 0.1); color: #4DA8DA; border: 1px solid #4DA8DA; box-shadow: inset 0 0 10px rgba(77, 168, 218, 0.2); }
#current-powerset-title { display: none; } 

/* Make only the library scrollable */
#power-library {
    flex: 1;
    overflow-y: auto; 
    padding-right: 15px;
    min-height: 0;
}

/* Custom Scrollbar for the power library */
#power-library::-webkit-scrollbar { width: 8px; }
#power-library::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 4px; }
#power-library::-webkit-scrollbar-thumb { background: #4DA8DA; border-radius: 4px; }

/* Right Column - Active Slots */
.right-col { 
    width: 480px; 
    display: flex; 
    flex-direction: column; 
    min-height: 0; 
    flex-shrink: 0;
}

#selected-slots {
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 2px;
    min-height: 0;
}

/* Bottom Specs HUD (Bottom 25%) */
#active-specs-hud {
    height: 25%; 
    flex-shrink: 0; 
    background: rgba(20, 20, 20, 0.8);
    border-top: 2px solid #333;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    box-sizing: border-box;
}

/* Grid for powers */
.tier-section { margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; align-items: start; } 

/* Power Items */
.power { background: #1e1e1e; padding: 10px; border-radius: 6px; cursor: pointer; transition: 0.2s; border: 1px solid #333; display: flex; flex-direction: column; position: relative; overflow: hidden;}
.power:hover { background: #2a2a2a; border-color: #555; }
.power.selected { border-color: #4DA8DA; background: rgba(77, 168, 218, 0.1); }
.power.locked { opacity: 0.4; filter: grayscale(100%); cursor: not-allowed; }
.power-header { display: flex; align-items: center; gap: 15px; width: 100%; position: relative; }
.name { font-weight: bold; font-size: 16px; color: #fff; }
.tier-label { font-size: 12px; color: #aaa; margin-top: 2px; }
.tooltip { display: none; margin-top: 10px; font-size: 13px; color: #ccc; border-top: 1px solid #444; padding-top: 10px; line-height: 1.4; }
.power.expanded .tooltip { display: block; }
.adv-container { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid #444; }
.power.expanded .adv-container { display: flex; flex-direction: column; gap: 6px; }
.adv-points-label { font-size: 12px; color: #4DA8DA; margin-bottom: 4px; font-weight: bold; }
.adv-btn { background: #2a2a2a; border: 1px solid #444; padding: 6px 10px; border-radius: 4px; font-size: 13px; color: #ccc; cursor: pointer; transition: 0.2s; display: flex; justify-content: space-between; }
.adv-btn:hover { background: #3a3a3a; color: #fff; border-color: #666; }
.adv-btn.active { background: rgba(77, 168, 218, 0.2); border-color: #4DA8DA; color: #4DA8DA; font-weight: bold; }
.adv-btn.locked { opacity: 0.3; pointer-events: none; cursor: not-allowed; filter: grayscale(100%); }

/* Modal and Trees */
.floating-window { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #1e1e1e; border: 2px solid #4DA8DA; box-shadow: 0 0 20px rgba(0,0,0,0.9); z-index: 10000; border-radius: 8px; padding: 25px; display: none; color: #e0e0e0; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; padding-bottom: 15px; margin-bottom: 10px; }
#perk-modal-title { font-size: 36px !important; margin: 0; }
.modal-header div { font-size: 22px; color: #aaa; }
#modal-tree-spent { font-size: 28px; font-weight: bold; color: #fff; }

.close-btn { font-size: 32px; cursor: pointer; color: #888; }
.close-btn:hover { color: #ff5555; }
.big-tree-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.big-tree-btn { background: #2a2a2a; border: 2px solid #444; padding: 15px; border-radius: 6px; color: #fff; font-size: 16px; font-weight: bold; cursor: pointer; transition: 0.2s; text-align: center; }
.big-tree-btn:hover { background: #3a3a3a; border-color: #4DA8DA; transform: translateY(-2px); }

/* --- PERK WINDOW ENLARGEMENT --- */
.spec-perk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 15px; }
.spec-perk { background: #2a2a2a; border: 1px solid #444; border-radius: 6px; padding: 15px; display: flex; align-items: center; gap: 20px; transition: 0.2s; position: relative; overflow: hidden; }
.spec-perk-info { flex-grow: 1; }
.spec-perk-name { font-weight: bold; font-size: 20px; margin-bottom: 8px; }
.spec-perk-desc { font-size: 16px; color: #bbb; line-height: 1.4; }
.point-controls { display: flex; align-items: center; gap: 10px; background: #1a1a1a; padding: 8px; border-radius: 6px; border: 1px solid #333; }
.point-btn { background: #444; border: none; color: white; width: 34px; height: 34px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 24px; display: flex; align-items: center; justify-content: center; }
.point-btn:hover { background: #666; }
.point-display { font-weight: bold; font-size: 22px; width: 40px; text-align: center; color: #4DA8DA; }